Lead qualification
Leads arrive from two places: a website agent that chats with visitors, and your own web forms. Score each lead the same way, record it in your CRM, give hot leads to a salesperson within the hour, and send warm leads a follow-up two days later.
Canvas
Section titled “Canvas”-
Two triggers with the same input fields:
name,phone(phone),email(email),company,teamSize(number),budget(number),timeline(choice:now,quarter,later),source.- Started by an agent: agents that may start it: your website agent. The agent: Immediately, because hot leads wait for a person.
- API / webhook: for web forms. Duplicate key
email.
-
Compute: formula
min(input.teamSize, 500) / 5 + min(input.budget, 1000000) / 20000, store asscore, decimal places 0. More results:total = score + (30 if input.timeline == "now" else (10 if input.timeline == "quarter" else 0)). -
Decision (rules): outcomes
hot,warm,cold. Rules:total >= 120→hottotal >= 50→warm- default →
cold
Test cases: a sample with
total150 expectshot; a sample withtotal10 expectscold. -
MCP tool (all three outcomes lead here, each through a Data mapper that sets
ratingto"hot","warm"or"cold"): your CRM, toolupsert_lead, inputs frominput.*plusscore = total,rating = rating. Store result ascrm. Retries 3. -
Write context: scope customer, whose context
input.email, valuesleadRating = rating,crmLeadId = crm.leadId. -
Condition:
rating == "hot".true: go to step 7.false: go to step 9.
-
Human task: role
Sales, instructionsCall {{ input.name }} at {{ input.company }} ({{ input.phone }}). Score {{ total }}., SLA 1h, priority high, outcomesqualified,not_interested,no_answer. -
Three End steps, one per task outcome, with outcomes
qualified,not_interestedandno_answer, and outputleadId = crm.leadId. -
Condition:
rating == "warm".
Error paths: connect the CRM step’s On error port to an Error handler that escalates to Sales operations and continues. Connect the Human task’s On error port (SLA passed) to an Escalation for Sales managers.
Trigger payload
Section titled “Trigger payload”From a web form, through the API:
{ "input": { "name": "Meera Iyer", "phone": "+919800000000", "email": "meera@example.com", "company": "Example Logistics", "teamSize": 120, "budget": 600000, "timeline": "now", "source": "pricing-page" }}From the website agent, the same fields are the tool’s arguments. The agent fills them from the conversation and asks for any required field it is missing.
What each step does
Section titled “What each step does”- Two triggers feed the same steps, so every lead is scored the same way, whoever captured it.
- Compute turns the answers into a number. The Decision turns the number into a rating, and its test cases stop a careless rule change from being published.
- The MCP tool creates or updates the lead in your CRM.
- Write context remembers the rating, so later runs for the same email can read it with Read context.
- The Human task gives a salesperson one hour, with three clear outcomes. The run ends with the one they choose, so analytics show how hot leads convert.
- The agent trigger responds Immediately: the website agent gets the run id at once and tells the visitor the team will be in touch.
Test it
Section titled “Test it”- In Test workflow, start from the API trigger with the payload above and Minutes as seconds. Point the MCP tools at sandbox servers.
- The lead rates
hotand a Human task appears under Waiting on you. Choosequalified. - Try a lead with
teamSize: 10,budget: 50000,timeline: "quarter". It rateswarmand the follow-up runs after the wait. - To test the website agent too, add the workflow and the agent to a use case and use Test use case.
Variations
Section titled “Variations”- Tell the visitor their rating: move the scoring into a separate workflow whose agent trigger responds On completion and ends straight after the Decision, then start this workflow from it as a Sub-workflow with Wait for it off.
- Several products: replace the Condition with a Decision whose outcomes are product teams, each with its own Human task role.
- Ask a model to summarise (beta): add a Task agent that writes a short brief for the salesperson. Test it end to end in the test window first.