ZyanDocs

Writing the call workflow

Turn a call into ordered stages with objectives, required slots, turn and time budgets, exit criteria and fallbacks — and know when supervision actually applies.

Most people write a voice agent's script as one long instruction and then wonder why the call wanders. The Workflow tab fixes that by making the call an ordered set of stages, each with a job to do, a budget to do it in, and a defined way out. It is the difference between a prompt and a script.

Before you start

You need an editable draft version of an agent and the voice edit permission. Published and archived versions are read-only — use Edit as new draft first.

Set the goal first

Before you add a single stage rule, open the agent's Agent tab and fill the two fields on its Prompt card.

Goal is the objective previews and test calls work toward — Campaigns use their own purpose; this goal drives previews and test calls. Approved next steps is the list of calls-to-action the agent is allowed to offer, one per line. The placeholder shows the shape:

Schedule a meeting
Request a callback
End politely

Anything not on that list is not on the table. That is the point of the field: it is a closed set, not a suggestion.

Add the stages

Every stage runs on its default instructions until a rule tunes it, so with no rules the Stages card reads No stage rules yet. A rule is how you tune one.

Click Add stage and pick a stage

The menu lists the stages without a rule. Picking one opens its sheet; the stage is fixed for that sheet.

Write the Objective

The placeholder reads Complete the <stage> stage. Replace it with one sentence about what must be true when this stage ends.

List the Required slots

Facts the agent must collect before this stage may advance — snake_case keys, as the runtime stores them. Enter adds a slot; the placeholder is need, timeline.

Set Max turns and Max seconds

The budget. Turns run 1–50 and seconds 5–1800; leave either empty to store no cap.

Write Exit criteria and Fallback

What signals the stage is done, and what to do when it cannot be done.

Click Add rule

The sheet's Tools row shows What the runtime hands the agent here. — the permitted tools this stage may use. It is read-only; the Tools tab decides which tools the agent may call at all.

Open a rule's row to change it and click Save rule. Remove stage in the sheet drops the rule after a confirm, and the stage goes back to its default instructions. The card's footer counts how many stages carry a rule.

The twelve stages

They run in this order, and the names describe what each is for:

StageWhat it is for
PreflightBefore the conversation starts — no tools are handed over
Introduction and disclosureGreeting, who is calling, and the AI disclosure
Permission to continueAsking whether now is a good time
DiscoveryUnderstanding the situation
QualificationEstablishing whether this is a fit
Value alignmentConnecting what they need to what you offer
Objection handlingAnswering the pushback
Call to actionOffering one of the approved next steps
Booking or transferActually booking, or handing to a person
ConfirmationReading back what was agreed
Wrap-upClosing the call cleanly
Post-callAfter the conversation ends — no tools are handed over

You do not need a rule on every stage. A callback-confirmation call might tune four. A cold discovery call might tune eight.

Settings reference

SettingWhat it changesDefault
GoalOn the Agent tab. The objective previews and test calls work toward; campaigns use their own purpose.—
Approved next stepsOn the Agent tab. The calls-to-action the agent may offer, one per line. A closed list.—
StagePicked from Add stage; one rule per stage.—
ObjectiveWhat this stage must accomplish. Up to 500 characters.—
Required slotsFacts the agent must collect before this stage may advance.—
Max turnsTurn budget for the stage. Range 1 to 50; empty stores no cap.—
Max secondsTime budget for the stage. Range 5 to 1800; empty stores no cap.—
Exit criteriaWhat signals the stage is complete and the agent may move on.—
FallbackWhat to do when the stage cannot complete inside its budget. Placeholder: Move on politely without inventing information.—
ToolsRead-only. The permitted tools the runtime hands the agent in this stage.—

Budgets are the part people get wrong

A stage's Max turns and Max seconds are a budget, not a target. Four turns is enough to ask a question, hear an answer, ask a follow-up and acknowledge it. If a discovery stage needs twelve turns, the objective is probably two objectives wearing one coat — split it.

The Fallback matters more than it looks. It is what the agent does when the budget runs out with a required slot still empty. The placeholder — Move on politely without inventing information — is the right instinct: the failure mode you are guarding against is an agent that invents the answer rather than admit it did not get one.

Write exit criteria as observable facts

“The person has said a rough timeframe” is testable. “The person is engaged” is not. The agent has to decide the stage is done using only what was said on the call.

When stage supervision actually applies

This is the part that surprises people. Writing stages always shapes the composed prompt, but deterministic stage supervision — the runtime actually enforcing the turn and time budgets, the listen-first timing, the interruption handling, the bounded memory and the silence policy — only happens when Workflow-supervised voice runtime is switched on in SettingsVoice & Telephony. The agent's Advanced tab repeats the workspace state at the top, and its Workflow supervisor switch under Runtime features can turn stage supervision off for one agent.

Off by default

Workflow-supervised voice runtime defaults to off, and the row only appears when the runtime settings are available in your environment. With it off, your stages still guide the agent through the prompt, but nothing forces a stage to end at four turns. Turn it on before you rely on the budgets, and it applies to new calls only.

Troubleshooting

SymptomCauseFix
Add stage is greyed outEvery stage already carries a rule, or the version is read-onlyOpen an existing rule to change it, or use Edit as new draft
The agent ignores a stage's turn budgetWorkflow-supervised voice runtime is off for the workspace, or the agent's Workflow supervisor is offTurn it on in Settings → Voice & Telephony and check Runtime features on Advanced; it applies to new calls
The agent invents an answer when it runs out of turnsFallback was rewritten to push harderRestore a fallback that moves on without inventing information
Validation fails against Workflow when you publishA rule is missing a required field, or a budget is outside its rangeThe error names the field and the Workflow tab carries the badge — fix it and validate again
The agent offers something you never approvedIt is not in Approved next steps, but the persona or objective implies itKeep the offer in the approved list and out of free-text fields