> ## Documentation Index
> Fetch the complete documentation index at: https://docs.danubeai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Workflow

> Update an existing workflow

## Overview

Updates a workflow's name, description, steps, visibility, or tags. Only the workflow owner can update it.

**Auth:** Accepts either JWT or API key (`danube-api-key` header).

## Path Parameters

<ParamField path="workflow_id" type="string" required>
  The UUID of the workflow to update
</ParamField>

## Body Parameters

<ParamField body="name" type="string">
  New workflow name (max 128 characters)
</ParamField>

<ParamField body="description" type="string">
  New workflow description
</ParamField>

<ParamField body="steps" type="array">
  Updated list of workflow steps

  <Expandable title="Step object">
    <ParamField body="step_number" type="integer" required>
      Step position (1-based)
    </ParamField>

    <ParamField body="tool_id" type="string" required>
      Tool UUID to execute
    </ParamField>

    <ParamField body="tool_name" type="string" required>
      Tool display name
    </ParamField>

    <ParamField body="description" type="string" required>
      What this step does
    </ParamField>

    <ParamField body="input_mapping" type="object" required>
      Parameter mapping with template variables
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="visibility" type="string">
  `"private"` or `"public"`
</ParamField>

<ParamField body="tags" type="array">
  Updated tags for discovery
</ParamField>

## Response

<ResponseField name="id" type="string">
  Workflow UUID
</ResponseField>

<ResponseField name="name" type="string">
  Updated workflow name
</ResponseField>

<ResponseField name="description" type="string">
  Updated workflow description
</ResponseField>

<ResponseField name="steps" type="array">
  Updated workflow steps
</ResponseField>

<ResponseField name="visibility" type="string">
  `"private"` or `"public"`
</ResponseField>

<ResponseField name="tags" type="array">
  Updated workflow tags
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 update timestamp
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.danubeai.com/v1/workflows/wf_abc123" \
    -H "danube-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Updated Pipeline Name",
      "description": "Updated description",
      "tags": ["weather", "alerts", "v2"]
    }'
  ```

  ```python Python SDK theme={null}
  from danube import DanubeClient

  with DanubeClient(api_key="dk_...") as client:
      workflow = client.workflows.update(
          workflow_id="wf_abc123",
          name="Updated Pipeline Name",
          description="Updated description",
          tags=["weather", "alerts", "v2"],
      )
      print(f"Updated: {workflow.name}")
  ```

  ```typescript TypeScript SDK theme={null}
  import { DanubeClient } from 'danube';

  const client = new DanubeClient({ apiKey: 'dk_...' });
  const workflow = await client.workflows.update('wf_abc123', {
    name: 'Updated Pipeline Name',
    description: 'Updated description',
    tags: ['weather', 'alerts', 'v2'],
  });
  console.log(`Updated: ${workflow.name}`);
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "wf_abc123",
    "name": "Updated Pipeline Name",
    "description": "Updated description",
    "steps": [
      {
        "step_number": 1,
        "tool_id": "tool_weather_001",
        "tool_name": "Weather - Get Forecast",
        "description": "Fetch the weather forecast",
        "input_mapping": {"city": "{{inputs.city}}"}
      }
    ],
    "owner_id": "user_456",
    "visibility": "private",
    "tags": ["weather", "alerts", "v2"],
    "updated_at": "2026-02-24T14:00:00Z"
  }
  ```
</ResponseExample>

## MCP Tool

This endpoint is also available as the `update_workflow` MCP tool:

```python theme={null}
result = await mcp.call_tool("update_workflow", {
    "workflow_id": "wf_abc123",
    "name": "Updated Pipeline Name",
    "tags": ["weather", "alerts", "v2"]
})
```
