# Workflow

> Draw the steps your GiovBot agent follows, which tools and knowledge each step uses, and where each chat goes next.

Most teams only need Procedures. Use Workflow when every chat should follow a fixed path.

A workflow is a flow chart for one agent. The agent talks in a **step**. What the visitor says next decides which **connection** the chat follows. A workflow can also run a tool, hand the chat to your team, or close it.

Open it in **GiovBot → your agent → Workflow**. It is saved to the draft as you edit, and goes live when you publish, with the rest of the agent. Moving a node around is not a change that needs publishing.

## Steps

A step is where the agent speaks. Each step has:

- **Name** and **Instructions**: what the agent should do here. By default the instructions are added to the agent's own. Under **Advanced** you can replace them instead. The agent's safety rules and guardrails apply either way.
- **Tools**: the custom tools the agent can use in this step. Leave it empty to use all of the agent's tools.
- **Knowledge**: the sources the agent searches in this step. Leave it empty to use all of the agent's sources.
- **Model** (under Advanced): a different model for this step.

[Procedures](/docs/giovbot) still work in every step, and a procedure's own tools stay available.

## Connections

Draw a line from one node to another to connect them. A node can have up to 8 connections out, and each says when to follow it:

- **Plain language**: for example "Customer wants to buy a plan". A small model reads the visitor's message and decides.
- **A rule**: a comparison on a conversation variable (equals, does not equal, contains, is set, is not set). Rules are checked in code.
- **Always**: followed when nothing before it matched. It must be the last connection of the node, and a node can have only one.

When the visitor sends a message, the agent looks at the connections of its current step in order and follows the first one that matches. If none matches, it stays on the step. A connection may point back to an earlier node, and those are drawn dashed. With **Prevent loops** on, a node can be entered only once in the same turn. A turn follows at most 6 connections.

Rules and plain-language conditions decide the route. They are not security checks: a visitor can say anything, and what they say can change a variable the agent stores. Tools that need a verified identity keep their own check. Workflow state and server-recorded values (anything starting with `giovBot`, identity and location fields) can never be set by what a visitor says.

The first message leaves the **Start** node. A plain greeting such as "hi" is answered with the agent's first message, and the workflow begins with the next message. A workflow whose Start has no connection is off, and the agent works as if it had none.

## Tool, handoff and end nodes

- **Tool**: runs one of the agent's tools as soon as it is reached, with inputs taken from conversation variables or fixed values. It always runs, and the model does not decide. It has two connections, **Success** and **Failure**. The tool keeps the same safeguards as when the agent calls it: writes need to be allowed on the tool, tools that need a verified identity still need one, and inputs are checked against the tool's fields. The next step can use what the tool returned.
- **Handoff**: hands the chat to the inbox, a department, a teammate or another published agent. It is announced to the visitor and alerts your team, like any other handoff. If no handoff can happen, for example the conversation was just returned from a person or transfers are off, the agent stays on the previous step and does not promise one. If nobody is online, the agent says so once, flags the chat for your team, and carries on answering from the step. The tools that lead only into that handoff, and the handoff itself, are not run again on every message. They are tried again as soon as someone is online, after about 10 minutes, or when the visitor changes a value the step depends on, such as an order number. Other connections keep working.
- **End**: closes the conversation. Turn off **Send the rating card** to close without asking for a rating. A conversation that comes back after it closed starts again at Start.

## Problems

The **Problems** pill at the bottom left lists what must be fixed, and clicking one selects the node. A workflow that is on can only be published with no problems. The checks are:

- exactly one Start, and every node reachable from it
- no connection pointing at a missing node
- every step has a name and instructions
- every tool node has a tool, both Success and Failure connected, and the tool's required inputs
- every handoff has a destination
- tools, knowledge and variables used exist on the agent
- every plain-language connection has text, and every rule is complete
- Always is last and used at most once per node
- nothing connects back to Start, tool nodes do not form a ring, and no more than 2 tool nodes follow each other

## Templates

**Templates** starts you from **Qualify and route**, **Order help** or **Lead capture**. Applying one replaces the current workflow after you confirm, and you can undo it.

## Limits and plan

| | |
|---|---|
| Nodes | 40 |
| Connections | 80 |
| Connections out of one node | 8 |
| Connections followed in one turn | 6 |
| Tool nodes run in one turn | 2 |
| Plans | Business and Advanced |

On other plans the page shows an upgrade note, saving is refused and a stored workflow does not run. If a published workflow cannot be read or fails its checks, the agent answers as it normally would.

In the preview, the workflow runs the same way, but tools are not called and nothing is handed off or closed.
