Mokanata Docs
Agents

Test, publish and version a flow

Run a flow's draft on a sample message, fix what stops it from publishing, publish a new version, and restore or discard versions.

A flow has a draft, which you edit, and published versions, which live runs use. Test the draft on a sample message to see what each step would do, publish it when it's right, and use the version history to go back if you need to.

  • Who can use it: Test runs need the Test agents permission (owners, admins and members by default). Publishing needs Edit agents and Deploy and pause agents (owners and admins). Restoring and discarding versions needs Edit agents. Viewers can open the version history but not change anything. See Roles and permissions.
  • Before you start: Open the flow in the builder. See Flow builder basics.

Test the draft

A test runs the draft as it is now, unpublished changes included. Nothing is sent, no records change, and apps and webhooks aren't called.

Open Test run

Click Test run in the top bar, or press T. The Test dialog opens with the flow's name.

The Test Inbound routing dialog: Try a sample with Pricing question, Invoice question and Wants a person, the customer message, Arrives on WhatsApp, and Close and Run

Choose a message

Click a sample under Try a sample (it runs straight away), or write your own in Customer message the way a customer would. Choose the channel it Arrives on.

Run it

Click Run or press ⌘ Enter (Ctrl Enter on Windows and Linux). The result shows the customer's message, the agent's draft with how long it took and how confident it was, the outcome, which sources it cited and, for flows that check drafts, Rules checked.

The test result: the customer's message on WhatsApp, Triage Agent's draft routing it to Closer Agent with the deal set to Qualified, drafted in 1.4s at 0.93 confidence, the outcome Routed to Closer Agent with 1 source cited, and the start of Step by step

Read it step by step

Under the result, Step by step lists every step of the flow and what it did with this message. Steps on a path are indented under their condition.

Step by step for Inbound routing: the trigger, Classify the message (Intent: pricing), Switch on intent (Took Buying intent), the Buying intent steps passed, the Support, Spam and Otherwise steps skipped as not on this path, and Write to CRM and timeline logged

Click Run again to try another message, or Close. The dialog remembers your last message and result while you work.

What the steps say

MarkStateExamples
Check markPassed"Intent: pricing", "Took “Buying intent”", "Would update: stage = qualified", "Would call POST … Not called in a test", "Would post to n8n · lead router. Not sent in a test"
HandHeldA rule held the draft for approval, or a Filter stopped the run ("Didn't match, so the run stops here").
Cross (red)FailedA guardrail rule failed, with the rule and why.
DashSkipped"Not on this path (Support)", "Not reached: a rule stopped the draft", "Turned off"

What the outcome says

The outcome badge sums up what would have happened, given the agent's autonomy level:

OutcomeWhat it means
Would send on its own: every check passedAn autonomous agent would have sent the reply.
Ready, waits for your approvalThe agent is on Approval, so the reply would wait in the approval queue.
Drafted in shadow: nothing sendsThe agent is in shadow, so nothing would be sent.
Held for approval, Handed to the deal owner, Blocked by a hard limitA guardrail rule stopped the draft; the rule's name follows.
Drafted and handed to a person, as designedThe flow ends with a handoff, not a send.
Drafted. This flow has no send step yet.The flow drafts but never sends.

If the flow sends without a guardrail, the result notes "Nothing in this flow checks the draft before it sends." For the rule results, see Test an agent.

Publish the flow

Click Publish

Click Publish in the top bar, or press P. If the flow has problems, a banner lists them instead; see Fix what stops publishing. If you have unapplied edits in the Code view, apply or discard them first.

Confirm the version

The dialog Publish version 13? (the next version number) says what happens and sums up what changed since the last version, such as "Turned citations on". Warnings that don't stop publishing are listed too.

The dialog Publish version 13? Live runs switch to the new version right away. v12 stays in history. Turned citations on, with Cancel and Publish v13

Publish

Click Publish v13. A toast confirms it, and the Unpublished changes badge goes away. If publishing fails, the dialog says It didn't publish with the reason, and the button becomes Try again.

The toast Published v13: Live runs use it from now on. v12 stays in history

What happens when you publish depends on the flow:

FlowWhat publishing does
A live flowLive runs switch to the new version right away. The previous version stays in history.
A new flowIt goes live for the agent right away and starts picking up new conversations ("Discount requests is live"). The builder moves to the flow's own address.
A flow of an agent that hasn't been deployed yetIt's saved as the new version and goes live when you deploy the agent. See Deploy, pause and set autonomy.
A paused flowIt's saved as the current version; the flow stays paused until someone resumes it on the agent's Flows tab.

Fix what stops publishing

When you click Publish on a flow with problems, a red banner above the flow says how many problems stop it from publishing and lists each one, with a button to go to it: Show the step, Choose a trigger or Go to the name. Add guardrail checks adds a gate before the send in one click. Close the banner with its X. Each problem also shows at the top of the step's settings, under Fix before publishing.

The problems banner: 2 problems stop this flow from publishing. Finish the conditions on Matches: each needs a field and a value, with Show the step; and Send automatically isn't behind a guardrail or an approval step, with Show the step and Add guardrail checks

ProblemHow to fix it
Name the flow before you publish it.Type a name in Name this flow.
Add a trigger. / Move the trigger to the top.Pick a trigger from Blocks; nothing can run above it.
Add at least one step after the trigger.Add a step.
Add a Draft reply step before …A send needs a draft to send. Add Draft reply above it.
… isn't behind a guardrail or an approval step.Click Add guardrail checks, or add Human approval gate from Blocks before the send.
… has no rules. / Every rule in … is off.Add or turn on a rule in the gate's settings, or remove the gate.
"…" has a condition that doesn't parse.Edit the rule. See Guardrails and rules.
… uses {{…}}, which isn't available at this step.Pick a variable from the { } list instead.
Another step is also called "…".Give the step its own Reference name.
Finish the conditions on "…"Every condition row needs a field and a value. See Conditions and paths.
A step is missing a settingFor example: choose the webhook or destination, map at least one field, write the prompt, choose an approved WhatsApp template, set the payment amount, enter the URL (starting with https:// or a variable), fix the JSON body, choose the flow to run, choose an app, or connect it in Integrations.

Warnings, such as "… only warns. Nothing it checks can hold a reply.", "No knowledge sources are on, so drafts can't cite your docs." or "Every path of … is empty, so it changes nothing.", show in the publish dialog but don't stop you.

Version history

Click Version history (the clock icon) in the top bar. It lists every published version, newest first, with what changed, when and who published it. The newest is marked Live (or Current for a paused flow).

Version history for Pricing follow-up: v13 Live, Turned citations on, published just now; then v12, v11, v10 and v9 with what each added, who published it and a Restore button

Restore an older version

Choose the version

In Version history, click Restore next to it.

Confirm

Restore v11 to your draft? explains that your draft is replaced with that version's steps and rules (including any unpublished changes you have now), and that live runs keep using the current version until you publish. Click Restore v11, or Keep my draft to cancel.

The dialog Restore v11 to your draft? Your draft is replaced with v11's steps and rules. Live runs keep using v13 until you publish. Undo with ⌘ Z, with Keep my draft and Restore v11

Publish it

The restored version is now your draft. Test it, then publish it to make it live again. Until then, ⌘ Z or the toast's Undo brings your previous draft back.

Discard unpublished changes

When the draft differs from the live version, Version history starts with an Unpublished changes row. Click Discard, then Discard changes to put the draft back to the published version. Undo in the toast brings the changes back.

The dialog Discard unpublished changes? Your draft goes back to v13. Undo brings the changes back, with Cancel and Discard changes

On a new flow that's never been published, the row is Unpublished draft and the button is Start over: Clear this draft? removes its name and steps (and Undo brings them back). A flow with no published versions says "Not published yet. Publishing creates v1."

Troubleshooting

Next steps

On this page