Generation request and result fields
Last updated 10 October 2026.
Flow, Apex and REST make documents through the same service as the Generate a document panel and Claude, as the person who runs them. No actor, permission or access override is accepted.
The same five operations
| Operation | Flow action | Apex | REST operation |
Claude and Agentforce tool |
|---|---|---|---|---|
| Make documents | Generate Docable document | DcsGenerateV1.generate |
requestGeneration |
generate_document |
| Start a background job | Start Docable generation job | generate with several Ids |
requestGeneration |
start_generation_job |
| Read a run | Get Docable generation | DcsGenerateV1.status |
getGeneration |
get_generation |
| Cancel the documents not started | Cancel Docable generation | DcsGenerateV1.cancel |
cancelGeneration |
cancel_generation |
| Make failed documents again | Retry Docable generation | DcsGenerateV1.retry |
retryGeneration |
retry_generation |
What you send
| Meaning | Flow input | Apex field | REST argument |
|---|---|---|---|
| The template; its active version is used | Template Id | templateId |
templateId |
| An exact version: the active one, or one that was active before | Template version Id | templateVersionId |
templateVersionId |
| The exact name of an active template you can read | Template name | Not in Apex: look the Id up | templateName |
| One record | Record Id | A list of one in recordIds |
recordId |
| Several records, in order | Record Ids | recordIds |
recordIds |
PDF, DOCX or both; PDF if empty |
Outputs (PDF;DOCX for both) |
outputs, a list |
outputs, a list |
User (default) reads with your access. System needs the template to allow it and Docable Generate in System Mode |
Run mode | runMode |
runMode |
| A new lowercase UUID per request. The same key with the same request returns the same run | Request key | requestKey |
requestId in the envelope |
| Answers to the template’s “ask when generating” questions | Answers JSON | answersJson |
answers, an object |
| Optional: one of the template’s Brand Kits for every document of the run, by name, record Id or logical Id. Blank keeps the template’s own choice. Only a kit the template allows, approved and proved with its active version; any other is refused, naming the kits allowed | Brand Kit | brandKit |
brandKit |
| Keep each document as a Salesforce File (default) | Keep the files | keepFile |
keepFile |
| Add each File to its record (default) | Add to the record | linkToRecord |
linkToRecord |
| With the Files not kept: hours until removal, 1 to 168, default 24 | Temporary hours | temporaryHours |
temporaryHours |
| Also one PDF of every document, in record order | Combine into one PDF | combine |
combine |
| A blank page after any document with an odd number of pages | Blank pages for two-sided printing | duplex |
duplex |
| Queue the work even for one record | Run in background | runInBackground |
runInBackground |
A percent answer is in percentage points: 20 means 20%. A request carries any number of record Ids of one object, within what one call can hold (about 40,000 while someone waits, about 80,000 in a background call). Unknown arguments are refused over REST, and flags must be JSON booleans.
What you get back
| Meaning | Flow output | Apex Result |
REST answer |
|---|---|---|---|
| The request was accepted. A queued run is accepted, not finished | Success | success |
status is Completed or Accepted |
| Every document has finished, made or not | Completed | completed |
result |
| The run | Run Id, Run name (for example GR-000012) | runId |
operationRef |
| The run’s state | State | state |
result |
| Counts | Documents, Documents made, Documents failed, Documents waiting, Documents cancelled | itemCount, succeededCount, partialCount, failedCount, cancelledCount, queuedCount |
result |
| The first made PDF and Word file | PDF file Id, PDF file name, PDF link, Word file Id, Word file name, Word link | documents[].files[] |
result.items[].outputs[] |
| The combined PDF | Combined PDF Id | combined |
result |
| Up to 200 documents with their Files, states and reason codes | Documents JSON | documents |
result.items |
| Why a request was refused | Error category, Reason code, Message, Next action, Correlation Id, Replayed | errorCategory, reasonCode, message, nextAction, correlationId, replayed |
issues[0] |
Nothing throws. A refusal is a result with a stable reason code and one safe message that contains no record values: see Error and reason codes.
Run states
| State | Shown as | Meaning |
|---|---|---|
Queued |
Queued | Accepted and waiting. Never success |
Running |
Being made | Documents are being made. Never success |
Succeeded |
Made | Every document has every output |
PartialSuccess |
Partly made | Some outputs were not made |
Failed |
Failed | The documents failed |
Cancelled |
Cancelled | Cancelled before they were made |
OutcomeUnknown |
Outcome unknown | A value provider may have acted and Docable cannot tell: retry refuses it |
Something unclear or wrong? Tell support.