Skip to main content
To build workflows in the UI, see Building Workflows. To run a workflow on a list of records, see Batch Processing.

The workflow definition

A workflow is a directed graph of blocks and edges. Save this body as workflow.json. It is the request body for a new workflow.
workflow.json
Each block:

Create a workflow from JSON

Send workflow.json to POST /v1/workflows. Keep the workflow_id from the response to run and update the workflow.
HTTP 201 (abridged)
Sixtyfour validates the definition before saving. An invalid definition returns 422 and nothing is stored. With an OAuth access token, an invalid definition is saved as a draft, which never runs. See Limits.

Export an existing workflow

Build the workflow in the editor once, then export it:
  • In the editor, open the More options menu (⋮) next to Run and select View Workflow Definition. The dialog shows the Workflow ID and the JSON definition.
  • With the API, GET /v1/workflows/{workflow_id} returns the graph under definition and its revision.
Export the graph and the revision from the same response, so the file records which version your edits start from:
Edit name, description or definition in workflow-update.json. Leave revision as exported.

Deploy from CI

Commit workflow-update.json. CI sends it as is to PATCH /v1/workflows/{workflow_id}, with the workflow’s ID in the WORKFLOW_ID environment variable.
The response is the updated workflow. Its revision is higher when the update changed something. Runs that already started keep the definition they started with. If the workflow changed after you exported it, the update returns 409 with error_code: "workflow_changed" and nothing is saved. Export the current workflow again, reapply your changes and resubmit. Copying only the new revision into your old file overwrites the other person’s changes. An update without revision returns 422.

Authentication

Workflow requests accept an API key or an OAuth access token. A workflow belongs to the team of the credential that creates it. To copy a workflow to another organization, create it there with that organization’s credential and the same workflow.json. See Get API Key and OAuth Clients.

Errors

See Handling Errors. For the original /workflows/create_workflow and /workflows/update_workflow routes, which keep working, see Legacy Workflow Management.