Update the Workflow draft
PATCH /v1/workflows/{workflow_id}
| Property | Value |
|---|---|
| Operation | update_workflow |
| Group | Workflows |
| Scope | workflows:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited workflow.update (mutation) |
| Released in | 1.59.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Replaces the named fields of the draft at the revision If-Match names and checks the merged definition as a create does (1.59.0). scope is fixed at create. An archived Workflow is refused with workflow_archived.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the workflows:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X PATCH "$VOCAL_API/v1/workflows/wfl_..." \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"' \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/workflows/wfl_...`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import requests
response = requests.patch(
f"{os.environ['VOCAL_API']}/v1/workflows/wfl_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
json={},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
workflow_id | path | WorkflowId | yes | The id of a Workflow: wfl_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
if-match | header | string | yes | The revision the change was made against, quoted as the ETag returns it, or * to overwrite. |
Request body
Content type application/json, required: WorkflowUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | AgentId | no | |
correlation | WorkflowCorrelationInput | no | |
description | string or null | no | For reviewers; never spoken or sent to a model. |
entry | WorkflowNodeId | no | |
inputs | map of WorkflowFieldInput | no | Call variables (conversation) or start inputs (process). |
limits | WorkflowLimitsInput | no | |
name | string | no | Kebab-case, unique per Organization. |
nodes | array of WorkflowNodeInput | no | Replaces every node. The merged draft is checked as a create is. |
outputs | map of WorkflowFieldInput | no | The typed result returned to a parent or a starting Process. |
settings | map of WorkflowSetting | no | Process scope: named thresholds and constants that evaluate nodes read. |
slots | map of WorkflowFieldInput | no | Conversation scope: the Session's typed slots. |
vars | map of WorkflowFieldInput | no | Process scope: the instance's working data. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | Workflow | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | workflow_archived |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed, capability_not_available |
428 | application/json | ErrorEnvelope | precondition_required |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is Workflow.
| Field | Type | Required | Description |
|---|---|---|---|
active_version | integer or null | yes | The version the next Agent version publish pins, or null when none is active. |
agent_id | AgentId | no | Conversation scope only, and required there: the default Agent, which supplies voice, transcriber, model, Policies, Tools and destinations. |
archived_at | Timestamp or null | yes | When DELETE archived the Workflow, or null. An archived Workflow takes no write, publish or activation (409 workflow_archived); its pinned versions keep running. |
correlation | WorkflowCorrelation | no | |
created_at | Timestamp | yes | |
description | string or null | yes | For reviewers; never spoken or sent to a model. |
entry | WorkflowNodeId | yes | |
id | WorkflowId | yes | |
inputs | map of WorkflowField | no | Call variables (conversation) or start inputs (process). |
latest_version | integer or null | yes | The highest published version, or null before the first publish. |
limits | WorkflowLimits | yes | |
name | string | yes | Kebab-case, unique per Organization. |
nodes | array of WorkflowNode | yes | Exactly one entry node; at most 200 nodes, loop bodies included (target). |
object | "workflow" | yes | |
organization_id | OrganizationId | yes | |
outputs | map of WorkflowField | no | The typed result returned to a parent or a starting Process. |
revision | integer | yes | Counts writes to the draft; returned as the ETag and required in If-Match. |
scope | WorkflowScope | yes | |
settings | map of WorkflowSetting | no | Process scope: named thresholds and constants that evaluate nodes read. |
slots | map of WorkflowField | no | Conversation scope: the Session's typed slots. |
updated_at | Timestamp | yes | |
vars | map of WorkflowField | no | Process scope: the instance's working data. |