Skip to main content
POST
/
v1
/
workflows
/
{workflow_id}
/
execute
curl -X POST "https://api.danubeai.com/v1/workflows/wf_abc123/execute" \
  -H "danube-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {
      "city": "San Francisco",
      "channel": "#weather-alerts"
    }
  }'
{
  "id": "exec_xyz789",
  "workflow_id": "wf_abc123",
  "user_id": "user_456",
  "status": "success",
  "inputs": {
    "city": "San Francisco",
    "channel": "#weather-alerts"
  },
  "step_results": [
    {
      "step_number": 1,
      "tool_id": "tool_weather_001",
      "tool_name": "Weather - Get Forecast",
      "status": "success",
      "result": {
        "forecast": "Partly cloudy, 18C, 10% chance of rain"
      },
      "error": null,
      "execution_time_ms": 340
    },
    {
      "step_number": 2,
      "tool_id": "tool_slack_001",
      "tool_name": "Slack - Send Message",
      "status": "success",
      "result": {
        "message_ts": "1708100000.000100"
      },
      "error": null,
      "execution_time_ms": 210
    }
  ],
  "error": null,
  "execution_time_ms": 550,
  "started_at": "2026-02-16T12:00:00Z",
  "completed_at": "2026-02-16T12:00:01Z",
  "created_at": "2026-02-16T12:00:00Z"
}

Overview

Executes a workflow by running each step sequentially. Each step calls a Danube tool and template variables are resolved with results from previous steps. Returns the full execution result including all step outcomes. Auth: Accepts either JWT or API key (danube-api-key header). Public workflows can be executed by any authenticated user; private workflows require ownership.

Path Parameters

workflow_id
string
required
The workflow UUID to execute

Body Parameters

inputs
object
Input values referenced by {{inputs.field}} templates in the workflow steps

Response

id
string
Execution ID (use to poll status or retrieve results later)
workflow_id
string
The workflow that was executed
status
string
Execution status: pending, running, success, or failed
inputs
object
The inputs that were provided
step_results
array
Results from each step
error
string
Overall error message if the workflow failed
execution_time_ms
integer
Total execution time in milliseconds
started_at
string
ISO 8601 timestamp when execution began
completed_at
string
ISO 8601 timestamp when execution finished

Example

curl -X POST "https://api.danubeai.com/v1/workflows/wf_abc123/execute" \
  -H "danube-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {
      "city": "San Francisco",
      "channel": "#weather-alerts"
    }
  }'
{
  "id": "exec_xyz789",
  "workflow_id": "wf_abc123",
  "user_id": "user_456",
  "status": "success",
  "inputs": {
    "city": "San Francisco",
    "channel": "#weather-alerts"
  },
  "step_results": [
    {
      "step_number": 1,
      "tool_id": "tool_weather_001",
      "tool_name": "Weather - Get Forecast",
      "status": "success",
      "result": {
        "forecast": "Partly cloudy, 18C, 10% chance of rain"
      },
      "error": null,
      "execution_time_ms": 340
    },
    {
      "step_number": 2,
      "tool_id": "tool_slack_001",
      "tool_name": "Slack - Send Message",
      "status": "success",
      "result": {
        "message_ts": "1708100000.000100"
      },
      "error": null,
      "execution_time_ms": 210
    }
  ],
  "error": null,
  "execution_time_ms": 550,
  "started_at": "2026-02-16T12:00:00Z",
  "completed_at": "2026-02-16T12:00:01Z",
  "created_at": "2026-02-16T12:00:00Z"
}

MCP Tool

This endpoint is also available as the execute_workflow MCP tool:
result = await mcp.call_tool("execute_workflow", {
    "workflow_id": "wf_abc123",
    "inputs": {"city": "San Francisco"}
})