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

# Creating Workflows

> Build visual workflows for your agents

This guide walks you through creating workflows using the visual workflow builder.

## Creating a New Workflow

**1. Navigate to Workflows**

Go to **Build → Workflows** in your dashboard.

**2. Click Create Workflow**

Click **Create Workflow** to open the builder.

**3. Name Your Workflow**

Give it a descriptive name:

* Good: "Refund Request Handler", "Order Status Lookup"
* Avoid: "Workflow 1", "New Workflow"

**4. Build Your Workflow**

Use the visual builder to add and connect nodes.

**5. Save and Publish**

Save your workflow and publish when ready.

## Using the Workflow Builder

### The Canvas

The main area where you build your workflow:

* **Drag** nodes to position them
* **Click** nodes to select and configure
* **Drag from outputs** to create connections

### Node Palette

The builder starts each workflow with a **Start** node. From there, add:

* **Tool** — Execute tools, agents, runbooks, or other workflows
* **Decision** — Branch based on conditions

### Properties Panel

Configure the selected node:

## Adding Nodes

### Tool Nodes

Execute a tool or operation:

**1. Add Tool Node**

Add a **Tool** node to the canvas.

**2. Select Tool**

Choose the Duckie tool, app tool, custom tool, MCP tool, agent, runbook, or workflow to execute.

**3. Configure Inputs**

Map manual values, ticket data, saved values, previous node outputs, or AI-generated values to the tool's inputs.

**4. Name Outputs**

Define output variable names for use in later nodes.

### Decision Nodes

Branch based on rule or AI conditions:

**1. Add Decision Node**

Drag a **Decision** node to the canvas.

**2. Define Condition**

Add a branch and choose a **Rule** condition or an **AI** condition.

**3. Connect Outputs**

Connect each branch output to the right next node. Use the **Else** output for the fallback path.

### AI Decision Branches

Use an AI branch when a simple field comparison is not enough:

**1. Open a Decision Node**

Select a **Decision** node.

**2. Add AI Branch**

Click **AI** to add an AI condition branch.

**3. Write the Prompt**

Describe what the AI should evaluate (e.g., "Is the customer satisfied with the resolution?").

**4. Choose Inputs**

Select the message, ticket fields, saved values, or previous node outputs the AI should evaluate.

### Generate Values With AI

When configuring tool inputs, use **Generate with AI** to create a value from context.

For example, a tool input can ask the AI to extract an order number from the latest message or summarize the conversation before calling another tool.

### Send Responses

Use a **Tool** node with the **Responder** tool when a workflow should send a customer-facing response.

**1. Add Tool Node**

Add a **Tool** node to the canvas.

**2. Select Responder**

Choose the **Responder** Duckie tool.

**3. Write Response**

Provide a static response or let AI generate the response from the mapped context.

### Call an Agent

Use a **Tool** node with an Agent action when a workflow should delegate part of the run to another agent.

**1. Add Tool Node**

Add a **Tool** node to the canvas.

**2. Select Agent**

Open the tool selector, choose **Agents**, and select an active agent.

**3. Configure Inputs**

Add **Instructions**, decide whether to include **Conversation history**, and add **Additional context** when the child agent needs extra workflow data.

**4. Use the Output**

Reference the Agent action output in later nodes when you need the child run status or resolution summary.

[Learn more about sub-agents ->](https://docs.duckie.ai/agents/sub-agents.md)

## Connecting Nodes

### Creating Connections

1. Click and drag from a node's output port
2. Drop on another node's input port
3. The connection is created

### Connection Rules

* Every node (except Start) needs at least one input connection
* Decision nodes have one output for each branch plus **Else**
* Tool nodes have Success and Failure outputs

## Configuring Inputs

### Variable Mapping

Map data between nodes using the properties panel:

**Available sources:**

| Source | Description |
| - | - |
| **Manual Value** | A fixed value you enter |
| **Ticket Data** | Fields from the conversation or source ticket |
| **Previous Node** | Output from an earlier node |
| **Saved Value** | A value saved earlier in the workflow |
| **Generate with AI** | A value generated from selected context |
| **Multiple Items** | A list of input values |

### Workflow Inputs

Use workflow inputs when a workflow should accept values from another workflow, a runbook, or an autonomous agent.

In the builder, open **Workflow Inputs** at the top-left of the canvas. Add each input with a name, type, and whether it is required. Node input pickers then show those values under **Workflow Inputs**, so you can reference them in tool inputs, decision rules, or AI-generated values.

When testing in the builder, the test panel shows fields for the workflow's declared inputs. Required inputs must be provided before the workflow can run. When one workflow calls another workflow, the child workflow's inputs appear as parameters on the workflow action. Autonomous agents can also pass declared inputs when they call an available workflow.

## Testing Workflows

### In the Builder

1. Click **Test** in the builder
2. Enter test inputs
3. Run the workflow
4. See which path was taken and outputs at each step

### In Playground

1. Assign the workflow to an agent
2. Test in **Test → Playground**
3. Conversation-level testing with full context

## Publishing Workflows

Workflows start as drafts. To make available to agents:

1. Click **Publish** in the builder
2. Confirm the publication
3. Workflow is now available for agent assignment

> [!NOTE]
>
> You can continue editing a published workflow. Changes create a new draft that must be published to take effect.

## Best Practices

### Design

* **Start simple** — Build the happy path first, then add branches
* **Name clearly** — Use descriptive names for nodes and variables
* **Group logically** — Organize related nodes spatially

### Testing

* **Test each branch** — Ensure all paths work correctly
* **Test edge cases** — What happens with missing data?
* **Test failures** — How does the workflow handle errors?

### Maintenance

* **Document decisions** — Add notes explaining complex logic
* **Version carefully** — Test changes before publishing
* **Monitor execution** — Check run history for issues

## Next Steps

> [card] [Nodes & Conditions](https://docs.duckie.ai/workflows/nodes-and-conditions.md)
>
> Detailed node reference

> [card] [Test Your Workflow](https://docs.duckie.ai/testing/playground.md)
>
> Validate in the playground


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.