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

# End

> Closes a workflow route with a declared output so the workflow that called it can continue from there

The **End** node closes a route in the workflow and ties it to an **output** you declare. When another workflow calls this one with the [Workflow](https://docs.jelou.ai/en/guides/nodos/workflow.md) node, that output becomes a connectable route in the parent workflow: the parent knows how the child ended and continues down the matching branch.

> [!NOTE]
>
> A workflow does not need End nodes to work. If you declare no outputs, the workflow ends as it always did and the Workflow node that calls it keeps behaving as a plain jump.

## What an output is

An output is the workflow's termination contract. Each output has:

| Field | What it is for |
| - | - |
| **Name** | The text shown on the End node and on the parent's Workflow node (up to 60 characters). |
| **Variable** | The output's technical identifier (for example, `payment_approved`). It is the key you use in `$output.set("payment_approved", ...)` to write its value. |
| **Output type** | **Success**, **Error** or **Neutral**. Sets the color of the route and the node. |
| **Description** | Explains when this output is taken (up to 255 characters). |
| **Data it returns** | The variables the workflow returns to the parent through this output. |

### Output types

> [card] Success
>
> The workflow ends as successful.

> [card] Error
>
> The workflow ends as failed, in a controlled failure.

> [card] Neutral
>
> The workflow ends without being marked as successful or failed.

## Create an output

You can create an output from the **Output manager** or directly from an End node's panel. You need write permission on the canvas.

**1. Open the form**

From the End node, open the **Output** selector and click **Create output**. If the workflow has no outputs yet, the panel shows the message "This workflow has no outputs yet" with the same button.

You can also open the **Output manager** from the top bar menu of the canvas and click **Create output**.

**2. Fill in the general data**

Write the **Name** and the **Variable**, pick the **Output type** (**Success**, **Error** or **Neutral**) and add the **Description**. The variable is suggested automatically from the name until you edit it.

**3. Define the data it returns**

Under **Data it returns** you have two modes:

* **Fields:** add one row per value with **Add variable**. The variable is the path the parent will read (for example, `order.total`) and the name is its visible label (for example, "Order total").
* **JSON:** paste a sample JSON and each key becomes a field. The sample values are not stored.

**4. Save**

The output becomes available to every End node in the workflow and shows up right away on the Workflow nodes that reference it. If you created it from an End node, it is assigned to that node automatically.

> [!NOTE]
>
> The variable must be unique in the workflow and cannot contain spaces or dots. The schema also needs at least one value, and every value must have a path and a name.

## Use the End node on the canvas

**1. Drag the node**

In the node panel, open the **End** group and drag the node onto the canvas.

**2. Pick the output**

Click the node to open its panel and select an output under **Output**. The list groups outputs by type (**Success**, **Error** and **Neutral**) and lets you search by name. The node takes the color of that output's type and shows its name and how many values it returns. While no output is selected, it shows as **End**.

**3. Connect the route**

Connect every branch that should finish with that output to the End node. Several End nodes can point to the same output.

The End node also includes **Data Loss Prevention (DLP)** settings to mask sensitive information in the logs it generates.

### Output details in the panel

When you select an output, the panel shows its card with:

* **Name and type**, with the **Edit output** button to change it without leaving the node.
* The output's **Description**.
* The **Variable**, with a button to copy it.
* **Value**, which tells you which node writes the output's value (see below).
* **Data it returns**, with the number of values and a switch to view them as **JSON** or as a **List**. Below it, you see how they are read in the calling workflow.
* **Usage**, which tells you whether the output is used only in this node or in several End nodes.

If the output is used in more than one End node, you can go through them with the navigation arrows ("End node 1 of 3"): the canvas moves to each node and highlights it for a few seconds.

### Write the output value

The data an output returns is written with `$output.set` from a Code, API or SOAP node:

```javascript title="Code node" theme={null}
$output.set("payment_approved", { total: 150, currency: "USD" });
```

The **Value** section of the panel analyzes the paths that reach the End node and tells you which node writes the output:

| Situation | What it shows |
| - | - |
| One node writes the output | A button with the node name. Click it and the canvas centers on that node. |
| Nodes on different branches | One button per alternative. |
| Several nodes on the same path | A numbered list with the last node marked as **Last**. Each row says whether it completes one path and keeps the rest, or replaces the whole value. |
| No node writes it | An `$output.set` example ready to copy. |
| The key is built at runtime | The "Can't be verified" notice, because the name is dynamic. |
| The End node is not connected | A notice to connect it so you can see which node writes the value. |

> [!WARNING]
>
> If a Code node writes the output but you reach the End node through its error output, the panel warns you that what it wrote is discarded: a Code node that fails does not keep what it wrote.

## Manage outputs

Open the **Output manager** from the top bar menu of the canvas, from the **Manage outputs** button in the End node panel, or from the workflow's ⋮ menu in the sidebar. From there you can:

* **See all the outputs** of the workflow with their total count.
* **Reorder** outputs by dragging them or with the keyboard. The order is saved and defines how the outputs appear on the parent's Workflow node.
* **Locate** an output on the canvas with the locate icon, which shows how many End nodes use it or whether it is unused.
* **Edit or delete** each output from its menu.
* **Preview** how the Workflow node looks in another workflow, with one exit per output and the color of its type.

> [!WARNING]
>
> If an output is used in several End nodes, the changes you make when editing it apply to all of them.

## Consume outputs from the parent workflow

When a workflow declares outputs, the [Workflow](https://docs.jelou.ai/en/guides/nodos/workflow.md) node that references it draws them as connection points, one per output:

* **Connect each output** to the matching branch in the parent workflow.
* **The schema variables** become available in the parent's variable picker as `$memory.response.<variable>`. For example, a schema with the variable `total` is read as `{{$memory.response.total}}`.

> [!TIP]
>
> Declare one output per outcome the parent workflow needs to tell apart. If the parent only needs to know that the child finished, a single neutral output is enough.

## Delete an output

Before you confirm, the delete window shows which End nodes will be removed on the current canvas, with the node that precedes them ("End after «Code»") or as "End without connection". End nodes that use the output in other channels of the same workflow are removed too.

The platform also checks whether any workflow in the project has that output connected on its Workflow node:

* **If any does, the deletion is blocked.** The message tells you which workflows have it connected: disconnect the route in each one and try again.
* **If none does**, the output is deleted along with the End nodes that had it selected and the routes that led to them.

> [!NOTE]
>
> The check looks at the connection, not the reference: a Workflow node that points to this workflow but does not have that output connected does not block the deletion.

If an End node cannot be removed, the output is deleted anyway and the platform warns you so you can reload the canvas and review that node.

## Test the workflow from the Tester

When the Workflow node has connected outputs, the child workflow runs **inside** the parent's execution: the parent waits for it to finish and continues down the output the child took. In the [Tester](https://docs.jelou.ai/en/guides/getting-started/tester.md) this shows up in two ways:

* Your replies are sent to the child workflow while it is in progress.
* The node does not show the **"Go to workflow"** button or the execution start separator, because there is no separate execution to go to.

A Workflow node with no connected outputs behaves as usual: it redirects the flow and the Tester keeps showing the button to open the target workflow.

## Next steps

> [card] [Workflow node](https://docs.jelou.ai/en/guides/nodos/workflow.md)
>
> Calls another workflow and continues down the output it took.

> [card] [Code node](https://docs.jelou.ai/en/guides/nodos/codigo.md)
>
> Writes an output value with `$output.set`.


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