> ## 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.

# Flows

> Script a conversation step by step on the flow canvas, understand the node palette, and know when to let the AI cover what the script misses.

A flow is a conversation drawn as a diagram. Instead of trusting the AI to work out what to say
next, you lay out the steps — send this, ask that, branch on the answer — and the agent walks the
path. Flows belong to **Flow Agents**, created from the **+ New agent** menu.

<Frame caption="The flow canvas">
  <img src="https://mintcdn.com/haconsultancy/8jQZZfLAZM_xjJe7/images/ai-agents/flow-canvas.png?fit=max&auto=format&n=8jQZZfLAZM_xjJe7&q=85&s=84009d03c2a5994cd2102bb7ac65222f" alt="The flow canvas with connected nodes and the node palette on the left" width="2880" height="1800" data-path="images/ai-agents/flow-canvas.png" />
</Frame>

## When to use a flow

Use a flow when the conversation has a shape you already know: an order-status check, a booking,
a qualification questionnaire, a returns process. You get the same steps every time, in the same
order, with the same wording.

Use a [Prompting Agent](/ai-agents/creating-an-agent) instead when customers arrive with open
questions you can't enumerate.

## The canvas

A Flow Agent opens straight onto its **Flow** tab. Drag nodes from the palette, connect the output
of one to the input of the next, and click into a node to configure it. The canvas has its own
**Save** and **Publish** controls — a flow doesn't go live until you publish it.

<Note>
  Because the canvas owns its own saving, the editor's **Test** button is hidden while the Flow tab
  is open. Leaving the tab with unsaved work raises **Discard unsaved changes?** first.
</Note>

## The node palette

Nodes are grouped by what they do.

<AccordionGroup>
  <Accordion title="Start">
    | Node      | What it does                      |
    | --------- | --------------------------------- |
    | **Start** | "Where every conversation begins" |

    Every flow has exactly one Start node.
  </Accordion>

  <Accordion title="Send a message">
    | Node              | What it does                              |
    | ----------------- | ----------------------------------------- |
    | **Send Text**     | "Send a plain text message"               |
    | **Send Media**    | "Send an image, video, audio or document" |
    | **Send Location** | "Send a pin on the map"                   |

    These say something and move straight on to the next node.
  </Accordion>

  <Accordion title="Ask a question">
    | Node                 | What it does                                          |
    | -------------------- | ----------------------------------------------------- |
    | **Ask Buttons**      | "Prompt with up to 3 reply buttons"                   |
    | **Ask List**         | "Prompt with a single-select list (≤10 rows/section)" |
    | **Ask Text**         | "Ask an open question and capture the answer"         |
    | **Ask Dynamic List** | "A single-select list built from API data"            |

    These wait for the customer. Buttons and lists each get one output per choice, so the flow
    branches on what the customer picks. **Ask Dynamic List** builds its options at run time from
    a system of yours — useful for available appointment slots or a live product list.

    The limits of 3 buttons and 10 list rows per section come from the messaging channels
    themselves, and the canvas warns you when you exceed them.
  </Accordion>

  <Accordion title="AI">
    | Node                 | What it does                                               |
    | -------------------- | ---------------------------------------------------------- |
    | **AI Collect**       | "Goal-driven collection into variables"                    |
    | **AI Intent Branch** | "Classify free text into outcomes"                         |
    | **AI Answer (KB)**   | "Bounded Q\&A from the knowledge base"                     |
    | **Route to Folder**  | "Move the chat to a folder; the folder's agent takes over" |
    | **Handoff to Human** | "Assign to a person and stop auto-replies"                 |

    These bring judgement into an otherwise fixed script. **AI Collect** keeps asking until it has
    the variables you listed. **AI Intent Branch** reads free text and sends the conversation down
    the branch that matches. **AI Answer (KB)** answers from your
    [knowledge base](/ai-agents/prompt-knowledge-and-tools) and nothing else, with a
    **No-answer reply** for when the knowledge base has nothing.

    **Route to Folder** and **Handoff to Human** both end the flow — one passes the conversation to
    whichever agent owns that folder, the other passes it to a person.
  </Accordion>

  <Accordion title="Logic & flow">
    | Node             | What it does                              |
    | ---------------- | ----------------------------------------- |
    | **Condition**    | "Branch on a variable or the last answer" |
    | **Set Variable** | "Assign a flow variable"                  |
    | **HTTP Request** | "Call an API and save its JSON response"  |
    | **End**          | "Terminate the conversation flow"         |

    **HTTP Request** has two outputs — one for a successful call and one for an error — so you can
    tell the customer something sensible when your system is down.
  </Accordion>
</AccordionGroup>

Every branching node also gets a trailing **else** output, which catches anything that didn't match
one of your named branches. Connect it — an unconnected `else` is where conversations go to die.

## Building a simple flow

Here is an order-status check, end to end.

<Steps>
  <Step title="Greet the customer">
    Drag a **Send Text** node and connect it to **Start**. "Hi! I can check an order for you."
  </Step>

  <Step title="Offer the choices">
    Add an **Ask Buttons** node with two buttons: `Track my order` and `Something else`. The node
    now has an output per button.
  </Step>

  <Step title="Ask for the order number">
    From the `Track my order` output, add an **Ask Text** node — "What's your order number?" — and
    save the answer into a variable.
  </Step>

  <Step title="Look it up">
    Add an **HTTP Request** node that calls your order system with that variable, and keep the
    response.
  </Step>

  <Step title="Answer, and handle failure">
    From the success output, add a **Send Text** node that reads the status back to the customer.
    From the error output, add a **Handoff to Human** node so a person can pick it up.
  </Step>

  <Step title="Route the other branch">
    Send the `Something else` output — and the `else` output — to **Handoff to Human** too.
  </Step>

  <Step title="Save and publish">
    Nothing you draw affects live conversations until you publish.
  </Step>
</Steps>

## When Hybrid is the right choice

A pure flow only knows the paths you drew. Customers don't. Someone will answer "actually can I
change the delivery address?" in the middle of your order-status branch, and a strict flow has
nothing to say.

The **General** tab of a Flow Agent has a switch for exactly this:

> **Let AI handle off-script messages** — When on, the agent follows your flow but falls back to
> the AI for anything the flow doesn't cover (Hybrid). When off, it sticks strictly to the flow.

<CardGroup cols={2}>
  <Card title="Leave it off when" icon="lock">
    The process is regulated, scripted or contractual, and an improvised answer would be a problem.
    A strict flow never says anything you didn't write.
  </Card>

  <Card title="Turn it on when" icon="wand-magic-sparkles">
    The flow covers the common path but customers wander. The agent stays on the script where the
    script applies and answers freely where it doesn't.
  </Card>
</CardGroup>

With Hybrid on, the agent also gains a **Prompt & Tools** tab — the fallback replies use the same
system prompt, knowledge base and tools as a Prompting Agent, so fill those in too.

## Next steps

<CardGroup cols={2}>
  <Card title="Prompt, knowledge and tools" icon="book" href="/ai-agents/prompt-knowledge-and-tools">
    Needed for Hybrid fallbacks and AI nodes.
  </Card>

  <Card title="Folders and rules" icon="folder" href="/settings/folders-and-rules">
    Where **Route to Folder** sends a conversation.
  </Card>
</CardGroup>
