Skip to main content
PUT
cURL
expected_revision is a compare-and-set token. A fresh workflow’s draft is at revision 0, each save returns the next revision, and publishing resets the new draft to 0. If your value is stale the save fails with 409 revision_conflict carrying current_revision — re-read the draft and retry.
Draft saves accept any well-formed JSON object up to 512 KB. Graph rules (reachability, cycles, node configs) are checked by Validate and enforced at Publish. See Nodes and Conditions and variables for the definition schema.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workflow_id
string<uuid>
required

The unique id of the workflow

Body

application/json
expected_revision
integer
required

The revision you last read. A fresh workflow's draft starts at 0, and publish resets the new draft to 0. A stale value returns 409 revision_conflict carrying current_revision.

Required range: x >= 0
definition
object
required

The workflow graph. nodes is a flat list of node envelopes — {id, type, name, config, cases} — where type is one of start, agent, extraction, api, time, retry, aisensy_whatsapp or end. Each node's cases array routes to the next node via condition expressions (time nodes use a single to instead, end nodes have neither). See Nodes and Conditions and variables for the full schema, and the Node Types API for every config parameter with defaults and bounds.

Example:

Response

Draft saved

revision
integer
required

The new draft revision. Send it as expected_revision on the next save.