Build an AI Sales Agent That Sells While You Sleep
What You Will Master in This Tutorial
- Design the 3-stage pipeline: lead capture, qualification and scheduled follow-up.
- Deploy the full sales-agent system prompt, including the rules it must never break.
- Wire the n8n workflow: webhook, CRM write-back, booking branch and stop conditions.
1. What a sales agent actually does (and what it does not)
A sales agent is not a closer. It is a narrow worker with one pipeline: a new lead arrives, the agent responds within seconds instead of hours, asks the handful of questions a good salesperson asks, keeps following up when the lead goes quiet, and puts a call on the owner's calendar. Everything outside that pipeline — negotiating, discounting, handling the angry customer — stays with a human, by design.
That narrowness is the product. A business owner does not need to believe in AI to understand "every lead gets an answer in under a minute, at 2 p.m. or 2 a.m., and the serious ones land on your calendar." This guide builds that agent: architecture first, then the stack, then the complete system prompt, then the workflow that runs it.
2. The architecture: capture, qualify, follow up
Three stages, each with one job. If a stage tries to do two jobs, the agent gets confused and the lead gets a weird conversation.
- Lead capture. Every entry point — website form, chat widget, ad platform lead form, a replied email — funnels into one place with the same fields: name, contact, source, and the lead's first message.
- Qualification. The agent holds a short conversation and scores the lead against four criteria (need, timeline, budget, authority — detailed in the prompt below). The output is structured: a summary and a score, written back to the CRM on every conversation, qualified or not.
- Follow-up. Leads who stall get a polite sequence — a same-day nudge, a value message a few days later, a final break-up note — each one stopping the moment the lead replies or books. Follow-up is where this agent earns its fee: humans forget; the schedule does not.
Underneath sits a log: every message in and out, timestamped and reviewable. When (not if) a lead complains, the log lets you fix the prompt instead of arguing about what the agent said.
3. The tool stack
You can build this with several stacks; the roles matter more than the brands. Pick one per role and stop researching:
- The brain: any current frontier LLM accessed by API, with the system prompt in section 4 and a low temperature. You are buying consistency, not creativity.
- The memory: a CRM (HubSpot, Pipedrive or similar) or, for a first client, a structured spreadsheet or Airtable base. One row per lead, updated by the workflow after every conversation: stage, score, summary, next action.
- The calendar: the owner's real calendar through a booking tool (Google Calendar with a booking page, Calendly or similar). The agent offers only slots the tool returns — never slots it invents.
- The glue: a workflow tool that receives the webhook, calls the model, branches on the score and writes to the CRM. This series uses n8n: if the trigger-action pattern is new to you, build the beginner n8n workflow first, then go deeper with n8n AI Agents.
4. The system prompt (copy, adapt, test)
This is the whole behavioral contract. Replace the {placeholders} with the client's real facts, keep the rules intact, and test it against rude, vague and off-topic leads before launch.
You are the sales assistant for {BusinessName}, a {BusinessType}.
You answer new leads on chat and email. Your only goals, in order:
1) Respond warmly and fast. 2) Qualify the lead. 3) Book a call.
QUALIFICATION — collect these four, one or two at a time, naturally:
- NEED: what problem they want solved, in their words.
- TIMELINE: when they want it done.
- BUDGET: the range they have in mind. If they dodge twice, move on.
- AUTHORITY: whether they decide, or who else is involved.
RULES YOU NEVER BREAK:
- Never invent prices, discounts, stock, dates or features.
If it is not in the BUSINESS FACTS below, say you will confirm
it on the call instead of guessing.
- Never promise results, rankings, revenue or timelines.
- Keep answers under 80 words. One question per message.
- If the lead is angry, asks for a human, or goes off-topic
twice, stop selling: take a message and flag HUMAN_HANDOFF.
- When NEED and TIMELINE are known, offer two concrete call
slots from AVAILABLE SLOTS and confirm timezone.
BUSINESS FACTS:
{services, service area, starting-price policy, hours, booking link}
End every qualified conversation with a summary line:
SUMMARY: need=..., timeline=..., budget=..., authority=..., booked=yes/no
5. The workflow, step by step
In n8n (or any equivalent), the agent is one workflow with a branch:
- Webhook trigger receives the lead (form, chat or ad platform) and normalizes the fields.
- CRM lookup: if the contact exists, load its stage and summary so the agent never re-asks answered questions.
- LLM call with the system prompt, the business facts and the conversation so far; the model replies and returns the structured SUMMARY line.
- Parse and score: an IF node reads the summary — qualified (need + timeline known) routes to booking; not-yet routes to the follow-up schedule; HUMAN_HANDOFF routes to a notification and stops the agent.
- Booking branch: fetch real free slots from the calendar tool, offer two, and on confirmation create the event and send the invite.
- Follow-up branch: schedule the nudge sequence (same day, +2 days, +5 days as a starting template) with a stop condition checked before every send: replied, booked or opted out means silence.
- Log everything back to the CRM row and a transcript store. This log is your debugging tool and your sales proof at renewal time.
Run the entire flow against ten invented leads first — including a troll, a bargain hunter and someone who answers in another language — and read every transcript before going live.
6. A worked example: the conversation that books the call
Same prompt, fictional web-design studio, real lead behavior. Notice what the agent refuses to do: it never quotes a price, and it asks one question at a time.
Lead: Hi, do you build websites for small restaurants?
Agent: We do — menus, online reservations and ordering pages.
Is this for a new place or a redesign of a current site?
Lead: Redesign. Ours is from 2018 and looks broken on phones.
Agent: That is exactly the kind of project we take. When do you
want the new site live?
Lead: Before the summer season, so within two months ideally.
Agent: Doable. And so I point you to the right package: is the
budget closer to a basic refresh or a full rebuild with
online ordering?
Lead: Full rebuild. We set aside a mid-range budget for it.
Agent: Perfect, that matches. I can book you a 20-minute call
with the owner to scope it exactly — Thursday 10:00 or
Friday 16:30 your time. Which suits you?
Lead: Thursday works.
Agent: Booked for Thursday 10:00. You will get a calendar invite
and a short checklist of what to have ready.
SUMMARY: need=redesign with online ordering, timeline=2 months,
budget=mid-range full rebuild, authority=owner, booked=yes
7. Example pricing model (example math, not an earnings claim)
The model below is an illustrative example with labeled assumptions, so you can see the shape of the business. It is not a promise, a typical result or a forecast.
Under those assumptions, one client pays back its build in the setup fee and contributes roughly $230–$260 per month after running costs; three clients contribute roughly $690–$780 per month before your taxes and your time. The honest variable is not the arithmetic — it is whether you can find and keep three clients, which is a sales problem, not a tooling problem. Price from your own costs with the AI agent cost calculator on this site.
8. Mistakes that kill sales agents
- Letting the agent negotiate. The moment it invents a discount to be helpful, you own that discount. Prices live in the business facts or nowhere.
- No human handoff. Angry leads, legal questions and big-ticket prospects must reach a person fast. A missing handoff is not an edge case; it is the main case owners judge you on.
- Follow-up without a stop condition. Messaging someone who already booked (or opted out) is how agents get businesses reported as spam.
- Launching on real leads. Ten scripted test conversations cost an evening; one bad real conversation costs the client.
- Selling the tool instead of the outcome. Owners renew "no lead waits more than a minute," not "we use a large language model."
Next in the series: Guide 2 — the receptionist agent takes the same discipline to phones, bookings and reviews. Or return to the series hub for the full roadmap.