FlowsBook a callSign inCreate free accountSign up
AI employees and automation

AI routing of leads to teams: each enquiry down its own named output

How the AI router reads each incoming lead, picks which of your teams should have it, says why, and sends anything that fits nowhere to a place you choose.

Part of the guide AI employees

By the xMap team · · 4 min read

AI routing of leads to teams means each new enquiry is read once, judged against the teams you have, and handed to the right one with a short reason, instead of waiting in a shared inbox for someone to forward it. In xMap Flows the AI router does this: you name between two and six outputs such as Homes, Businesses and Partners, describe what belongs in each, and every lead leaves by one of them. Whatever fits none goes out of None of these.

This is for sales operations, marketing and customer teams who receive leads from forms, sheets, chats or lists their AI employees build, and spend time sorting them by hand. It covers how the router decides, a worked example, how to combine it with rules, and the usual mistakes.

How the router decides

The AI router reads the fields you tell it to read (or the short text fields when you leave that empty), compares them with the description of each output, and picks one. Each lead gets two new fields: route, the output it went down, and route_reason, a few words on why, such as asks for a quote for a 40-room hotel roof. xMap AI can only answer with one of your outputs or None of these, so nothing goes astray.

Each output is its own dot under the block. Link each dot to what should happen next: an email to that team, a row in their sheet, a message in their channel, or another AI step. An output nobody links is only counted.

A worked example (made up)

Take a solar installer in Cape Town with three teams: residential sales, commercial projects, and a partner desk that handles electricians and property developers who want to resell. Enquiries arrive through a form on its website, and for months one coordinator sorted them each morning.

  1. Form page: name, email, phone, a choice of property type, the address and a box for the message.
  2. AI router with three outputs: Residential: a homeowner or tenant asking about panels or batteries for one home; Commercial: a business, farm, school or building owner with a larger site; Partner: an installer, electrician or developer who wants to work with us.
  3. From Residential: an Email to the residential team, one per lead.
  4. From Commercial: xMap LLM writes a two-line summary of the site and the likely size, then an email to the projects lead.
  5. From Partner: a row in the partner desk's sheet in Google Sheets.
  6. From None of these: an email to the coordinator, who now sees only the odd ones out.

A message such as We run a wine estate near Stellenbosch with cold rooms and want to cut our power bill goes to Commercial with the reason a farm with cold rooms, larger site. I'm an electrician in Durbanville, do you take on subcontractors? goes to Partner. A request for a job goes to None of these, and the coordinator answers it.

Rules first, AI where words matter

Not every split needs AI. If a field already decides it, a Branch or a Filter is free and exact: a property type of Business always goes to Commercial. Put rules first for what is clear-cut, and the router after them for what lives in free text. Two more blocks often sit around it:

  • Split by territory after an output shares that team's leads between its reps by area, so the Commercial team's reps each get their own part of the city.
  • Only new before the router, when leads come from a list that is read again each day, so the same lead is not routed twice.

Mistakes to avoid

  • Outputs that overlap. If Commercial and Partner could both describe a developer, the router will hesitate between them. Say in each description what does not belong there.
  • Too many outputs. Six is the most, and three or four is easier to keep sharp. A team that receives two leads a month can share an output with another.
  • Ignoring None of these. Link it. The leads that fit nowhere are often the interesting ones, and unlinked they are only counted.
  • Judging it on a test run. A test run sorts a preview by the words in each item. Live runs ask xMap AI, so try a few real leads before you rely on it.

What each team sees

Each team receives only its own leads, each with the reason the router gave, which helps a rep open the conversation. The whole flow's history is on the Results page, where you can filter by route to see how many leads each team got this month, and the AI employee's Team inbox thread notes anything that needs a person. The router is paid per lead xMap AI reads.

The new businesses routed by size template routes leads an AI employee found, key accounts to Slack and the rest to a sheet, and score new leads from a sheet fits leads that land in a sheet first. The wider routine of finding and qualifying leads is in the sales prospecting guide, and the energy and EV page has more ideas for installers.

Questions

How many teams can it route to?

Between two and six outputs you name, plus None of these, which is always there for items that fit no output.

Does it explain its choice?

Yes. Each item gets route_reason, a few words on why it went that way, which you can put in the email to the team.

Can it route leads that are not from a form?

Yes. It works on any items that reach it: rows from a sheet, messages from a chat or WhatsApp, or places and companies an AI employee found.

What happens when I remove an output?

Its link is removed too, and the remaining outputs keep their order, so the dots under the block follow the lines you wrote.

Templates that do this

Read next

More on ai employees and automation · Every article · Templates

Put it to work

An AI employee in xMap Flows does this on live data, on its own timetable. Start from a template or describe it in plain words.