Skip to main content
The Workflows API is currently in beta. Endpoints may change without notice.
The Workflows API lets you programmatically create, manage, and trigger automated workflows. Workflows are multi-step automations that run in response to events, schedules, webhooks, or manual triggers.

Key Concepts

  • Workflow — A named automation with a trigger type and one or more versions
  • Version — Each edit creates a new version; only one version is active at a time
  • Run — A single execution of a workflow, with status tracking and duration
  • Trigger type — What starts the workflow: manual, AI-triggered, cron, webhook, form, or event-based
  • Action type — A step in the workflow (e.g. ask-ai, send-webhook, tag-ticket)
  • Block — A control-flow structure (if-else, switch) that branches execution

Workflow Lifecycle

  1. Discover available action and trigger types via the definitions endpoint
  2. Validate your workflow blocks before creating
  3. Create a workflow (saved as inactive draft)
  4. Activate to make the workflow live
  5. Trigger manually or let it fire automatically based on its trigger type
  6. Monitor runs and their statuses

Versions

Get returns the latest version by default. The latest version is not always the one that runs: a change saved while a version is active becomes an inactive draft above it.
  • List versions shows every saved version of a workflow, newest first, with its version_number and is_active.
  • GET /workflows/{workflow_id}?version=2 returns that version with its blocks and trigger configuration. ?version=active returns the version that is running, and answers 404 when the workflow has no active version.
  • Activate a version activates one saved version and deactivates the one that was active. Use it to roll back to an earlier version. Activate always activates the latest version.
Versions are kept: a version cannot be deleted on its own. After a rollback the newest saved version is still the latest (it can be newer than the version you rolled back from), so Update keeps building on it and Activate would put it live again. To continue from the version that is running, read it with ?version=active and send its definition in your next update.

Replies with quick reply suggestions

The outbound-reply-to-ticket action accepts an optional quickReplySuggestions array of plain-text labels, for example ["Track transfer", "Cancel transfer", "Speak to someone"]. Omit it or pass [] to send the existing reply without buttons. Discover the action and its input schema through Definitions, then validate the workflow before activating it. Use at most 3 unique, non-empty labels, each up to 20 characters. A selection becomes a normal customer reply; it does not pause or branch the sending workflow. Suggestions support the OpenCX web widget, directly connected WhatsApp, Messenger and Instagram channels, and API clients that render message options. Unsupported delivery paths fail the step instead of silently dropping the suggestions. On WhatsApp, the rendered message body is limited to 1,024 characters, and the customer’s 24-hour reply window must be open. Outside that window, send an approved template. See workflow quick reply suggestions for setup, translation behavior, and channel limits.

Set the session language

The set-session-language action records the language the customer speaks on a session, as an agent changing it in the inbox would, and adds a language-change event to the session’s timeline attributed to the workflow run, even when the session already had that language. Its input is ticketNumber and language (a language code such as el, da or pt-BR); its output is the language now recorded. Use it in a call flow right after the caller picks a language: live transcripts of that call are then tuned to that language, and still keep words in the team’s or organization’s call languages. The step fails for a value that is not a language code or a session of another organization.

Send a macro

The outbound-send-macro action sends an org-wide macro to a session: its body, attachments and up to 3 options, under the macro’s option IDs. Its input is ticketNumber, macroId, an optional language (a two-letter code; defaults to the session’s language), sendToThirdPartyTicketingIntegration and fulfillSla. The macro goes out translated when a translation into that language is ready, and as written otherwise; it is never machine-translated per message, so its body and option labels always match. A tap on an option of type workflow runs the macro-option-clicked workflows for that macro, and the AI does not reply to the tap. When a first-contact-message-received or contact-message-received workflow with runSynchronously on sends such a macro, the AI does not reply to the message the workflow answered either, so the customer’s tap carries the session on. While such a question waits for its tap, the web chat hides the text box; a macro with only text options leaves it open. Set runSynchronously on the macro-option-clicked workflow so its reply exists when the tap’s response returns. The step fails for a personal macro, a macro of another organization, a macro whose body uses {{variables}}, a macro with attachments on WhatsApp, Messenger or SMS sessions (which do not deliver them), or a session that cannot show options. Options follow the same channel and WhatsApp limits as quick reply suggestions above.

Send email templates with BCC

Use Send Email Template (send-email-template-to-contact) to send a saved email template to a contact. In the workflow editor, select the template, sender prefix and verified domain, and set Contact ID. Add addresses under Bcc to send hidden copies; both the list and individual addresses can use workflow variables. Cc remains available for visible copies. The optional bcc input is an array of email addresses, for example ["[email protected]", "[email protected]"]. Leaving it unset or empty preserves existing sending behavior. Discover the input fields through Definitions and validate the workflow before activating it.
  • Leading and trailing whitespace and blank entries are removed. Duplicate addresses are matched without regard to case.
  • If an address is already the contact’s email or appears in Cc, it is removed from Bcc; the existing visible recipient remains.
  • An invalid non-empty address fails the action before any email is sent.
  • BCC addresses receive a copy without appearing in the recipients’ To or Cc fields.
Copies share the contact’s email content and unsubscribe links. If a copied recipient uses an unsubscribe link, it unsubscribes the contact. If the contact is already unsubscribed, no copies are sent either.

Billing usage limits

When a workflow is covered by a workflows price whose monthly usage limit is reached (see Workflows limits), it starts no new runs until the limit resets on the 1st (UTC) or is raised. Meanwhile Trigger, invoke and rerun answer 429 with:
The workflow’s webhook URL answers 429 too. Runs already in progress finish, and test runs are never refused.

Available Endpoints

Definitions

List available action and trigger types

Validate

Validate workflow blocks before creating

Create Workflow

Create a new workflow

List Workflows

List all workflows

Get Workflow

Get a specific workflow with full details

List Versions

List the saved versions of a workflow

Update Workflow

Update a workflow (creates new version)

Delete Workflow

Delete a workflow

Activate

Activate a workflow version

Activate a Version

Activate an earlier version of a workflow

Deactivate

Deactivate a workflow

Trigger Workflow

Manually trigger a workflow

List Runs

List workflow execution runs

Get Run

Get a specific run