Zervice LogoZervice
User Guide

Building & Testing Dialog Flows

Step-by-step guide to the visual Flow Editor, all 8 node types with complete field references and practical examples, connection rules, proven flow patterns, and testing with the Flow Test Runner.

Using the Visual Flow Editor

Open Dialog Flows (/admin/flows) in your Workspace Console to create, edit, and organize workflows visually as a left-to-right branching tree.

Dialog Flow Studio showing Build/Publish/Archive stages, branching flow canvas, and Node Drawer with Confirmation Gate

  • Flow Stages (Build, Publish, Archive): Develop and test edits safely in Build mode, switch to Publish when ready for live visitors, or Archive a flow to disable its triggers without deleting your work. Any edit to a published flow automatically moves it back to Build mode so live visitors never see half-finished changes until you click Publish again.
  • Assign to Bots & Shared Flow Safeguards: Click Assign to Bots in the flow header—or open Flow Access Matrix in the top-right bar—to choose which chatbots can run each flow. If a flow is shared across more than one bot, Zervice displays a Shared Flow banner and lets you Apply changes to all assigned bots or Save as a new copy for selected bots.
  • Pan, Zoom & Draggable Toolboxes: Drag the background to pan across your flow tree, and zoom in or out using the mouse wheel or Flow Navigator minimap (Fit, 100%, and Fullscreen). You can drag both the Flow Navigator and the Flow Toolbar to any of the four canvas corners.
  • Live Validation Pill: The toolbar shows a live Valid badge (or an Issues counter you can hover or click to cycle directly to any node with a missing field or connection warning).
  • Folding Branches & Zipping Linear Steps: Click the - / +N pill on the right edge of any branching node to collapse or expand its subtree, or click the « button on the left edge of a 1-to-1 step to zip sequential steps into a compact stacked card (+N steps).
  • Node Drawer & Two-Mode Delete: Double-click any node (or open its ... menu) to configure its settings (Cmd/Ctrl + Enter saves, Esc closes). Pressing Delete / Backspace (or clicking Delete Node...) lets you choose between Current node only (which keeps child branches attached to the parent) or All branch (which deletes the entire downstream subtree).
  • Keyboard Shortcuts: Use Ctrl/Cmd + Z and Ctrl/Cmd + Y for Undo/Redo, Ctrl/Cmd + C to copy a branch, and Ctrl/Cmd + V to paste it under another compatible node.

Complete Guide to Every Node Type (With Examples)

Dialog Flow Studio gives you 8 focused building blocks. Knowing when to use each node—and how to configure its options—is the key to building flows that feel natural and reliable.

1. Flow Start (START)

Every Dialog Flow begins with a single Flow Start root node (▶ START {).

  • Use it for: Naming the flow, writing a clear Description (also used by AI intent routing when visitors describe what they want in their own words), and defining the trigger phrases that launch the flow.
  • Whole-Flow } Epilogue Message (Optional): Configure a shared closing message (for example, "Thanks for chatting, {user_name | 'friend'}! Let us know if you need anything else.") that automatically runs whenever any branch finishes naturally.
  • Declared Flow Variables: Document the expected Saved Fields for your flow (such as work_email or plan) along with their types (string, number, boolean, object) and default values.
  • Inserting a New First Step: Open the ... menu on the START node at any time to Insert New First Step (Bot Reply, AI Agent, Condition Rule, or API Webhook) right at the opening { bracket.
  • Avoid: Adding overly broad single-word triggers (like "help" or "info") that hijack unrelated Knowledge Base questions.

2. Bot Reply (BOT)

Sends a strictly deterministic message from your assistant. Zervice always delivers the exact wording you write (with {field_name} placeholders filled in) and never rewrites it unexpectedly.

  • Use it for: Greetings, structured menus, exact compliance or pricing copy, form prompts, and confirmation summaries.
  • Template Placeholders & Fallbacks: Supports {field_name}, {{field_name}}, nested dot paths like {api_result.data.id}, fallback defaults like {first_name | 'there'}, and reusable bot variables ({{bot.name}}, {{bot.greeting}}) so shared flows adapt automatically to each bot.
  • ✨ Suggest AI Variations: Click ✨ Suggest AI Variations in the Bot Reply drawer to generate 3 phrasing options based on your draft message and child intent branches, then click Use to apply one.
  • Quick-Reply Buttons are 100% controlled here: Add the exact clickable chips you want visitors to see under Quick Reply Suggestions. Zervice does not auto-generate extra chips from downstream User nodes, so you have complete control over every button label.
  • Two Outgoing Modes: A BOT node can either wait for visitor input across one or more USER branches (Mode A), or auto-chain immediately in the same turn into a single next step such as another BOT, AGENT, CONDITION, WEBHOOK, GOTO, or END node (Mode B).

3. User Input (USER)

Listens for what the visitor says or clicks next, matches their intent, and optionally saves their answer into a Saved Field.

  • Natural Language Intention & Custom Title: Describe what the visitor means in plain English under User Intention (for example, "Visitor wants to know what deployment options are supported, including Hosted Cloud or BYOC"). Zervice automatically generates a short 2–4 word AI Title for the canvas card, or you can enter an optional Custom Title override.
  • Quick Responses (Fast-Path Chips): Add up to 5 exact chip phrases that match this branch instantaneously without an AI routing call.
  • Capture to Slot Variable (Saved Field): Save the visitor's reply into a named field (such as work_email or team_size) with validation for Text, Email, or Number:
    • When a USER step captures an Email or Number field, Zervice automatically validates the input format and politely re-prompts if the visitor types an invalid value (unless you wire a downstream CONDITION node to handle validation yourself).
    • Check Auto-skip prompt if slot is already populated in session so the flow skips asking whenever the field was already provided earlier in the chat or pre-filled from the visitor's opening message.
    • Every matched USER step also updates last_user_input (and opportunistically captures user_email whenever an email address is detected).
  • Set Variables on Match: Optionally assign fixed or interpolated Saved Field values (such as department = sales or tier = enterprise) as soon as the visitor selects this branch.
  • Important rule: Never chain USER → USER directly. Every USER node must connect to a single response (BOT or AGENT), logic (CONDITION), or action (WEBHOOK, GOTO, END) step.

4. AI Agent (AGENT)

Runs an open AI specialist inside your flow, combining your bot's persona, the node's scoped instructions, recent conversation history, and relevant facts from your Knowledge Base.

  • Use it for: Answering open-ended or multi-turn visitor questions within a guided topic (such as "Can you support BYOC?", "How does BYOC work?", and follow-ups like "At what condition should I choose BYOC?"), or summarizing collected Saved Fields into a tailored recommendation.
  • Stays Active Until Complete: When a visitor enters an AGENT step, Zervice keeps the session pinned on that specialist so follow-up questions carry full conversation context without re-evaluating from START.
  • Natural Transition or Flow Exit: Once the visitor gives a completion signal (such as "Got it, thanks!") or switches topics:
    • If the AGENT node has a following step (such as a BOT prompt, CONDITION, WEBHOOK, or child USER branches), the flow advances to that following step.
    • If the AGENT node is the last node in its branch (a leaf node or followed only by END), Zervice automatically quits the flow and delegates the visitor's message to any interrupted caller flow on the stack—or back to Default Consulting Mode so the main assistant can respond with the full picture.
  • Knowledge Base Context Selector: Choose Use Bot's Assigned Knowledge Collections (Default) for doc-grounded answers, or switch to No Knowledge Base Retrieval (Prompt Only) for pure reasoning or formatting steps.
  • Reusable Across Bots: Use {{bot.name}} and {field_name} inside the System Prompt so one shared flow works across multiple bots.
  • Example:
    • Agent Role Name: Deployment Specialist
    • System Prompt: Answer the visitor's question about {{bot.name}}'s deployment options, Hosted Cloud, and BYOC using the Knowledge Base. Keep the answer clear and concise, then invite them to ask a follow-up or schedule a walkthrough.

5. Condition (CONDITION)

Evaluates deterministic rules against your Saved Fields and routes automatically down the first matching branch port.

  • Multi-Case Branching (TRUE, CASE 2–CASE 4, and ELSE): A single Condition node supports up to 4 ordered rule tabs (click + Else-If to add CASE 2, CASE 3, CASE 4, double-click any tab to rename it, or drag rows in the ELSE preview tab to reorder priority) plus an automatic ELSE catch-all fallback branch.
  • Compound Rules (AND / OR): Inside any case tab, click + Add Compound Rule to combine multiple checks with AND or OR.
  • Supported Operators:
    • Equals (==) and Not Equals (!=) (case-insensitive)
    • Greater (>), Greater/Eq (>=), Less (<), and Less/Eq (<=)
    • Contains and Not Contains
    • Is Set (exists) and Is Empty
    • Regex Match
  • Dot-Path Support: Evaluate top-level Saved Fields (team_size >= 25) or nested webhook data (api_result.data.plan == "enterprise").
  • Avoid: Routing a CONDITION branch directly into a USER node without speaking first—always follow each branch port with a BOT, AGENT, CONDITION, WEBHOOK, GOTO, or END step.

6. External Action (WEBHOOK) & Confirmation Gates

Calls an external HTTP endpoint (POST, GET, PUT, DELETE) and saves the response for downstream steps. Every External Action routes down explicit SUCCESS (HTTP 2xx) and ERROR (timeout, HTTP error, or cancelled confirmation) branch ports.

  • Output Variable & Dot-Path Response Extraction: Store the full JSON response into an Output Variable (such as api_result), and use Dot-Path Response Extraction to map specific nested fields (like data.items.0.id → order_id) directly into top-level Saved Fields.
  • Request Timeout & Payload Template: Configure a Request Timeout (500–25000 ms, default 8000 ms) and a JSON Request Payload Template supporting {user_query} and any {field_name} placeholder.
  • Guarded Action & AI Confirmation Gate:
    • Automatic Actions (Confirmation Gate OFF): Best for safe read-only lookups, such as checking available appointment slots or looking up an order status.
    • Guarded Actions (Confirmation Gate ON): Enable for write or sensitive actions—such as creating a lead, booking a meeting, or modifying an account. Choose Standard Action (Yes, Proceed / Cancel) or ⚠️ High Risk / Destructive (Yes, Proceed with Caution / Cancel) and customize the confirmation prompt with {field_name} values. If a visitor declines, Zervice cancels the call safely and routes to your ERROR branch if one is connected.

7. Jump (GOTO) & Reusable Subroutines

Jumps cleanly to another step in the same flow—or transitions to a different Dialog Flow—without duplicating branches on your canvas.

  • Same-Flow Jump: Select any Bot Reply, AI Agent, Condition, or Webhook step in the current flow from the searchable dropdown (click the ↳ icon on any Goto card to pan the canvas straight to its target node).
  • Cross-Flow Jump & Subroutine Calls: Enter a Target Flow ID (which must be assigned to the same bot) to hand off to another Dialog Flow:
    • One-Way Jump (Subroutine OFF): Transfers the conversation directly to the target flow's entry step.
    • Call as Subroutine (Subroutine ON): Pushes the current flow onto the session's call stack, runs the target flow until it finishes or hits an END node, and immediately resumes the current flow at your chosen Return Continuation Node in the same turn.
  • Important rule: Always point a GOTO node to a speaking or logic step (BOT, AGENT, CONDITION, or WEBHOOK)—never directly to a silent USER node, or to an ancestor with no USER turn boundary in between (which would create an infinite loop).

8. End (END)

Explicitly concludes a Dialog Flow (or returns from a called subroutine flow) with a clear exit status:

  • Exit / Return Status: Choose completed, cancelled, or failed, and add an optional Label / Note (such as "Resolved Inquiry").
  • How It Works: For a top-level flow, END closes the active workflow and returns the conversation cleanly to Default Consulting Mode. When inside a flow that was called as a Subroutine, END returns control immediately to the parent flow's Return Continuation Node so downstream Condition rules can inspect the exit status.

Connection Rules at a Glance

Dialog Flow Studio automatically filters the + Add Child Branch menu and Branch Placeholder cards (Add Step) so every workflow stays valid:

Parent StepAllowed Next StepsBranching Rule
STARTBOT, AGENT, CONDITION, WEBHOOKSingle entry step (1 child).
BOT / AGENTWait Mode: 1..N USER branches<br>Auto-Chain Mode: 0..1 non-USER stepCannot mix USER branches and auto-chain steps under the same parent.
USERBOT, AGENT, CONDITION, WEBHOOK, GOTO, ENDExactly 1 next step (never USER → USER).
CONDITIONBOT, AGENT, CONDITION, WEBHOOK, GOTO, ENDNamed branch ports: TRUE, optional CASE 2–CASE 4, and ELSE.
WEBHOOKBOT, AGENT, CONDITION, WEBHOOK, GOTO, ENDNamed branch ports: SUCCESS and ERROR (0..2 children).
GOTO / ENDNone (Terminal steps)Terminal leaf steps cannot have child branches.

Three Proven Flow Patterns (Blueprints)

Use these three battle-tested structures as templates when designing your own Dialog Flows.

Pattern 1: Guided Menu + AI Specialist Hybrid (Handling Open Questions)

Suppose your flow has a Deploy branch where visitors might click Deployment Options or type open-ended questions like "What deployment do you support?", "Can you support BYOC?", or "Can you explain how BYOC works?"

If you wire Ask Deployment to a static BOT node, it can only give one fixed paragraph. Instead, pair a BOT entry menu with an AGENT specialist backed by your Knowledge Base:

START (Product Tour)
 └─ BOT: "Hi! What would you like to explore?" [Deployment Options] [Architecture] [Pricing]
     ├─ USER (Ask Deployment: "Visitor asks about deployment options, Hosted Cloud, or BYOC")
     │   └─ AGENT (Deployment Specialist — answers exact question from Knowledge Base)
     │       └─ END (completed)
     ├─ USER (Ask Architecture)
     │   └─ AGENT (Architecture Specialist)
     │       └─ END (completed)
     └─ USER (Ask Pricing)
         └─ BOT: "We offer Zervice Cloud, Dedicated Hosting, and BYOC..." [Compare Plans] [Talk to Sales]

Why this works: Clicking Deployment Options gives a clear overview, while asking "Can you explain how BYOC works?" deep-enters straight into the branch and gets a tailored, doc-grounded answer.

Pattern 2: Lead Qualification With Multi-Case Condition & Confirmation Gate

Use deterministic BOT, USER, CONDITION, and guarded WEBHOOK nodes whenever exact steps and verified data matter:

START (Book a Demo)
 └─ BOT: "I'd love to set up a walkthrough. What is your work email?"
     └─ USER (Capture work_email, type: email, Auto-skip if known: ON)
         └─ BOT: "Thanks! Roughly how many people are on your team?" [1-10] [11-25] [25+]
             └─ USER (Capture team_size)
                 └─ CONDITION (Case 1 TRUE: team_size contains "25")
                     ├─ TRUE  → WEBHOOK (Create Enterprise Lead · Confirmation Gate: ON)
                     │           ├─ SUCCESS → BOT ("You're all set! Our team will reach out to {work_email}.") → END
                     │           └─ ERROR   → BOT ("No problem—email us anytime at [email protected].") → END
                     └─ ELSE  → BOT ("You can start right away with our self-serve quickstart...") → END

Pattern 3: Returning to a Menu or Retrying Input With GOTO

Whenever a branch should loop back—such as returning to a main menu or re-prompting for a custom validation check—use GOTO pointing to the BOT prompt node:

BOT (Prompt Email: "Please enter your work email:")
 └─ USER (Capture work_email, type: email)
     └─ CONDITION (work_email not_contains "@gmail.com")
         ├─ TRUE → BOT ("Got it, we'll send your invite to {work_email}.") → END
         └─ ELSE → BOT ("Please enter a company work email address.") → GOTO (Prompt Email)

Best Practices for Creating Better Flows

  1. One flow per goal: Build small, focused flows (Guided Tour, Book a Demo, Support Escalation) rather than one giant flow that tries to handle your entire website. Use GOTO (with Call as Subroutine if needed) to connect modular flows.
  2. Do not duplicate your Knowledge Base in BOT nodes: Keep detailed product documentation in Knowledge Base collections and let Default Consulting Mode or AGENT nodes pull from it.
  3. Keep BOT replies short and scannable: Use 1–3 concise sentences and 2–4 clear Quick-Reply buttons to guide the next tap.
  4. Write descriptive USER intentions & flow descriptions: Describe what the visitor means in plain English (for example, "Visitor wants to know if self-hosted BYOC is supported and how it works") so both in-flow routing and smart deep-entry match accurately.
  5. Always wire an ERROR path on External Actions: If an external API times out or a visitor cancels a Confirmation Gate, give them a helpful fallback message instead of a dead end.

Testing Safely With the Flow Test Runner

Before publishing a workflow to live visitors, click Test Flow in the toolbar to open the built-in Flow Test Runner:

  1. Works on Build & Unassigned Flows: You can test any flow while it is still in Build mode—even before assigning it to a bot or publishing it live.
  2. Select an Assistant Context: The Test Runner starts by asking which chatbot to simulate with. Picking a bot loads that bot's Knowledge Base, persona, and settings so AGENT nodes and off-topic Knowledge Base answers behave just like production.
  3. Isolated Test Mode: Every message sent in the Flow Test Runner runs in Test Mode, so it never pollutes your live conversation logs, usage analytics, or external lead records.
  4. Runtime State Inspector & Slot Injection: Open the Inspector panel inside the Test Runner to watch the live Execution Trace (active flow, checkpoint node, call stack depth, confirmation gate status, webhook HTTP code, and end status), inspect captured Session Slots, and Inject / Override Variables (like team_size or work_email) for the next turn to test any branch immediately.