# Testing and debugging

> Talk to your draft in test mode, watch the steps and variables, and find out why a flow did what it did.

**Test** (or ++T++) opens test mode beside the canvas. You talk to the flow as a contact would, and see each step light up as the run goes through it.



## What a test does, and doesn't

Test mode runs the **saved draft**, not the live version, so you can try changes before publishing them. It runs the same engine your customers get.

- **Nothing is sent** to anyone, and **nothing is saved**: no conversation, no contact, nothing in the inbox or the analytics.
- **Web requests are real.** An [HTTP request](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/http-request) step calls your API for real, with the vault's secrets. Point tests at a test environment if a call would book, charge or change something.
- **AI steps are real** and use tokens like any reply, counted against the step's agent (or the flow's **Agent for tests** for steps with their own instructions).
- **Knowledge lookups** search your real knowledge base.

## Running a test

1. Pick the **Channel** to preview: Website chat, WhatsApp or WhatsApp Web. Messages show the way that channel would show them: buttons, a list, or a numbered menu.
2. Write a first message, like a new contact would. Triggers are checked first (your keywords, for example); if none matches, the run starts at the start step. **Run from the start step** skips the first message.
3. Answer questions and press buttons (they appear as **Quick replies**), or type anything else.

To start somewhere in the middle, right-click a step and choose **Test from this step**. **Restart** starts over.



### Waits, timeouts and handoffs

Test mode never makes you wait:

- A question waiting for an answer offers **Skip to the timeout**, to try its **No reply** path.
- A [Wait](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/delay) step offers **Skip the wait**.
- A [Hand to a person](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/handoff) offers **Hand back to the bot**, as if a teammate had returned the conversation.

A [Go to flow](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/jump) into another flow ends the test there (a test stays in one flow); it tells you where the conversation would go and links to that flow.

### Edit while you test

You can change the flow during a test. The next message uses the new draft, and the panel says so.

## Reading what happened

- **Chat** shows the conversation, with the name of the step under each bot message (click it to find the step), and notes for warnings such as "Shown as a list" or "Split into several messages".
- **Variables** shows every variable as the run has it now; a dot marks the ones the last message changed. Tap one to see its whole value.
- **Steps** is the trace: each step the run entered, which output it left by, the answers it accepted or refused (and why: "wrong format", "too short"…), the web requests with their status and time, and where the run ended.

On the canvas, the step the run is on is marked: waiting for an answer, waiting, with a teammate, ended, or stopped.

## When something goes wrong

| You see | It means |
| --- | --- |
| Stopped: too many steps in one turn. Is there a loop without a question or a wait? | Steps lead into each other with nothing that waits. Add a question, a wait or an end to the loop. |
| Nothing connected: the run ends here | The output the run took isn't connected. Connect it, or end the flow on purpose with an End step. |
| Network error, Timed out, Blocked address | The web request failed. The step leaves by **Error**: make sure that path does something useful. |
| Secret not allowed for this host | The secret is saved for other hosts than the one in the address. |
| AI isn't set up, Token budget reached | The AI step couldn't answer and left by **Fallback**. |
| This flow has errors. The test still runs and stops where they get in the way. | The checks found errors. The test still runs up to where they get in the way. |

## Debugging a live conversation

For a conversation with real customers, open it in the [inbox](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/concepts/conversations-and-inbox): it shows which flow is on it and what the run is doing (running, waiting for a person), and each message says whether the flow, the AI or the agent wrote it.
