Skip to main content
POST
/
v1
/
workflows
curl -X POST "https://api.danubeai.com/v1/workflows" \
  -H "danube-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weather Alert Pipeline",
    "description": "Get weather forecast and send Slack notification",
    "steps": [
      {
        "step_number": 1,
        "tool_id": "tool_weather_001",
        "tool_name": "Weather - Get Forecast",
        "description": "Fetch the weather forecast",
        "input_mapping": {"city": "{{inputs.city}}"}
      },
      {
        "step_number": 2,
        "tool_id": "tool_slack_001",
        "tool_name": "Slack - Send Message",
        "description": "Post forecast to Slack",
        "input_mapping": {
          "channel": "{{inputs.channel}}",
          "text": "Forecast: {{steps.1.result.forecast}}"
        }
      }
    ],
    "visibility": "private",
    "tags": ["weather", "notifications"]
  }'
{
  "id": "wf_abc123",
  "name": "Weather Alert Pipeline",
  "description": "Get weather forecast and send Slack notification",
  "steps": [
    {
      "step_number": 1,
      "tool_id": "tool_weather_001",
      "tool_name": "Weather - Get Forecast",
      "description": "Fetch the weather forecast",
      "input_mapping": {"city": "{{inputs.city}}"}
    },
    {
      "step_number": 2,
      "tool_id": "tool_slack_001",
      "tool_name": "Slack - Send Message",
      "description": "Post forecast to Slack",
      "input_mapping": {
        "channel": "{{inputs.channel}}",
        "text": "Forecast: {{steps.1.result.forecast}}"
      }
    }
  ],
  "owner_id": "user_456",
  "visibility": "private",
  "tags": ["weather", "notifications"],
  "created_at": "2026-02-21T12:00:00Z",
  "updated_at": "2026-02-21T12:00:00Z"
}

Overview

Creates a new workflow that chains multiple Danube tools into an ordered pipeline. Each step executes a tool and can reference results from previous steps using template syntax ({{steps.N.result.field}}, {{inputs.field}}). Auth: Accepts either JWT or API key (danube-api-key header).

Body Parameters

name
string
required
Workflow name (max 128 characters)
description
string
default:""
Workflow description
steps
array
required
Ordered list of workflow steps
visibility
string
default:"private"
"private" or "public"
tags
array
default:[]
Tags for discovery

Response

id
string
Created workflow UUID
name
string
Workflow name
description
string
Workflow description
steps
array
The workflow steps as provided
owner_id
string
Owner user ID
visibility
string
"private" or "public"
tags
array
Workflow tags
created_at
string
ISO 8601 creation timestamp

Example

curl -X POST "https://api.danubeai.com/v1/workflows" \
  -H "danube-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weather Alert Pipeline",
    "description": "Get weather forecast and send Slack notification",
    "steps": [
      {
        "step_number": 1,
        "tool_id": "tool_weather_001",
        "tool_name": "Weather - Get Forecast",
        "description": "Fetch the weather forecast",
        "input_mapping": {"city": "{{inputs.city}}"}
      },
      {
        "step_number": 2,
        "tool_id": "tool_slack_001",
        "tool_name": "Slack - Send Message",
        "description": "Post forecast to Slack",
        "input_mapping": {
          "channel": "{{inputs.channel}}",
          "text": "Forecast: {{steps.1.result.forecast}}"
        }
      }
    ],
    "visibility": "private",
    "tags": ["weather", "notifications"]
  }'
{
  "id": "wf_abc123",
  "name": "Weather Alert Pipeline",
  "description": "Get weather forecast and send Slack notification",
  "steps": [
    {
      "step_number": 1,
      "tool_id": "tool_weather_001",
      "tool_name": "Weather - Get Forecast",
      "description": "Fetch the weather forecast",
      "input_mapping": {"city": "{{inputs.city}}"}
    },
    {
      "step_number": 2,
      "tool_id": "tool_slack_001",
      "tool_name": "Slack - Send Message",
      "description": "Post forecast to Slack",
      "input_mapping": {
        "channel": "{{inputs.channel}}",
        "text": "Forecast: {{steps.1.result.forecast}}"
      }
    }
  ],
  "owner_id": "user_456",
  "visibility": "private",
  "tags": ["weather", "notifications"],
  "created_at": "2026-02-21T12:00:00Z",
  "updated_at": "2026-02-21T12:00:00Z"
}

MCP Tool

This endpoint is also available as the create_workflow MCP tool:
result = await mcp.call_tool("create_workflow", {
    "name": "Weather Alert Pipeline",
    "steps": [
        {
            "step_number": 1,
            "tool_id": "tool_weather_001",
            "tool_name": "Weather - Get Forecast",
            "description": "Fetch the weather forecast",
            "input_mapping": {"city": "{{inputs.city}}"}
        }
    ],
    "visibility": "private"
})