Skip to main content
POST
/
workflows
[Beta] Create a workflow
curl --request POST \
  --url https://api.open.cx/workflows \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "trigger_type": "manual-trigger",
  "workflow_blocks": [
    "<unknown>"
  ],
  "description": "<string>",
  "trigger_configuration": "<unknown>",
  "trigger_constraints": "<unknown>",
  "workflow_editor_state": "<unknown>"
}
'
{
  "id": 123,
  "workflow_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "is_active": true,
  "trigger_type": "<string>",
  "version_number": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "workflow_blocks": [
    "<unknown>"
  ],
  "trigger_configuration": "<unknown>",
  "trigger_constraints": "<unknown>",
  "webhook_url": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

Workflow name

Minimum string length: 1
trigger_type
enum<string>
required

What starts the workflow. Use "manual-trigger" for on-demand execution, "ai-trigger" for AI-initiated, "webhook" for external HTTP triggers, "cron-trigger" for scheduled runs, or event-based triggers like "ticket-created", "contact-created", etc.

Available options:
manual-trigger,
ai-trigger,
cron-trigger,
form-trigger,
webhook,
contact-created,
phone-call-started,
phone-call-finished,
ticket-created,
ticket-reassigned,
ticket-resolved,
ticket-handoff,
pre-ticket-handoff,
ticket-tag-added,
ticket-inactive,
sequence-completed,
csat-score-submit,
prohibited-topic-detected,
sla-first-reply-breached,
sla-next-reply-breached,
sla-resolution-breached,
voice-call-transferred,
pre-voice-call-transfer,
pre-phone-call-finished,
manual-ticket-trigger
workflow_blocks
any[]
required

Array of workflow steps and control-flow blocks. Each step is an object with { "$kind": "Action", "id": "", "type": "", "name": "", "input": { ... } }. Control-flow blocks use { "$kind": "Block", "type": "if-else", "id": "", "inputs": { "condition": { "operatorName": "equals", "left": "{{step_id.output.field}}", "right": "value" } }, "branches": { "then": [...steps], "else": [...steps] } }. Use {{step_id.output.field}} to reference outputs from previous steps.

description
string

Workflow description

trigger_configuration
any | null

Trigger-specific configuration (e.g. cron expression for cron-trigger)

trigger_constraints
any | null

JSON Logic constraints that must be satisfied for the trigger to fire

workflow_editor_state
any | null

React Flow editor state (nodes, edges, viewport) for the dashboard visual editor

Response

Default Response

id
number
required

Version serial ID

workflow_id
string
required

Workflow UUID (groups all versions of the same workflow)

name
string
required

Workflow name

description
string | null
required

Workflow description

is_active
boolean | null
required

Whether this version is currently active

trigger_type
string
required

Trigger type: "manual-trigger", "ai-trigger", "cron-trigger", "webhook", "form-trigger", or event-based triggers

version_number
number
required

Version number (increments with each edit)

created_at
string<date-time>
required
updated_at
string<date-time>
required
workflow_blocks
any[] | null
required

Workflow step/block definitions

trigger_configuration
any | null
required

Trigger-specific configuration

trigger_constraints
any | null
required

Trigger constraint rules (JSON Logic)

webhook_url
string | null
required

Trigger URL for webhook-type workflows. Call this URL (POST) to trigger the workflow. Null for non-webhook workflows.