---
title: "Build a workflow"
description: "Chain agents, conditions and transforms on a visual canvas and run them."
---

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

# Build a workflow

A workflow is a chain of steps that RAGNA Studio runs automatically. Each step is a card on a canvas. Steps are connected, and the output of one step becomes the input of the next. Use workflows to automate multi-step tasks with [agents](https://docs.ragna.io/agents), branching and text templates.

## Create a workflow

1. Open **Workflows** in the sidebar.
2. Click **New workflow**. A dialog opens over the list.
3. Enter a **Name**. Optionally describe **What should it do?**. The description shows under the name in the list.
4. Click **Create**. The editor opens and asks **How should this workflow start?**
5. Pick what starts the workflow. The trigger panel opens on the right. The trigger can be changed later (see [Triggers and schedules](https://docs.ragna.io/workflows/triggers)).

## The workflow list

The list has one row per workflow. The columns are:

| Column       | Shows                                                                                            |
| ------------ | ------------------------------------------------------------------------------------------------ |
| **Workflow** | The name and, under it, the description.                                                         |
| **Status**   | **Active** when a version is published, **Draft** when not.                                      |
| **Schedule** | What starts the published version, in words. A draft shows **Not scheduled**.                    |
| **Next run** | The next scheduled start. It shows **Paused** when the schedule is paused, and a dash otherwise. |
| **Agents**   | The agents of the published version. Up to three are shown, then the number of the others.       |

Click a row to open the detail panel on the right. It shows the status, the trigger, the next run, the steps and the recent runs. The steps list the main path without numbers. A condition shows its rule and two lines below it, **Yes** and **No**, each with the names of its steps. A long branch shows its first step and **+N steps**, a condition inside a branch shows **+1 condition**, and a branch without steps shows **Ends here**. A step that failed in the last run is named on its line. Long workflows stop after about eight rows with a link to the editor. A failed run in the recent runs names the step that failed, for the latest run. The row stays highlighted while its panel is open. Click another row to switch the panel. Click **Open editor** in the panel, or choose **Edit** in the row menu, to open the editor. The row menu also holds **Delete**.

A workflow with a schedule also shows when it runs (see [Triggers and schedules](https://docs.ragna.io/workflows/triggers)).

## Add steps

The canvas lays the steps out on its own, from top to bottom. Steps cannot be dragged, and connections cannot be drawn by hand. Pan and zoom work as usual. **Fit view** in the controls at the bottom left shows the whole workflow. A chip at the top left counts the steps and conditions, for example **2 steps · 1 condition**. The trigger is not counted.

Add a step with the **+** button:

- A **+** on a connection inserts the step there. The steps before and after it stay connected.
- A **+** at the end of a branch adds the step to the end of that branch.

The menu offers these steps:

| Step                  | What it does                                                                             |
| --------------------- | ---------------------------------------------------------------------------------------- |
| **Ask an agent**      | Runs an [agent](https://docs.ragna.io/agents) with an instruction. Pick a saved agent. An agent is required.  |
| **Agent team**        | A lead agent delegates work to specialist agents. See [Team node](https://docs.ragna.io/workflows/team-node). |
| **Check a condition** | Checks the result of the step before it and sends the flow down a Yes or a No branch.    |
| **Combine results**   | Puts earlier results together in one text.                                               |

Every workflow starts with its trigger, which is already on the canvas. It starts the workflow manually or on a schedule (see [Triggers and schedules](https://docs.ragna.io/workflows/triggers)).

The agent runs like it does in chat: with its own model, tools and settings. A workflow cannot be saved with an agent step that has no agent. A step in an older workflow without an agent fails the run with "Pick an agent for this node". Edit the step to fix it.

## Edit a step

Click a step to open its panel on the right. The canvas stays usable, and clicking another step switches the panel. Click the empty canvas, press **Esc** or use the close button to close it.

- The title is the step name. Click it to rename the step.
- The line under the title shows the position, for example **Step 2 · Agent**. The trigger is not counted.
- **Setup** holds the configuration of the step.
- **Last run** shows how the step ended in the latest run: its status, the start time, the output and, if it failed, the error.

An agent step has two fields: **Agent** and **Instruction**. Team steps keep a **Prompt** field.

Only one panel is open at a time. **Runs** and the gear in the top bar open in the same place and replace the step panel. The gear opens **Workflow settings**: the name, the description and, below them, when the workflow was created and last changed. The settings save on their own, a moment after typing stops and when the panel closes. The footer shows **Saving…**, **Saved** or **Not saved**. A workflow needs a name: with an empty name the field shows an error and nothing is saved until you enter one.

## Delete a workflow

Open **Workflow settings** and click **Delete workflow**, or choose **Delete** in the row menu of the list. A confirmation names the workflow. Click **Delete workflow** to confirm. The workflow and all of its runs are deleted. This cannot be undone. After deleting from the editor, the list opens.

## Remove a step

Open the step and click **Remove step** at the bottom of the panel. The trigger cannot be removed.

- A step in a chain is removed and its neighbours are connected again.
- A condition with steps on only one branch keeps that branch.
- A condition with steps on both branches keeps the Yes branch. A confirmation names the steps on the No branch that are removed with it. Click **Remove** to continue.
- A step that is also reached another way stays.

## Pass data between steps

Each step gets an input. This is the output of the previous step. The first step after the trigger gets the run input (see below). If several connections arrive, their outputs are joined with a blank line.

Write `{{input}}` in an instruction to insert that input. In the **Text** of a transform, press **Insert input** instead. An unknown placeholder becomes empty text.

- **Agent**: the **Instruction** can use `{{input}}`. The field is a formatted editor, and the text reaches the model exactly as written, so `{{input}}` and tags such as `<rules>` stay unchanged. Press the **Markdown** toggle to edit the stored markdown directly. The text is limited to 30,000 characters, and a counter in the bottom right corner of the field shows the length.
- **Transform**: the **Text** shows the input as a chip named after where it comes from: **Output of: First agent**, a list of steps when several feed this one, or **Run input** right after the trigger. Type around it, for example `Summary:` followed by the chip. The chip is stored as `{{input}}`.
- **Condition**: the **Check** always looks at the input. It shows the same chip.

The output of the last step is the output of the run. If the flow ends in several steps, the output lists each one.

## Branch with a condition

A condition step looks at the result of the step before it. The panel has these parts:

- **Check**: the input, shown as a chip such as **Output of: First agent**. It is read-only.
- **Condition**: how to judge the input. The choices are **is empty**, **is not empty**, **contains**, **equals** and **does not equal**.
- **Value**: the text to compare with. It appears for **contains**, **equals** and **does not equal**.
- **Then**: two read-only lines. **Yes** and **No** each say which step the flow continues with, or that the run ends.

The canvas shows two branches side by side: **Yes** on the left and **No** on the right. Add the steps for each branch with the **+** at its end. Only the matching branch runs. The other branch is skipped. A condition does not pass its own result on. The next step receives the content that came into the condition.

A workflow created earlier can check other text. The panel then shows that text instead of the chip, and keeps it unchanged.

## Save, publish and run

Edits are saved on their own, a moment after the last change, and when the browser window loses focus. There is no **Save** button. The pill at the top left of the canvas shows the status of the workflow: **Active** when a version is published, **Draft** when not. Next to the step count, one note shows the state of the draft:

- **Saving…** while the draft is being saved.
- **Not saved** with **Retry** when saving failed.
- **Not saved** when a step has a problem, or the workflow has one as a whole. The steps are not saved until the problem is fixed. Hover the note to read what needs attention, for example "1 step needs attention". Click it to open the first step with a problem, or to see the message when no step is at fault.
- **Unpublished changes** when the saved draft differs from the published version.
- **Saved** when the draft is saved and equals the published version.

On a narrow window the note shrinks to its icon. Leaving the editor with changes that are not saved asks for confirmation first.

Runs always use the published version. Click **Publish** to make the draft the live version. Publishing saves the draft first.

1. Click **Run** in the editor.
2. Optionally enter an **Input**. It becomes the input of the first step.
3. Click **Run**.

When the draft has unpublished changes, the dialog warns that a run uses the last published version, not the latest changes. Then **Run published version** starts a run with the published version, and **Publish and run** saves and publishes the draft first. If the workflow was never published, only **Publish and run** is offered. The run opens in a new view. See [Runs and traces](https://docs.ragna.io/workflows/runs).

## Why can't I publish?

**Publish** and **Publish and run** check the workflow first. A step with a problem is marked on the canvas, and its panel opens with the reason next to the field. A message names the number of steps that need attention. While a step has a problem, the steps are not saved. The workflow settings still save.

Common causes:

- An **Agent** step has no agent picked.
- A **Team** step has no lead agent, or a member has no agent.
- A picked agent was deleted.
- The workflow was created before agents became required.

To fix it, click the marked step and pick an agent in the panel. The draft is saved again on its own.

Publishing also needs exactly one trigger and no loops. A message explains which rule is broken.

> **Note**
>
> Workflows that call agents use the configured AI models. On a self-hosted install the model
> providers need API keys. See [Optional providers](https://docs.ragna.io/self-hosting/optional-providers).

Source: https://docs.ragna.io/workflows/index.mdx
