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

# Building flows

> Graph vs steps mode, branching, fan-out, conditions, and validation when saving — in the gu1 workflow automation engine with triggers and actions.

## Graph vs. Steps (Legacy)

| Mode      | Behavior                                                                                                                                                                               |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Graph** | Visual nodes: trigger → condition nodes (Yes/No) → action nodes. If the automation has a **valid graph** (nodes + edges and at least one trigger node), the engine runs the **graph**. |
| **Steps** | Ordered blocks; each block has **conditions** and **actions**. If the block’s conditions fail, the **entire block** is skipped.                                                        |

If both graph and steps exist, **graph wins**.

## Branching (IF / ELSE)

* Condition nodes expose **true** and **false** outputs. Wire **both** for a real IF/ELSE.
* If only **one** edge leaves a condition, the engine uses that edge for **both** outcomes (usually unintended).

## Fan-Out from an Action

If one **action** node connects to **several** next nodes, the engine runs **all** outgoing branches **in sequence** (fan-out). It does **not** mean “pick one branch”—use a **condition** node to choose.

## Conditions

Conditions compare a **field** from the context (see [Triggers](/en/workflows/triggers)) to a **value** with an **operator** (equals, not equals, numeric comparisons, in list, contains, etc.). The UI only offers fields that match the **allowed contexts** for your trigger.

After actions that **recalculate risk** or **change status**, later conditions see the **updated** values.

## Saving and Validation

When you save in the app or via the API, the product validates:

* **Synergy** — trigger ↔ each action, and each **immediate** action → next action ([Synergy](/en/workflows/synergy)).
* **Graph shape** — e.g. a trigger node must exist; edges must make sense for the builder.

If save fails, check error messages: they usually point to a **forbidden trigger for an action** or an **invalid successor action**.

## Testing vs. Production

| Endpoint                        | Purpose                                                                                                                          |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `POST /automations/:id/execute` | **Test** run: synthetic event, **`processEvent`**, **no** standby.                                                               |
| `POST /automations/:id/run`     | **Production-style** for **`manual_execution`**: **`runAutomationById`**; standby and `waiting` responses apply when configured. |

***

**Maintenance:** Graph traversal order for synergy checks uses `getOrderedActionTypesFromGraph` in `workflow-synergy.ts`; complex graphs with many branches should be reviewed in the builder.
