Initiate Multi-Record Workflow
Initiate a multi-record workflow on a set of records. If any record is not in the relevant state or does not meet configured field conditions, the API returns INVALID_DATA for the invalid records and the workflow does not start.
/api/{version}/objects/objectworkflows/actions/{workflow_name}Headers
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/x-www-form-urlencoded |
Accept | application/json (default) or application/xml |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{workflow_name} | The workflow name value. |
Body Parameters
Section link for Body ParametersThe following parameters are required, but an Admin may set other fields as required in your Vault. To find which fields are required to start this workflow, Retrieve Multi-Record Workflow Details.
| Name | Description |
|---|---|
contents__sysrequired | Input a comma-separated list of records, in the format Object:{objectname}.{record_ID}. For example, Object:product__c.V3O000000005001. Maximum 100 records. |
description__sysrequired | Description of the workflow. Maximum 128 characters. |
Add Participants
Section link for Add ParticipantsTo add participants to a workflow, add the name of the participant control to the body of the request. The value should be a comma-separated list of user and group IDs in the format {user_or_group}:{id}. For example, approvers__c: user:123,group:234. Use Retrieve Document Workflow Details to get the names of all participant controls for the workflow.
Values in Required Field Prompts
Section link for Values in Required Field PromptsRequired fields cannot be omitted, set as blank, or defaulted to their existing value.
To preserve the existing value of a required field prompt in a workflow on a single record, submit the existing value as the new value.
For a workflow on multiple records, there is no way to preserve existing values in a field if that field is a required prompt. Setting a value for a prompt updates all records to the same single value.
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "contents__sys: Object:feature_record__c.V3O000000005001,Object:feature_record__c.V3O000000005002" \
-d "description__sys: CSR Approval" \
-d "exec_approver__c: user:10081" \
https://myvault.veevavault.com/api/v23.1/objects/objectworkflows/actions/Objectworkflow.approval__cResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data": {
"record_url": "/api/v23.1/vobjects/envelope__sys/0ER000000009003",
"record_id__v": "0ER000000009003",
"workflow_id": "8703"
}
}Response Details
Section link for Response DetailsOn SUCCESS, the response includes the following:
| Name | Description |
|---|---|
record_id__v | The id value of the envelope__sys record. |
workflow_id | The workflow id field value. |
Manage Multi-record Workflow Tasks
Section link for Manage Multi-record Workflow TasksMulti-record workflows are configured on the envelope__sys object. You can use the Workflow Task endpoints to retrieve workflow tasks, details, and initiate tasks.
Remove Records from Workflow
Section link for Remove Records from WorkflowYou can remove one or more records from an envelope__sys object using the removecontent action in the Initiate Workflow Action endpoint.