How to build AI sales agents with n8n (step by step)

An n8n sales agent that updates your CRM, handles objections and books meetings.

playbook
Last updated Oct 28, 2026

This article was originally posted on YouTube

We've built over 20 AI sales agents on n8n in the past six months, and seen anywhere from 30% to 300% more lead conversions in the businesses where we set them up. Here is how to build your own, step by step, with no coding. The agent can update your CRM, nurture leads, follow your script, handle objections and book meetings in your calendar.

Step 0: set up n8n

  • Local: host it on your own machine. Fine if you just want to play around.

  • Self-hosted: for real use in your business or a client's, host it somewhere like DigitalOcean (what we use) or Render. Both are cheap. You get unlimited workflows and executions.

  • n8n Cloud: no hassle. The Starter plan is €20 a month (about $22) with 5 active workflows, unlimited test ones and 25,000 executions. Pro is 50 a month with more.

If you're just starting out, get the Starter plan. If you'll build a lot on n8n, self-host.

Step 1: the core AI logic

  1. Click Create workflow and name it.

  2. Add a Chat trigger. It lets you test the agent by chatting with it.

  3. Add an AI Agent node and pick Tools Agent, because later we'll give it access to things like the CRM.

  4. Connect a chat model: add the OpenAI node.

  5. Create a credential. Go to platform.openai.com, sign up for API access (you pay per token), open API keys, create a new secret key, and paste it into n8n.

  6. Pick the model. GPT-4o mini is the cheapest. GPT-4o is generally the best choice for a sales agent.

  7. Add memory. Use Window Buffer Memory: it's the easiest and stores the memory inside n8n, no credentials needed. Internally we use Postgres chat memory with Supabase, but that's for another video.

  8. Set the context window length. 5 means it keeps five rounds of user and AI messages. You can go to 10, 15 or 20, but too much input can confuse the AI. Start with 5 or 10.

Save, open the chat and say hi. You'll see it pull memory, call OpenAI, save the output and reply.

Step 2: write the sales prompt

In the AI Agent, click Add option, then System message. By default it says "You are a helpful assistant." The format we've tested, and that works very well:

  1. Context: who the agent is, which business it works for, which platform it talks to users on.

  2. Style: how to speak, which emojis to use and so on.

  3. Instructions: how to run the conversation, plus the script to follow.

  4. Objection handling: the objections and how to handle each one.

  5. Tools: explain each tool and how and when to use it. For example: when the user gives their phone number, use the Google Sheets tool to save it.

  6. Extra requirements, if you have any.

My quick example: "You are Michael, an appointment setter for OmniFusion. You're speaking to leads via SMS. The lead just filled out a form on the website, which prompted you to reach out." Then a basic script to learn about their business and find their pain points.

A tip: don't give an exact script. The AI gets stuck on that exact wording. Instead, say something like "Ask the user what their business is" and add a few example phrases.

Save, reset the chat and test it. Throw an objection at it and check it handles it the way you wrote.

Step 3: build the workflow around it

Replace the chat trigger with a real one: a webhook, a cron job or an app event. For example, when a new conversation is created in HubSpot, trigger the AI agent, then send the reply back in HubSpot or update the lead's info.

You can add more steps: save the answer somewhere, or send the suggested reply to a human first. It works a lot like Zapier or Make.

Step 4: store the data

Give the agent a tool to store conversation data in Google Sheets or your CRM. With Google Sheets:

  1. Add a Google Sheets tool and connect credentials (the docs explain how).

  2. Set it to add a new row in the sheet you pick.

  3. In the agent's prompt, tell it when to use it. For example: "When the user sends you their phone number, use the Google Sheets tool to save it."

Google Sheets is great for beginners, but I wouldn't run a business on it. If you have a CRM, use the CRM.

Connect it to third parties

This is what really gives the agent power.

  • CRM: use a HubSpot node or a custom one to update lead status and log conversations. Same idea for Close, Salesforce, GoHighLevel and others.

  • Calendar booking: add two Google Calendar tools, one to get events and one to create an event. In the prompt: "Use the check calendar tool to see availability and suggest two open time slots. Once the user confirms one, use the create event tool to book it." The AI fills in the start and end time. Add default reminders so more people show up.

  • Sending messages through your CRM: many CRMs have their own chat that connects Instagram, Facebook, or SMS through Twilio. Use a Webhook trigger: in your CRM (say GoHighLevel), send a webhook to n8n when a user sends a message. The agent runs, then a Respond to Webhook node sends the reply back to your CRM.

  • Instagram DMs, Facebook Messenger, WhatsApp: use ManyChat with the same principle. ManyChat pings your n8n webhook URL to trigger the agent.

Test and improve

  1. Test the flow with the manual chat trigger, before you connect your CRM. Check that it handles the conversation and runs the tools correctly.

  2. Fine-tune the prompt. Throw random objections at it and try to throw it off course. When it goes off course, fix the prompt.

  3. Tweak once it's live. Monitor your hosting if you self-host, or your usage on n8n Cloud so you don't run out of executions. Read the real conversations and improve from them.

Comments

Login to leave a comment