Workflows API
API endpoints for managing workflows and executions.
List Workflows
GET /api/workflows?orgId=org_123
Get Workflow
GET /api/workflows/[workflowId]
Create Workflow
POST /api/workflows
Content-Type: application/json
{
"name": "My Workflow",
"canvas": {
"nodes": [...],
"edges": [...]
},
"orgId": "org_123"
}
Update Workflow
PATCH /api/workflows/[workflowId]
Content-Type: application/json
{
"name": "Updated Name",
"canvas": {...}
}
Delete Workflow
DELETE /api/workflows/[workflowId]
Execute Workflow
POST /api/workflows/[workflowId]/execute
Content-Type: application/json
{
"input": {
"data": {...}
}
}
Get Workflow Executions
GET /api/workflows/[workflowId]/executions?page=1&limit=50
Get Execution Details
GET /api/executions/[executionId]
Response:
{
"executionId": "exec_123",
"status": "completed",
"startedAt": "2024-01-15T10:00:00Z",
"completedAt": "2024-01-15T10:00:02Z",
"currentNodeId": null,
"completedNodes": ["node_1", "node_2"],
"context": {
"nodeOutputs": {...}
}
}