# Control

Components to control the execution flow of the workflow.

## **Conditional Split**

**Description**\
The Conditional Split component evaluates an aggregated measure or custom expression from the input data against a logical condition, directing execution into one of two branches: **If** and **Else**. This allows workflows to follow different processing paths depending on whether the condition evaluates to true or false.

**Inputs**

* `Source table [Table]`

**Settings**\
The condition can be defined in two ways:

1. **Simple condition** – built through the UI:
   * **Column**: The column from the input table to aggregate.
   * **Aggregation method**: Function applied to the column (e.g., `MIN`, `MAX`, `AVG`, `SUM`).
   * **Operator**: Comparison operator (e.g., `Is equal to`, `Is greater than`, `Is less than`).
   * **Value**: The value to compare the aggregated result against.
2. **Custom expression** – a manually written SQL expression that can include multiple columns, functions, and logical operators (e.g., `AVG(population) > 3000 AND (category LIKE 'capital_city' OR capital IS TRUE)`).

**Outputs**

* `If path [Table]`: Passes all rows from the input table when the condition evaluates to **TRUE**.
* `Else path [Table]`: Passes all rows from the input table when the condition evaluates to **FALSE**.

## **Success/Error Split**

**Description**\
The Success/Error Split component determines the outcome of the previous component’s execution and routes the workflow accordingly. If the upstream component completes successfully, the workflow continues through the **Success** branch; if it fails, execution follows the **Error** branch. This enables workflows to handle errors gracefully, trigger alternative actions, or send notifications when issues occur.

**Inputs**

* `Source table [Table]` (only available if the upstream component executed successfully)

**Settings**

* None

**Outputs**

* `Success path [Table]`: Passes the table produced by the previous component if no errors occurred.
* `Error path [No table]`: Produces no table output (since the previous step failed) but can connect to components such as HTTP Request, Send by Email, or logging for error handling.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carto.com/carto-user-manual/workflows/components/control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
