How a RevOps team enriches and routes leads with Windmill
Good leads can wait days before a rep contacts them.
They come in from the website, events and CSV imports, and RevOps often has to clean each one, look up the company and pick a rep by hand, in a spreadsheet. Here, one Windmill tool does it every hour, and shows how fast reps follow up.
The tool
This example is an internal tool for a RevOps team and its sales reps, built in one Windmill workspace from four pieces: a data pipeline, an AI agent, a flow and an app. The data: leads (source, company, role, country), CRM accounts, routing rules (territory, segment), and reps with their current load.
Each piece below comes with the prompt to build it in your own workspace. The whole project is on the Windmill Hub, with a recorded run of each piece, ready to add to your workspace: RevOps lead routing on the Hub.
A data pipeline imports and cleans the leads
Every hour, a schedule runs the pipeline. It imports the new leads from the website form, CSV imports and events, merges duplicates and normalizes each lead (source, company, role, country) before anything else touches it.
Read more: Data pipelines.
In the folder f/revops, build a data pipeline that runs every hour. A first script imports the new leads from the website form, the CSV imports and the event lists into a leads table (source, email, company, role, country). A second step merges duplicates by email and company domain and normalizes source, company, role and country.
An AI agent scores each lead and explains why
An AI agent step researches the company, summarizes what it does and scores the lead against the ideal customer profile. It looks things up with tools, which are Windmill scripts, and returns the score with a one-line explanation that the rep and RevOps can read.
Read more: AI agents.
Add an AI agent step that takes one lead, researches its company with two script tools (company research, and a lookup of the account in our CRM), scores the lead against our ideal customer profile and returns JSON: summary, score ("above threshold" or "below threshold") and reason, in one line.
A flow routes the lead and follows up
A flow assigns each qualified lead according to territory and current load, creates it in the CRM and notifies the rep. Branches apply the routing rules.
A schedule sends a reminder when a lead is not picked up within 24 hours, then reassigns it.
Read more: Flows.
Create a flow lead_routing that runs for each new lead: it calls the scoring agent, and when the score is above the threshold, a branch picks the rep by territory and current load, a step creates the lead in the CRM through a resource, and a last step notifies the rep. Add a schedule that every hour finds the leads not picked up within 24 hours, reminds their rep, then reassigns them.
An app shows how fast reps pick leads up
A full-code app lists today's leads with their score and its explanation, who owns each one, and the time to first touch per rep.
Read more: Full-code apps.
Build a full-code app that lists today's leads with company, score, reason, owner and first touch, and shows the average time to first touch per rep.
A day with the tool
- 85 new leads come in during the day, and 12 duplicates are merged.
- The agent scores each lead: 9 are above the threshold, each with an explanation.
- The flow assigns them and notifies the reps.
- One lead is not picked up within 24 hours: a reminder, then reassignment.
- RevOps follows the average time to first touch per rep in the app.