Workflows API
Complete API reference for creating, managing, executing, and debugging automated workflows.
Overview
The Workflows API allows you to programmatically create, manage, and execute automated workflows. Workflows consist of interconnected nodes that process data, make decisions, and integrate with external services. The API also supports versioning, debug sessions, and workflow templates.
Endpoint Summary
Workflow CRUD
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/workflows | List all workflows |
POST | /api/v1/workflows | Create a workflow |
GET | /api/v1/workflows/:id | Get a workflow |
GET | /api/v1/workflows/slug/:slug | Get workflow by slug |
PUT | /api/v1/workflows/:id | Update a workflow |
DELETE | /api/v1/workflows/:id | Delete a workflow |
POST | /api/v1/workflows/:id/publish | Publish workflow |
POST | /api/v1/workflows/:id/archive | Archive workflow |
POST | /api/v1/workflows/:id/pause | Pause workflow |
POST | /api/v1/workflows/:id/resume | Resume workflow |
POST | /api/v1/workflows/:id/validate | Validate workflow definition |
GET | /api/v1/workflows/:id/versions | List workflow versions |
GET | /api/v1/workflows/:id/versions/:version | Get specific version |
Execution
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/workflows/:id/trigger | Trigger workflow execution |
POST | /api/v1/workflows/:id/test-run | Test run with sample data |
GET | /api/v1/workflows/:id/executions | List executions for workflow |
GET | /api/v1/workflows/:id/execution-summary | Execution summary stats |
GET | /api/v1/workflows/:id/running | Get running executions |
Workflow Executions (Global)
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/workflow-executions | List all executions |
GET | /api/v1/workflow-executions/:id | Get execution |
GET | /api/v1/workflow-executions/:id/detail | Detailed execution view |
GET | /api/v1/workflow-executions/:id/nodes | Node execution results |
GET | /api/v1/workflow-executions/:id/nodes/:nodeId | Single node result |
POST | /api/v1/workflow-executions/:id/cancel | Cancel execution |
POST | /api/v1/workflow-executions/:id/retry | Retry failed execution |
Debug
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/workflows/:id/debug/start | Start debug session |
GET | /api/v1/executions/:id/debug/state | Get debug state |
PUT | /api/v1/executions/:id/debug/breakpoints | Set breakpoints |
POST | /api/v1/executions/:id/debug/continue | Continue execution |
POST | /api/v1/executions/:id/debug/step-over | Step over current node |
POST | /api/v1/executions/:id/debug/resume | Resume execution |
POST | /api/v1/executions/:id/debug/skip | Skip node |
POST | /api/v1/executions/:id/debug/modify-input | Modify node input |
POST | /api/v1/executions/:id/debug/abort | Abort debug session |
Templates
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/workflows/from-template/:templateId | Create workflow from template |
GET | /api/v1/workflow-templates | List templates |
GET | /api/v1/workflow-templates/categories | List template categories |
GET | /api/v1/workflow-templates/:id | Get template details |
Node Types
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/workflow-node-types | List all node types |
GET | /api/v1/workflow-node-types/categories | List node categories |
GET | /api/v1/workflow-node-types/by-category | Node types grouped by category |
List Workflows
GET /api/v1/workflows
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 20 | Items per page (max 100) |
status | string | - | Filter: draft, published, archived, paused |
search | string | - | Search by name |
trigger_type | string | - | Filter by trigger type |
sort | string | -updated_at | Sort field (- prefix for descending) |
Response
json{ "data": [ { "id": "wf_abc123", "name": "Lead Processing", "slug": "lead-processing", "description": "Processes new leads from forms", "status": "published", "trigger_type": "form_submission", "node_count": 8, "execution_count": 1520, "last_executed_at": "2025-12-07T15:30:00Z", "version": 3, "created_at": "2025-11-01T10:00:00Z", "updated_at": "2025-12-07T15:30:00Z" } ], "pagination": { "page": 1, "per_page": 20, "total": 12, "total_pages": 1 } }
Example
bashcurl "/api/v1/workflows?status=published&per_page=10" \ -H "Authorization: Bearer your_api_key"
Create Workflow
POST /api/v1/workflows
Request Body
json{ "name": "Lead Processing", "description": "Automatically process and score new leads", "trigger": { "type": "form_submission", "config": { "form_id": "form_abc123" } }, "nodes": [ { "id": "node_1", "type": "trigger_form", "position": { "x": 100, "y": 100 }, "data": { "label": "Form Submitted" } }, { "id": "node_2", "type": "action_ai", "position": { "x": 100, "y": 250 }, "data": { "label": "Score Lead", "agent_id": "agent_xyz789", "prompt": "Analyze this lead and provide a score from 1-100: {{input}}" } }, { "id": "node_3", "type": "condition", "position": { "x": 100, "y": 400 }, "data": { "label": "Check Score", "condition": "{{node_2.score}} >= 70" } }, { "id": "node_4", "type": "action_http", "position": { "x": -50, "y": 550 }, "data": { "label": "Send to CRM", "url": "https://api.salesforce.com/leads", "method": "POST", "body": "{{input}}" } }, { "id": "node_5", "type": "action_email", "position": { "x": 250, "y": 550 }, "data": { "label": "Add to Nurture", "to": "[email protected]", "subject": "New lead for nurturing" } } ], "edges": [ { "source": "node_1", "target": "node_2" }, { "source": "node_2", "target": "node_3" }, { "source": "node_3", "target": "node_4", "label": "true" }, { "source": "node_3", "target": "node_5", "label": "false" } ] }
Workflow Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workflow name (max 100 chars) |
description | string | No | Workflow description |
trigger | object | Yes | Trigger configuration |
nodes | array | Yes | Workflow nodes |
edges | array | Yes | Node connections |
variables | object | No | Workflow-level variables |
settings | object | No | Execution settings |
Trigger Types
| Type | Description | Config |
|---|---|---|
manual | Manual execution | None |
schedule | Cron-based schedule | cron, timezone |
webhook | HTTP webhook received | path, method |
form_submission | Form is submitted | form_id |
event | Internal event | event_type |
data_table | Data table change | table_id, event |
Node Types
| Type | Category | Description |
|---|---|---|
trigger | Trigger | Generic entry point |
trigger_webhook | Trigger | Webhook-triggered entry |
trigger_schedule | Trigger | Schedule-triggered entry |
trigger_form | Trigger | Form submission entry |
trigger_data_table | Trigger | Data table event entry |
action_ai | Action | AI/LLM processing |
action_http | Action | HTTP request |
action_email | Action | Send email |
action_tool | Action | Execute a tool |
action_code | Action | Custom code execution |
action_delay | Action | Wait for a duration |
action_data_source | Action | Read from data source |
action_data_write | Action | Write to data source |
action_data_share | Action | Create a public share link + password for a data table |
action_data_lookup | Action | Lookup data record |
action_notification | Action | Send notification |
condition | Logic | Conditional branching |
loop | Logic | Iterate over items |
transform | Logic | Data transformation |
approval | Logic | Human approval gate |
end | Control | Workflow termination |
Response
json{ "data": { "id": "wf_abc123", "name": "Lead Processing", "slug": "lead-processing", "description": "Automatically process and score new leads", "status": "draft", "trigger": { "type": "form_submission", "config": { "form_id": "form_abc123" } }, "nodes": [...], "edges": [...], "node_count": 5, "version": 1, "created_at": "2025-12-07T10:00:00Z", "updated_at": "2025-12-07T10:00:00Z" } }
Get Workflow
GET /api/v1/workflows/:id
Returns the full workflow definition including nodes, edges, settings, and execution stats.
Response
json{ "data": { "id": "wf_abc123", "name": "Lead Processing", "slug": "lead-processing", "description": "Automatically process and score new leads", "status": "published", "trigger": { "type": "form_submission", "config": { "form_id": "form_abc123" } }, "nodes": [...], "edges": [...], "variables": { "crm_api_key": "{{secrets.CRM_API_KEY}}" }, "settings": { "timeout_seconds": 300, "retry_on_failure": true, "max_retries": 3 }, "stats": { "total_executions": 1520, "successful_executions": 1498, "failed_executions": 22, "avg_duration_ms": 4500 }, "version": 3, "created_at": "2025-11-01T10:00:00Z", "updated_at": "2025-12-07T15:30:00Z", "published_at": "2025-11-02T09:00:00Z" } }
Get Workflow by Slug
GET /api/v1/workflows/slug/:slug
Same response format as Get Workflow. Useful when you have the human-readable slug instead of the UUID.
Update Workflow
PUT /api/v1/workflows/:id
Only include fields you want to update. Returns the updated workflow object.
json{ "name": "Updated Lead Processing", "nodes": [...], "edges": [...], "settings": { "timeout_seconds": 600 } }
Delete Workflow
DELETE /api/v1/workflows/:id
Returns 204 No Content. Deleting a workflow also cancels any running executions.
Lifecycle Endpoints
Publish
POST /api/v1/workflows/:id/publish
Changes status from draft to published, enabling automatic triggers.
Archive
POST /api/v1/workflows/:id/archive
Archives the workflow. Disables triggers and prevents new executions while retaining history.
Pause
POST /api/v1/workflows/:id/pause
Temporarily pauses a published workflow. Triggers are disabled but the workflow remains published.
Resume
POST /api/v1/workflows/:id/resume
Resumes a paused workflow, re-enabling its triggers.
Response (all lifecycle endpoints)
json{ "data": { "id": "wf_abc123", "status": "published", "updated_at": "2025-12-07T10:00:00Z" } }
Validate Workflow
POST /api/v1/workflows/:id/validate
Validates the workflow definition without executing it. Checks for missing connections, invalid node configurations, and circular dependencies.
Response
json{ "data": { "valid": true, "warnings": [ { "node_id": "node_5", "message": "Email node has no error handler configured" } ], "errors": [] } }
Versions
List Versions
GET /api/v1/workflows/:id/versions
json{ "data": [ { "version": 3, "created_at": "2025-12-07T15:30:00Z", "published": true, "node_count": 8, "change_summary": "Added notification node" }, { "version": 2, "created_at": "2025-12-01T10:00:00Z", "published": false, "node_count": 7, "change_summary": "Added condition branch" } ] }
Get Specific Version
GET /api/v1/workflows/:id/versions/:version
Returns the full workflow definition as it existed at that version.
Trigger Workflow
POST /api/v1/workflows/:id/trigger
Request Body
json{ "input": { "name": "John Doe", "email": "[email protected]", "company": "Acme Inc" }, "async": true, "callback_url": "https://your-server.com/callback" }
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
input | object | No | Input data for the workflow |
async | boolean | No | Run asynchronously (default: true) |
callback_url | string | No | URL to call when execution completes |
Response (Async)
json{ "data": { "execution_id": "exec_xyz789", "workflow_id": "wf_abc123", "status": "running", "started_at": "2025-12-07T10:30:00Z" } }
Response (Sync)
json{ "data": { "execution_id": "exec_xyz789", "workflow_id": "wf_abc123", "status": "completed", "output": { "lead_score": 85, "action_taken": "sent_to_crm", "crm_id": "lead_123456" }, "started_at": "2025-12-07T10:30:00Z", "completed_at": "2025-12-07T10:30:05Z", "duration_ms": 5000 } }
Example
bashcurl -X POST "/api/v1/workflows/wf_abc123/trigger" \ -H "Authorization: Bearer your_api_key" \ -H "Content-Type: application/json" \ -d '{ "input": { "name": "Jane Smith", "email": "[email protected]" } }'
Test Run
POST /api/v1/workflows/:id/test-run
Executes the workflow in test mode with sample data. Test runs are not counted in production stats and are flagged in execution history.
Request Body
json{ "input": { "name": "Test User", "email": "[email protected]" }, "stop_at_node": "node_3" }
| Field | Type | Required | Description |
|---|---|---|---|
input | object | Yes | Sample input data |
stop_at_node | string | No | Stop execution at this node ID |
List Executions (per Workflow)
GET /api/v1/workflows/:id/executions
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 20 | Items per page |
status | string | - | Filter: pending, running, completed, failed, cancelled |
after | string | - | Executions after ISO date |
before | string | - | Executions before ISO date |
Response
json{ "data": [ { "id": "exec_xyz789", "workflow_id": "wf_abc123", "status": "completed", "trigger_type": "form_submission", "started_at": "2025-12-07T10:30:00Z", "completed_at": "2025-12-07T10:30:05Z", "duration_ms": 5000 }, { "id": "exec_abc456", "workflow_id": "wf_abc123", "status": "failed", "trigger_type": "manual", "error": { "node_id": "node_4", "message": "HTTP request failed: 503 Service Unavailable" }, "started_at": "2025-12-07T10:25:00Z", "failed_at": "2025-12-07T10:25:03Z", "duration_ms": 3000 } ], "pagination": { "page": 1, "per_page": 20, "total": 42, "total_pages": 3 } }
Execution Summary
GET /api/v1/workflows/:id/execution-summary
Returns aggregated execution statistics for a workflow.
json{ "data": { "total": 1520, "completed": 1498, "failed": 12, "cancelled": 10, "avg_duration_ms": 4500, "p95_duration_ms": 12000, "success_rate": 98.6, "last_24h": { "total": 45, "completed": 44, "failed": 1 }, "last_7d": { "total": 312, "completed": 308, "failed": 4 } } }
Running Executions
GET /api/v1/workflows/:id/running
Returns all currently running executions for the workflow.
Global Executions
List All Executions
GET /api/v1/workflow-executions
Lists executions across all workflows. Supports the same query parameters as per-workflow listing, plus workflow_id filter.
Get Execution
GET /api/v1/workflow-executions/:id
Get Detailed Execution
GET /api/v1/workflow-executions/:id/detail
Returns the execution with full node-level results, input/output data, and timing for each node.
json{ "data": { "id": "exec_xyz789", "workflow_id": "wf_abc123", "workflow_name": "Lead Processing", "status": "completed", "input": { "name": "John Doe", "email": "[email protected]" }, "output": { "lead_score": 85, "action_taken": "sent_to_crm" }, "node_executions": [ { "node_id": "node_1", "node_type": "trigger_form", "status": "completed", "started_at": "2025-12-07T10:30:00.000Z", "completed_at": "2025-12-07T10:30:00.050Z", "duration_ms": 50 }, { "node_id": "node_2", "node_type": "action_ai", "status": "completed", "input": { "prompt": "Analyze this lead..." }, "output": { "score": 85, "reasoning": "High-quality enterprise lead..." }, "started_at": "2025-12-07T10:30:00.050Z", "completed_at": "2025-12-07T10:30:02.500Z", "duration_ms": 2450, "tokens_used": 350 }, { "node_id": "node_3", "node_type": "condition", "status": "completed", "output": { "branch": "true" }, "duration_ms": 10 } ], "started_at": "2025-12-07T10:30:00Z", "completed_at": "2025-12-07T10:30:05Z", "duration_ms": 5000 } }
Get Node Results
GET /api/v1/workflow-executions/:id/nodes
Returns an array of all node execution results for the given execution.
Get Single Node Result
GET /api/v1/workflow-executions/:id/nodes/:nodeId
Returns the detailed result for a specific node within an execution.
Cancel Execution
POST /api/v1/workflow-executions/:id/cancel
json{ "data": { "id": "exec_xyz789", "status": "cancelled", "cancelled_at": "2025-12-07T10:31:00Z" } }
Retry Failed Execution
POST /api/v1/workflow-executions/:id/retry
Retries a failed execution from the point of failure. Creates a new execution record linked to the original.
json{ "data": { "execution_id": "exec_retry_001", "original_execution_id": "exec_xyz789", "status": "running", "retry_from_node": "node_4", "started_at": "2025-12-07T11:00:00Z" } }
Debug Sessions
Debug sessions allow you to step through a workflow execution node by node, inspect data, set breakpoints, and modify inputs in real time.
Start Debug Session
POST /api/v1/workflows/:id/debug/start
json{ "input": { "name": "Debug User", "email": "[email protected]" }, "breakpoints": ["node_3", "node_5"] }
Response:
json{ "data": { "execution_id": "exec_dbg_001", "status": "paused", "current_node": "node_1", "breakpoints": ["node_3", "node_5"] } }
Get Debug State
GET /api/v1/executions/:id/debug/state
Returns the current state of the debug session including the current node, variables, and node outputs so far.
Set Breakpoints
PUT /api/v1/executions/:id/debug/breakpoints
json{ "breakpoints": ["node_2", "node_4", "node_6"] }
Continue / Step Over / Resume / Skip
| Endpoint | Behavior |
|---|---|
POST /api/v1/executions/:id/debug/continue | Run until next breakpoint |
POST /api/v1/executions/:id/debug/step-over | Execute current node and pause at next |
POST /api/v1/executions/:id/debug/resume | Resume normal execution (ignore remaining breakpoints) |
POST /api/v1/executions/:id/debug/skip | Skip current node and move to next |
Modify Node Input
POST /api/v1/executions/:id/debug/modify-input
json{ "node_id": "node_2", "input": { "prompt": "Modified prompt for testing: {{input}}" } }
Abort Debug Session
POST /api/v1/executions/:id/debug/abort
Terminates the debug session and marks the execution as cancelled.
Templates
Create from Template
POST /api/v1/workflows/from-template/:templateId
json{ "name": "My Lead Processing", "variables": { "crm_url": "https://api.salesforce.com", "notification_email": "[email protected]" } }
List Templates
GET /api/v1/workflow-templates
json{ "data": [ { "id": "tmpl_001", "name": "Lead Scoring & Routing", "description": "Score inbound leads with AI and route to the right team", "category": "sales", "node_count": 6, "tags": ["ai", "crm", "lead-gen"] } ] }
List Template Categories
GET /api/v1/workflow-templates/categories
Get Template
GET /api/v1/workflow-templates/:id
Returns the full template definition including nodes, edges, and configurable variables.
Node Types
List All Node Types
GET /api/v1/workflow-node-types
json{ "data": [ { "type": "action_ai", "label": "AI Processing", "category": "actions", "description": "Process data using an AI agent or LLM", "icon": "brain", "config_schema": { "type": "object", "properties": { "agent_id": { "type": "string" }, "prompt": { "type": "string" }, "temperature": { "type": "number", "default": 0.7 }, "max_tokens": { "type": "integer", "default": 1000 } }, "required": ["prompt"] } } ] }
List Node Categories
GET /api/v1/workflow-node-types/categories
Node Types Grouped by Category
GET /api/v1/workflow-node-types/by-category
json{ "data": { "triggers": [ { "type": "trigger", "label": "Manual Trigger" }, { "type": "trigger_webhook", "label": "Webhook Trigger" }, { "type": "trigger_schedule", "label": "Schedule Trigger" }, { "type": "trigger_form", "label": "Form Submission" }, { "type": "trigger_data_table", "label": "Data Table Event" } ], "actions": [ { "type": "action_ai", "label": "AI Processing" }, { "type": "action_http", "label": "HTTP Request" }, { "type": "action_email", "label": "Send Email" }, { "type": "action_tool", "label": "Execute Tool" }, { "type": "action_code", "label": "Run Code" }, { "type": "action_delay", "label": "Delay" }, { "type": "action_data_source", "label": "Read Data" }, { "type": "action_data_write", "label": "Write Data" }, { "type": "action_data_lookup", "label": "Lookup Data" }, { "type": "action_notification", "label": "Send Notification" } ], "logic": [ { "type": "condition", "label": "Condition" }, { "type": "loop", "label": "Loop" }, { "type": "transform", "label": "Transform" }, { "type": "approval", "label": "Approval" } ], "control": [ { "type": "end", "label": "End" } ] } }
Node Configuration Examples
AI Node (action_ai)
json{ "id": "ai_node_1", "type": "action_ai", "data": { "label": "Analyze Input", "agent_id": "agent_abc123", "prompt": "Analyze the following data:\n\n{{input}}", "temperature": 0.7, "max_tokens": 1000 } }
HTTP Node (action_http)
json{ "id": "http_node_1", "type": "action_http", "data": { "label": "Call External API", "url": "https://api.example.com/data", "method": "POST", "headers": { "Authorization": "Bearer {{secrets.API_KEY}}" }, "body": { "data": "{{previous_node.output}}" }, "timeout_ms": 30000, "retry_on_error": true, "max_retries": 3 } }
Condition Node
json{ "id": "cond_1", "type": "condition", "data": { "label": "Check Value", "conditions": [ { "id": "c1", "expression": "{{input.score}} >= 80", "label": "High" }, { "id": "c2", "expression": "{{input.score}} >= 50", "label": "Medium" } ], "default_branch": "Low" } }
Loop Node
json{ "id": "loop_1", "type": "loop", "data": { "label": "Process Items", "items": "{{input.items}}", "item_variable": "current_item", "index_variable": "index", "max_iterations": 100 } }
Data Write Node (action_data_write)
json{ "id": "write_1", "type": "action_data_write", "data": { "label": "Save to Data Table", "table_id": "dt_abc123", "operation": "insert", "row_data": { "name": "{{input.name}}", "email": "{{input.email}}", "score": "{{node_2.output.score}}" } } }
Approval Node
json{ "id": "approval_1", "type": "approval", "data": { "label": "Manager Approval", "approvers": ["user_123", "user_456"], "approval_type": "any", "timeout_hours": 48, "message": "Please review:\n\n{{input.summary}}" } }
Template Expressions
Workflow nodes support template expressions using double curly braces:
Variable Access
{{input}} - Workflow input data
{{input.email}} - Nested property
{{node_1.output}} - Previous node output
{{node_1.output.data.id}} - Deep property access
{{secrets.API_KEY}} - Secret variables
{{env.NODE_ENV}} - Environment variables
Filters
{{input.name | uppercase}} - Convert to uppercase
{{input.name | lowercase}} - Convert to lowercase
{{input.items | length}} - Array length
{{input.data | json}} - JSON stringify
{{input.text | truncate:50}} - Truncate to 50 chars
{{input.date | date:'YYYY-MM-DD'}} - Format date
Defaults
{{input.value ?? 'default'}} - Default if null/undefined
{{input.name || 'Anonymous'}} - Fallback if falsy
Error Handling
All error responses follow a consistent format:
json{ "error": { "code": "workflow_validation_error", "message": "Workflow definition is invalid", "details": { "errors": [ { "node_id": "node_3", "message": "Condition expression is malformed" }, { "message": "Node 'node_7' has no incoming connections" } ] } } }
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | workflow_validation_error | Invalid workflow definition |
| 404 | workflow_not_found | Workflow does not exist |
| 409 | workflow_already_published | Cannot publish an already published workflow |
| 422 | execution_not_retriable | Execution is not in a failed state |
| 429 | rate_limit_exceeded | Too many execution requests |