Building Your First Workflow: A Lead Qualification Example
Building Your First Workflow
The fastest way to learn the workflow editor is to build something small and test it. In this guide we will build a lead qualification workflow: when a visitor on your pricing page asks about plans, the workflow asks a few questions, decides whether they look like a hot lead, and either books a sales demo or sends them to a self-serve article.
Step 1: Open the editor
In the main sidebar, click AI Workflows. You will see your existing workflows (if any) and two ways to start a new one:
- New Workflow opens an empty canvas.
- Install from preset drops in one of the built-in templates which you can then edit. This is a great shortcut for common patterns.
For this guide, click New Workflow.
Step 2: Configure the trigger
The canvas opens with a Trigger node already in place. Click it to open the configuration panel and:
- Set the trigger type to Conversation.
- Describe in the trigger criteria when this workflow should run, for example: "Customer is asking about pricing, plans, or buying."
- Give the workflow a name like
Lead Qualificationand a short description.
The name and description are admin-only. Customers never see them.
Step 3: Ask for the use case
Drag an Ask node onto the canvas and connect the trigger's output handle to it. Configure:
- Message: "Happy to help! Could you tell me a bit about what you are looking to do with us?"
- Variable name:
use_case
The customer's reply will be stored in use_case and available to all later nodes.
Step 4: Classify the lead
Drag a Classify node next. Configure two labels:
hot- "The visitor describes a clear, near-term business need with a budget or timeline."cold- "The visitor is browsing or has a small/personal use case with no urgency."
Classify will read use_case (and the rest of the conversation) and decide which branch to take.
Step 5: Branch on the result
From the Classify node, you now have two output handles, one per label.
On the hot branch:
- Add an Ask node: "Great! What is the best email to reach you on?" Variable:
email. - Add an Action node that calls a
Create CRM leadAI Action. Mapemailanduse_caseto the action's parameters. - Add a Handoff node so a sales agent can pick up the conversation in the inbox.
On the cold branch:
- Add an End node with a final message: "If you want to dig deeper, check out our pricing guide."
Step 6: Save and turn it on
Click Save in the editor toolbar, then toggle the workflow to Active. Inactive workflows are not evaluated, so this last step matters.
Step 7: Test in the simulator
Open the Simulator tab from the workflow editor. The simulator gives you a sandbox conversation where you can:
- Send messages as a fake customer.
- See exactly which node is currently executing.
- Inspect the variables the workflow has captured.
- Replay or reset the run.
Send "I'm looking for an enterprise plan for my 200-person team" and watch it route through the hot branch. Then reset and send "Just looking, thanks" to see the cold branch.
Step 8: Watch real runs
Once it is live, every execution is recorded as a WorkflowRun with its full event history (which node ran, what variables were captured, what the AI returned). Open any conversation that triggered the workflow and click into the run to debug.
Where to go next
- Workflow Nodes Explained is the reference for every node type.
- Proactive Workflows, Variables, and Human Handoff covers the more advanced patterns: page-targeted proactive triggers, variable interpolation in messages, and getting handoff right.
Was this article helpful?