# Types.RunWorkflowPayload

Input type describing one Document AI Workflow run: the workflow, its documents, its field values, and the associated record.

> Kind: Apex type · Updated: 2026-11-17

Custom Apex type representing one input entry for Client.runWorkflow(). A payload is one run of one workflow. Set its values through the constructor: the fields are not writable from code outside the CloudFiles package.

## Fields

### Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| workflowId | String | required | Id of the published workflow to run. This is the Workflow Id set when the workflow was built, such as invoice-review, not a Salesforce record Id. It is the same in every environment, and the latest published version always runs. |
| documents | List&lt;<a href="#/apex-type-document-slot-binding">DocumentSlotBinding</a>&gt; | required | The documents to read, each paired with the slot it fills. To send several documents to one slot, add several DocumentSlotBinding entries with the same slot name. |
| fields | List&lt;<a href="#/apex-type-field-value">FieldValue</a>&gt; | optional | Name and value pairs passed into the run, for anything the workflow needs that the documents do not contain. Each name must match an input the workflow declares. |
| recordId | String | optional | Id of the Salesforce record the run is associated with. The workflow's steps cannot read it, so if the workflow needs the record Id, pass it in fields as well. |

## Constructors

```apex
global RunWorkflowPayload(
  String workflowId,
  List<DocumentSlotBinding> documents,
  List<FieldValue> fields,
  String recordId
)
```
