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

# How a Workflow works

> What a Workflow is, how its page is organized and how it goes from Draft to App or API

A **Workflow** chains steps into one automated process that always runs the same way: read a document, decide something about it, produce a result. Each step is a **module** you pick from a menu and configure in the editor, without code unless you want it. This section explains every module, how steps pass values to each other, and how you run, debug, test and publish the result.

If you have never opened a Workflow, start with [Your first Workflow](https://docs.tela.com/en/creating-your-first-workflow.md). This section goes deeper.

## The running example

Every page in this section uses the same process, a **contract routing** Workflow:

1. **Extract Data** (AI Module) reads a contract and returns the counterparty, the total value, the dates and a short summary.
2. **Route by value** (Condition) checks the total value.
3. If the value is above 100,000, **Draft Escalation Note** (AI Module) writes a note for the legal team. Otherwise, **Approval Letter** (Document Templater) fills a `.docx` template and generates the letter.

A second variant splits a long contract into pages and extracts each one with a **Map**, then merges the pieces with a **Code Execution** step.

![The finished contract-routing Workflow in Craft, showing Extract Data, Route by value and the two branches](https://mintcdn.com/meistrari/M2w7BduKZAFA1Sbx/images/workflow/overview-graph.png?fit=max\&auto=format\&n=M2w7BduKZAFA1Sbx\&q=85\&s=9edfb0f093084fdad07c3000dae97225)

## Workflow, Canvas or Agent?

| Your task | Use |
| - | - |
| One instruction does the job: extract fields, classify a message, summarize a report | **Canvas** |
| Several steps you can draw in advance, with decisions, loops over documents or generated files | **Workflow** |
| Steps you cannot define in advance, external services, a back-and-forth conversation | **Agent** |

A Workflow can reuse an existing Canvas or Agent as one of its steps, so you can start with a Canvas and grow it into a Workflow later. See [Key concepts](https://docs.tela.com/en/key-concepts.md#canvas-workflow-or-agent) for the full comparison.

## Anatomy of the Workflow page

The Workflow page has four experiences at the top: **Craft**, **Debug**, **Test** and **Usage**.

![Workflow header with the experience selector, version button, Share and Publish](https://mintcdn.com/meistrari/M2w7BduKZAFA1Sbx/images/workflow/header.png?fit=max\&auto=format\&n=M2w7BduKZAFA1Sbx\&q=85\&s=db3566719e01192e3d6faac931f891f7)

In **Craft**:

* **Left side: the steps.** A new Workflow opens with the module picker. Each step is a card; hover the connector below a card and click **+** to add the next one. Clicking a step opens its configuration. A Condition opens branches side by side, and a Map shows the steps that run inside it.
* **Right side: Inputs and Run.** The **Inputs** section is where you declare what the Workflow receives (**Add Variable**) and where you fill in values before a run. Below it, **Run** starts the Workflow, and the result of each step appears in the same pane when the run finishes, in the **Preview** and **Debug** tabs.

![Craft experience with the module picker open on the left and the Inputs panel on the right](https://mintcdn.com/meistrari/M2w7BduKZAFA1Sbx/images/workflow/overview-picker.png?fit=max\&auto=format\&n=M2w7BduKZAFA1Sbx\&q=85\&s=1c2812d3a843be033aca1aa6ca2b90a4)

The header also holds the title, the version button (for example `VER-3`), **Share**, **Publish** and the `…` menu with **Move to project**, **Connect via API**, **Execution**, tags, credentials, rename, export and delete.

The other experiences:

* **Debug** lists every run of the Workflow, whatever started it (Craft, a Test case, a Workstation App, the API or a schedule), and lets you inspect each step of a run.
* **Test** keeps your Test Cases and their results, like a Canvas.
* **Usage** shows the executions of the published Workflow, when enabled for your Workspace.

> [!NOTE]
>
> **Test** is hidden when file storage is disabled for your Workspace, and **Usage** requires monitoring to be enabled. If you do not see them, contact your Tela team.

## The modules

The module picker groups modules in tabs: **Everything**, **Modules**, **Resources**, **Templates** and **Actions**.

![Module picker with the Modules and Resources groups visible](https://mintcdn.com/meistrari/M2w7BduKZAFA1Sbx/images/workflow/module-picker.png?fit=max\&auto=format\&n=M2w7BduKZAFA1Sbx\&q=85\&s=1370c88e07b9197ff05674c5ab0bb061)

| Group | Module | What it does | Page |
| - | - | - | - |
| Modules | **AI Module** | Writes a prompt, picks a model and structures the output, like a Canvas | [AI Module and Classifier](https://docs.tela.com/en/workflow/ai-module-and-classifier.md) |
| Modules | **Classifier** | Answers typed questions (choice, score, yes/no) about the data with probabilities | [AI Module and Classifier](https://docs.tela.com/en/workflow/ai-module-and-classifier.md) |
| Modules | **Existing Agent** | Runs a published Agent of your Workspace | [Reusing Canvases, Agents and templates](https://docs.tela.com/en/workflow/reusing-canvases-agents-and-templates.md) |
| Modules | **Existing Canvas** | Runs a published Canvas (or another Workflow) | [Reusing Canvases, Agents and templates](https://docs.tela.com/en/workflow/reusing-canvases-agents-and-templates.md) |
| Modules | **Code Execution** | Runs JavaScript or TypeScript on the data between steps | [Code Execution](https://docs.tela.com/en/workflow/code-execution.md) |
| Modules | **Condition** | Sends the run down one of several branches | [Conditions and branches](https://docs.tela.com/en/workflow/conditions-and-branches.md) |
| Resources | **Split** | Breaks a PDF or CSV into pages, chunks or logical documents | [Split, Crop and Map](https://docs.tela.com/en/workflow/documents-split-crop-map.md) |
| Resources | **Crop** | Keeps only some pages of a PDF | [Split, Crop and Map](https://docs.tela.com/en/workflow/documents-split-crop-map.md) |
| Resources | **Document Templater** | Generates a document from a `.docx` template; shows in the graph as **Generate Document** | [Reusing Canvases, Agents and templates](https://docs.tela.com/en/workflow/reusing-canvases-agents-and-templates.md) |
| Resources | **Map** | Repeats a group of steps for each item of a list | [Split, Crop and Map](https://docs.tela.com/en/workflow/documents-split-crop-map.md) |
| Actions | **Stop** | Ends the Workflow at that point of a branch | [Conditions and branches](https://docs.tela.com/en/workflow/conditions-and-branches.md) |
| Actions | **Connect** | Joins a branch to a step on another branch | [Conditions and branches](https://docs.tela.com/en/workflow/conditions-and-branches.md) |

The **Templates** tab inserts a ready-made Workflow template into your graph.

> [!NOTE]
>
> The picker shows a fixed list of modules. What differs between Workspaces is whether the Workflow feature itself is enabled.

## How a run flows

1. You fill in the **Inputs** and click **Run**.
2. Steps run in order. Each step receives the values it references: Inputs and the outputs of the steps before it. See [Inputs and references](https://docs.tela.com/en/workflow/inputs-and-references.md).
3. A **Condition** picks one branch; steps on the other branches are reported as **Skipped**.
4. A **Map** runs its inner steps once per item, in parallel, and returns the list of results.
5. The run ends at the last step of the path it took. That step's output is the result of the run, and every step's output stays available in the result pane, in **Debug** and through the API. See [Outputs and results](https://docs.tela.com/en/workflow/outputs-and-results.md).

By default steps run one after another. Under `…` → **Execution**, **Parallel execution** lets independent steps run at the same time; steps that depend on each other's data still run in order.

## Lifecycle: Draft, Project, publish, App and API

```
Draft (private)  →  Move to project  →  Publish a version to an environment  →  App / API / schedule
```

* A Workflow created from the Dashboard starts as a **Draft**, visible only to you. You can build, run and test it fully as a Draft.
* **Move to project** (from the `…` menu, or automatically asked when you click **Publish**) makes it visible to your team. This cannot be undone.
* **Publish** creates a stable version and places it in an environment (**Production** by default). Apps, API calls and schedules use the published version, so you can keep editing without affecting them.
* In the publish dialog, **Deploy App** creates a [Workstation App](https://docs.tela.com/en/workstation/creating-apps.md) where your team sends documents and reviews results. **Connect via API** gives you the ID and a snippet to run the Workflow from your systems.

See [Running, testing and publishing](https://docs.tela.com/en/workflow/running-testing-and-publishing.md) for each of these steps.

## In this section

> **[Inputs and references](https://docs.tela.com/en/workflow/inputs-and-references.md)**
>
> Declare what the Workflow receives and pass values between steps with the `@` menu

> **[AI Module and Classifier](https://docs.tela.com/en/workflow/ai-module-and-classifier.md)**
>
> Prompt, model and Output Format per step; typed judgments with the Classifier

> **[Conditions and branches](https://docs.tela.com/en/workflow/conditions-and-branches.md)**
>
> Route the run with cases, Else, Stop and Connect

> **[Split, Crop and Map](https://docs.tela.com/en/workflow/documents-split-crop-map.md)**
>
> Work page by page or document by document

> **[Code Execution](https://docs.tela.com/en/workflow/code-execution.md)**
>
> Transform data with a small function, with credentials and libraries

> **[Reusing Canvases, Agents and templates](https://docs.tela.com/en/workflow/reusing-canvases-agents-and-templates.md)**
>
> Existing Canvas, Existing Agent and Document Templater

> **[Outputs and results](https://docs.tela.com/en/workflow/outputs-and-results.md)**
>
> What a run returns and where to read it: result pane, Debug, App, API, Test

> **[Running, testing and publishing](https://docs.tela.com/en/workflow/running-testing-and-publishing.md)**
>
> Run, run one step, Debug, Test Cases, Publish, Deploy App, API and schedules


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