Workflows API

CRUD operations, execution, and run history for workflows.

List workflows

GET /api/v1/workflows

Response: [
  { "id": "uuid", "name": "My Workflow", "created_at": "...", "node_count": 5 }
]

Create a workflow

POST /api/v1/workflows
{
  "name": "Social Media Pipeline",
  "graph_json": {
    "nodes": [ ... ],
    "edges": [ ... ],
    "viewport": { "x": 0, "y": 0, "zoom": 1 }
  }
}

Execute a workflow

POST /api/v1/workflows/:id/execute

Response: {
  "run_id": "uuid",
  "status": "running",
  "estimated_credits": 12
}

After starting execution, poll the run status or listen to WebSocket events for real-time updates.

Check run status

GET /api/v1/workflows/:id/runs/:run_id

Response: {
  "id": "uuid",
  "status": "completed",    // running | completed | failed
  "credits_used": 11,
  "duration_ms": 4520,
  "node_runs": [
    { "node_id": "...", "status": "completed", "artifact_id": "..." }
  ]
}

Download artifact

GET /api/v1/artifacts/:id

Response: binary file (image/png, video/mp4, audio/mpeg, text/plain)

Error responses

CodeMeaning
400Invalid graph or missing required fields
401Missing or invalid API key
402Insufficient credits
404Workflow or run not found
429Rate limit exceeded

Last updated: 2026-03-27

    Workflows API | Zephly