ghl_workflow_update_definition
Replaces a workflow definition in full while guarding against concurrent edits with the current version; only draft workflows can be updated.
Instructions
WORKFLOW API — limited availability: enabled for selected sub-accounts only; others get 403 WORKFLOW_API_NOT_ENABLED_FOR_LOCATION (not a token or scope problem). Suggested order: get step types -> build the definition -> validate (validate_workflow_definition, read-only) -> create (always lands in draft) -> publish via update status. Rate limits: integration daily quota + 10s burst (X-RateLimit-* headers) AND a per-sub-account budget per 10s window with reads and writes counted separately; no Retry-After is sent. Logs: default and max range 30 days; retained 60 days.
Update Workflow Definition
Limited availability. The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 WORKFLOW_API_NOT_ENABLED_FOR_LOCATION.
Replace a workflow definition in full. This is a complete overwrite — any step absent from the request is deleted, so always read the current definition first and send it back modified — the definition carries its own version, so sending back what you read keeps you protected against overwriting a concurrent edit. A stale version is rejected with 422 and nothing is written.
Draft only. A published workflow is rejected with 409: the overwrite would replace steps under contacts currently moving through it. Set the workflow to draft with Update Workflow Status, update it, then publish it again.
Order matters. Changing status advances the version, so read the definition after setting the workflow to draft: draft → read → update → publish. Reading first and drafting second leaves you holding a stale version.
Endpoint: PUT /workflows/{workflowId}/definition (Version header: v3; source: v3/workflows-v3.json)
OAuth scopes: workflows.write
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Request body (schema carried verbatim from the official OpenAPI spec). | |
| locationId | Yes | Sub-account (location) ID the workflow belongs to | |
| workflowId | Yes | Workflow ID |