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

# Building a flow

> A walkthrough of the automation builder: the canvas, the block palette, connecting steps, passing data between them, loops, and publishing.

The builder is where you assemble an automation. You drag blocks onto a canvas, connect them in the
order they should run, and configure each one in the settings rail on the right.

<Frame caption="The automation builder: palette on the left, canvas in the middle, block settings on the right.">
  <img src="https://mintcdn.com/haconsultancy/8jQZZfLAZM_xjJe7/images/automations/builder.png?fit=max&auto=format&n=8jQZZfLAZM_xjJe7&q=85&s=32bf484491b1a907f0fc62cefef4d82d" alt="The Callivox automation builder showing a trigger connected to two action blocks, with the settings panel open" width="2880" height="1800" data-path="images/automations/builder.png" />
</Frame>

## Opening the builder

From **Automations → Flows**, click **New automation** (or **Create your first automation** if the
list is empty) to start with a blank canvas. Click any existing flow row to open it for editing.

The top bar holds everything you need while building:

| Control       | What it does                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------------ |
| **Flows**     | Goes back to the list. If you have unsaved changes you will be asked first.                                  |
| Name field    | The automation's name. A new flow starts as **Untitled automation** — rename it now so it is findable later. |
| Status chip   | **Draft**, **Published**, or **Published — unsaved changes**.                                                |
| **Variables** | Opens the workflow variables panel, with a badge showing how many you have.                                  |
| **Save**      | Saves your edits. Only active once something has changed.                                                    |
| **Publish**   | Saves, then makes this version the live one.                                                                 |

## Step 1 — Add a trigger

A new canvas shows **"Start building your automation"** / *"Drag a trigger from the left to begin,
then add actions and logic."*

Until a trigger is on the canvas, the palette shows **only triggers**, under the heading **Choose a
trigger** and the line *"Pick what starts this flow."* Search for one, then drag it onto the canvas
or click it to add it.

Once a trigger exists, the palette flips: triggers disappear and every action and logic block
becomes available under **Add a step** / *"Drag onto the canvas, or click to add."*

[Triggers](/automations/triggers) covers each trigger type in detail.

## Step 2 — Add actions from the palette

<Frame caption="The block palette groups everything into two buckets — Apps, and Tools & Utilities.">
  <img src="https://mintcdn.com/haconsultancy/8jQZZfLAZM_xjJe7/images/automations/palette.png?fit=max&auto=format&n=8jQZZfLAZM_xjJe7&q=85&s=ea5617d5b8ecb9d565c3d890c8007f97" alt="The automation builder block palette with the Callivox section expanded" width="2880" height="1800" data-path="images/automations/palette.png" />
</Frame>

The palette sorts every block into two buckets:

<CardGroup cols={2}>
  <Card title="Apps" icon="grid-2">
    One section per connected product: **Callivox**, HubSpot, Bitrix24, Dynamics 365, Monday.com,
    Business Central, Salla, Drupal Commerce, JotForm, Microsoft Forms, Facebook, LinkedIn, Google
    Sheets, Microsoft Excel, Microsoft Outlook, Microsoft Teams, Asana, ClickUp and Airtable.
  </Card>

  <Card title="Tools & Utilities" icon="screwdriver-wrench">
    The building blocks that belong to no particular app: **Webhook**, **Schedule**, **Logic &
    Flow**, **HTTP**, **Variables**, **Data**, **Date & Time**, **Text** and **Numbers**.
  </Card>
</CardGroup>

Only the **Callivox** section is expanded when you arrive. Use **Expand all** / **Collapse all**, or
the search box (**Search steps…**), to find things quickly; the sections you leave open are
remembered next time.

Blocks are colour-coded by what they are: triggers green, actions blue, control blocks amber,
utilities violet.

## Step 3 — Connect the steps

Drag from a block's output handle to the next block's input handle. Some blocks have more than one
output — **If / Else** has **True** and **False**, **For Each** has **Item** and **Done**, and the
**HTTP Request** block has a separate error output — so which handle you drag from decides which
path a step sits on.

Other canvas controls:

* **Arrange** (top right) auto-lays the diagram out top to bottom and fits it to the view.
* Select a block or a connector and press **Delete** or **Backspace** to remove it. Deleting a block
  you have already configured asks for confirmation first.
* The minimap and zoom controls help on larger flows.

## Step 4 — Configure each block

Click a block to open the settings rail on the right. With nothing selected it reads **"Nothing
selected"** / *"Select a block on the canvas to edit its settings."*, and a block with no options
reads *"This block has no settings to configure."*

Three things appear on most blocks:

* **A Connection dropdown** on any block that talks to an outside app. It defaults to
  **— default connection —**. If you have not authorised that app yet you will see *"No {provider}
  connections yet — add one from the Connections button on the Automations page."* — see
  [Connectors and connections](/automations/connectors).
* **Choose… and Custom…** on dropdown fields. **Custom…** reveals a free-text box for values that
  are not in the list.
* **Delete block** at the bottom of the rail.

Validation problems show as a red alert at the top of the rail.

## Passing data between steps

Almost every field can be filled from an earlier step instead of typed by hand. Use the **Use a
previous step** picker on the field. It offers a search box (**Search steps & fields…**) and lists
what is available, grouped by the step that produced it, plus a **Variables** group for your own
workflow variables.

This is how a flow carries data forward: the email captured by a form trigger becomes the email on a
**Create Contact** action; the order id returned by one step becomes the lookup value for the next.

### Workflow variables

Click **Variables** in the top bar to open **Workflow Variables** — your own named slots for holding
data across the flow. Empty, it reads *"No variables yet. Add one to store and pass data between
steps."*

Each variable has a **Name**, a **Type** (**Text**, **Number**, **True / False**, **List** or
**Object**) and an optional default value. Names must be unique and use letters, digits and
underscores, and cannot start with a digit.

Set and read them with the blocks in the **Variables** section of the palette: **Set Variable**,
**Get Variable**, **Increment Variable**, **Update Variable** and **List Operation**.

<Tip>
  Renaming a variable updates every step on the canvas that referenced it, so you can rename freely
  after you have wired things up.
</Tip>

### Reshaping lists

When a step hands back a list that is the wrong shape — too many columns, one row per day when you
want one per person, duplicates you do not need — use the blocks in the **Data** section to map,
filter, group, deduplicate and sort it before the next step sees it. See
[Working with data](/automations/working-with-data).

## Repeating steps with For Each

To do the same work once per item in a list — every row read from a sheet, every record returned by
a search — use the **For Each** block from **Logic & Flow**.

<Steps>
  <Step title="Set the list">
    Drop **For Each** on the canvas and set its **Items** input. Pick a list variable, or a list
    output from an earlier step, using the **Use a previous step** picker.
  </Step>

  <Step title="Build the loop body">
    Connect the **Item** output to the first step of the work you want repeated. Inside the loop,
    **Current item** and **Current index** are available to any field.
  </Step>

  <Step title="Close the loop">
    Connect the last step of the body back to the **For Each** block. Without that return connection
    the body only runs once, and saving warns: *"This For Each loop never returns to the loop step,
    so it only runs once."* For a simple straight-line body Callivox wires the return connection for
    you.
  </Step>

  <Step title="Continue after the loop">
    Connect the **Done** output to whatever should happen once every item has been processed.
  </Step>
</Steps>

<Warning>
  A loop can only be entered through the **For Each** block. If a step inside the loop also has a
  connection coming from outside it, saving fails with *"This step is inside a For Each loop but also
  has a connection from outside the loop."*
</Warning>

The other blocks in **Logic & Flow** are **If / Else** (branch on a condition), **Switch** (route
down one of several paths), **Loop** (repeat while a condition holds) and **End** (stop the
automation).

<Note>
  There is no wait or delay block. To do something after a period of time, use the **Schedule**
  trigger on a separate flow.
</Note>

## Step 5 — Save and publish

Click **Save** to store your work. You will see **"Automation saved."** A flow can be saved as often
as you like without going live.

Before it saves, Callivox checks the flow. Common messages:

* **"Add at least one trigger and one action."**
* **"Add a trigger to start the automation."**
* `{Field} is required.` for a required setting left blank
* **"Time must be in 24-hour HH:mm format (e.g. 19:00)."** on a schedule
* `Request body is not valid JSON.` on an HTTP block

If several problems exist you will see `Can't save — {first message} (and N more)`. Fix them and
save again.

When you are ready, click **Publish**. It saves first, so the live version is exactly what you are
looking at, then arms the trigger. The status chip turns **Published** and you will see
**"Automation published."** Edit a published flow and the chip becomes **Published — unsaved
changes** until you publish again.

<Note>
  Publishing makes a flow live; **Enable / Disable** on the flow list is the on-off switch you use
  afterwards. A published flow that has been disabled will not run.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Triggers" icon="bolt" href="/automations/triggers">
    Every way a flow can start.
  </Card>

  <Card title="Connectors and connections" icon="plug" href="/automations/connectors">
    Authorising the apps your actions talk to.
  </Card>

  <Card title="Runs and troubleshooting" icon="list-check" href="/automations/runs-and-troubleshooting">
    Watching your flow execute, and diagnosing failures.
  </Card>

  <Card title="Automations overview" icon="circle-info" href="/automations/overview">
    Flows, runs, folders and your monthly run allowance.
  </Card>
</CardGroup>
