Skip to main content

Start a workflow.

POST/api/v1/workflowsworkflows:write

Starts a workflow from an active template on documents you may read (a test run by a template author, dry_run, may use an inactive draft), or on no document at all with without_document true, as a record's sync-only workflow starts. The workflow and its rows are created now; the run is queued and the workers carry it on, so the workflow's status is pending until they do. An external recipient needs Workflows Assign External; a dry run also needs Run Workflow Tests.

Scopeworkflows:write
AsynchronousNo
MCP toolcreate_workflow
Portal permissionsstart_workflows

Parameters​

NameInTypeRequiredDescription
Docwize-Versionheaderstring (date)Optional
Idempotency-KeyheaderstringOptionalmax 255

Request body​

Content typeType
application/jsonWorkflowCreateInput

Responses​

StatusDescriptionBody
201Success.application/json Workflow or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409conflict, idempotency_in_progressapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422idempotency_key_reused, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

UserRef​

FieldTypeRequiredDescription
display_namestringRequired
kindstring: user, system, integration or stringRequired
user_idstring or nullRequired

Workflow​

FieldTypeRequiredDescription
due_atstring (date-time) or nullRequired
is_cancelledbooleanRequired
is_completedbooleanRequired
open_action_countintegerRequired≥ -2147483648; ≤ 2147483647
open_action_count_for_meintegerRequired≥ -2147483648; ≤ 2147483647
recipientsarray of WorkflowRecipientRequiredWho the workflow was sent to (its recipients): the people and groups it shows to, beside the requests it sends them.
started_atstring (date-time) or nullRequired
started_byUserRefRequired
statusstringRequiredcancelled, failed, in_progress, completed or pending (open enum).
subjectstringRequired
template_namestring or nullRequired
workflow_idstringRequired
workflow_template_version_idstring or nullRequiredThe version of the template the workflow runs.

WorkflowCreateInput​

FieldTypeRequiredDescription
document_idsarray of stringOptionalThe documents the workflow runs on, one item each. Required unless without_document is true.
dry_runbooleanOptionalRun as a test: documents are not changed and real recipients are not notified. A test run needs Run Workflow Tests and may use an inactive draft template.
inputsarray of WorkflowStartInputInputOptional
messagestring or nullOptionalA message posted to the workflow when it starts.
subjectstringRequired
without_documentbooleanOptionalStart the workflow on no document, as a record's sync-only workflow does: its one item is not a document. document_ids must then be empty.
workflow_template_idstringRequiredThe template's root ID; the latest version runs.

WorkflowRecipient​

FieldTypeRequiredDescription
group_idstring or nullRequired
typestringRequireduser, group or unknown (open enum).
type_codestring or nullRequiredThe stored type code, for an unknown recipient type; null otherwise.
userUserRef or nullRequired

WorkflowStartInputInput​

FieldTypeRequiredDescription
node_idstring or nullOptionalThe Custom Input step the answer is for (its node_id from get_workflow_template_start_inputs).
node_typestringRequired
node_valuestring or nullOptional