Ravindra BagaleCourses & study guides Track your progress

Build an AI Agent in n8n Without Coding (Free, Step by Step)

Generative AI course · Chapter 42 · Estimated reading time: 12 minutes

In the previous chapter you saw that an agent is a goal, some tools and a loop. Now you will build agents yourself, without writing code. n8n (say "n-eight-n") is a workflow automation tool: you connect boxes called nodes on a canvas, like "when an email arrives" → "AI writes a summary" → "add a row to Google Sheets". It has an AI Agent node that lets a language model decide steps and use tools inside your workflow. In this chapter you will learn the free and paid ways to run n8n (checked on 23 October 2026), the 5 node types you need, and build 3 workflows step by step: an email summary that lands in a sheet, a WhatsApp enquiry reply with your approval, and a daily news digest.

What you will learn in this chapter

  • What n8n is, and the free and paid ways to run it
  • Nodes, triggers, credentials and executions, in plain words
  • The AI Agent node: chat model, memory and tools
  • Build 1: email → AI summary → Google Sheet
  • Build 2: WhatsApp enquiry → AI draft reply → your approval
  • Build 3: a daily news digest by email
  • How to test, log and keep a workflow safe

Related guide

New to the AI Agent node? Start with the guide n8n AI Agent Tutorial for Beginners: Build Your First Agent, which builds a chat agent with memory and a Calculator tool. This chapter builds 3 business workflows.

1. Suppose an office gets 40 enquiry emails a day

Suppose Bluehill Tours, a small travel agency, gets about 40 enquiry emails a day: "Goa trip for 4 in December?", "Visa help for Dubai?", "Change my booking". Every evening, Sameer copies each enquiry's name, destination, dates and budget into a sheet. It takes him an hour.

With n8n, a workflow can do it the moment each email arrives: read it, ask an AI model to pull out the details, and add one clean row to the sheet. Sameer only checks the sheet. That is our first build.

2. How to run n8n (checked 23 October 2026)

Option Cost Good for
Community Edition (self-hosted on your computer or server) Free, with unlimited workflow runs Learning, and teams who can run their own server
n8n Cloud free trial Free for 14 days, 1,000 runs, no card needed Trying n8n with nothing to install
n8n Cloud Starter €20 a month, billed yearly (higher if billed monthly); 2,500 runs a month Small teams who do not want to manage a server

Higher Cloud plans (Pro, Business) add more runs and team features; check the n8n pricing page for current details. In n8n, one execution means one full run of a workflow, however many steps it has.

Run it on your own computer (free). If you have Docker installed, this one command starts n8n:

docker volume create n8n_data
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

Then open http://localhost:5678 in your browser and create the owner account.

Expected output (yours will be similar, not the same): the terminal shows a line saying the editor is accessible at http://localhost:5678, and the browser shows a sign-up page, then an empty canvas with "Add first step".

A computer workflow only runs while that computer is on. Workflows that must run all day (like an email trigger) need a server or n8n Cloud.

3. The 5 ideas you need

  1. Trigger node: what starts the workflow. "Gmail Trigger" (new email), "Schedule Trigger" (every day at 8 am), "WhatsApp Trigger", or a chat window.
  2. Action nodes: what happens next. "Google Sheets: Append row", "Gmail: Send", "RSS Read".
  3. AI Agent node: a language model that reads the input, decides, and can call tools. It needs a Chat Model sub-node (for example OpenAI Chat Model or Google Gemini Chat Model). It can also have Memory (to remember a chat) and Tools (other apps it may use).
  4. Credentials: your logins and API keys, saved once in n8n (for Gmail, Sheets, an AI provider). Never paste keys into text fields.
  5. Executions: the history of every run, with the data that went in and out of each node. This is where you check and debug.
An n8n AI workflow: trigger, AI Agent, action Steps from top to bottom: 1 Trigger, New email, schedule or message; 2 AI Agent node, Chat model, memory, tools; 3 Structured output, Clean fields you can map; 4 Approval step, Send and wait for your click; 5 Action, Add a row, save a draft, send. 1TriggerNew email, schedule or message 2AI Agent nodeChat model, memory, tools 3Structured outputClean fields you can map 4Approval stepSend and wait for your click 5ActionAdd a row, save a draft, send

An n8n AI workflow: trigger, AI Agent with model and tools, action

Ravindra Bagale's Tip

The mistake: switching on the trigger and connecting a "Send" node on the first day. One bad prompt and the workflow replies to 40 customers with nonsense. Build in this order: trigger → AI → write to a sheet or a draft only. Run it on 10 real examples, read every output, and only then connect anything that sends, and keep a human approval step for anything a customer sees.

4. Worked example 1: email → AI summary → Google Sheet

Goal: every new enquiry email becomes one row: Name, Destination, Dates, People, Budget, Summary.

Before you start: a Google Sheet called "Enquiries" with those 6 column headers in row 1, and a Gmail label "Enquiries" (set a Gmail filter to apply it).

Steps:

  1. Create a new workflow. Add a Gmail Trigger. Connect your Google account (Credentials → sign in). Set it to check for new emails with the label "Enquiries".
  2. Click Fetch Test Event to pull in one real email, so later nodes have sample data.
  3. Add an AI Agent node after the trigger. Add a Chat Model sub-node and pick your AI provider with its saved credential.
  4. In the agent's prompt, write:
Read this travel enquiry email and reply with JSON only, using these keys:
name, destination, dates, people, budget, summary (one sentence).
If something is not mentioned, write "not given". Do not guess.

From: {{ $json.from }}
Subject: {{ $json.subject }}
Email: {{ $json.text }}

(The parts in double curly brackets are expressions: n8n fills them with data from the trigger. You can drag fields from the left panel instead of typing them. Field names can differ slightly; use the ones your test email shows.)

  1. Turn on the agent's option to require a specific output format, or add a Structured Output Parser, so the reply is clean JSON with those 6 keys.
  2. Add Google Sheets → Append row in sheet. Choose the "Enquiries" sheet and map each column to the agent's output fields.
  3. Click Execute workflow. Check the new row in the sheet.
  4. When 10 test emails look right, switch the workflow to Active (or "Publish", depending on your version).

Sample test email (dummy): "Hi, we are 4 adults planning Goa from 20 to 24 December, budget around Rs 60,000 total. Need a hotel near the beach. Thanks, Kavita."

Expected output (yours will be similar, not the same): a new row: Kavita · Goa · 20 to 24 December · 4 adults · around Rs 60,000 total · "Four adults want a beach hotel in Goa for 20 to 24 December within about Rs 60,000."

5. Worked example 2: WhatsApp enquiry → AI draft → your approval

Goal: when a customer messages your WhatsApp Business number, the AI drafts a reply from your price list, and you approve it before it is sent.

Before you start: this uses the official WhatsApp Business Cloud API from Meta. You need a Meta business account, a WhatsApp business phone number and an app set up in Meta's developer dashboard; n8n's WhatsApp credential and trigger pages walk you through it. This setup takes longer than the rest of the workflow. Under WhatsApp's rules, you can reply freely to a customer within 24 hours of their last message; after that, only approved message templates can be sent.

Steps:

  1. Add a WhatsApp Trigger node set to new messages, with your WhatsApp credential.
  2. Add an AI Agent with a Chat Model. Give it the price list as context (paste a short list into the prompt, or connect it as a tool that reads a Google Sheet):
You reply to WhatsApp enquiries for Bluehill Tours. Use ONLY this price list:
[paste dummy price list here]
Rules: under 60 words, friendly, no promises about discounts or visas,
end with "Shall I share the full itinerary?". If the question is not about
our packages, reply "Our team will call you soon."
Customer message: {{ $json.messages[0].text.body }}
  1. Add an approval step: a Gmail node with the operation Send and Wait for Response, Response Type Approval, and Type of Approval Approve and Disapprove. Send it to your own address with the customer's message and the AI draft. The workflow pauses until you click a button. (Slack and some other nodes have the same operation.)
  2. Add an If node: if approved, continue to WhatsApp Business Cloud → Send message to the customer's number. If declined, stop.
  3. Test with your own phone first.

Expected output (yours will be similar, not the same): you message "Goa package for 2 in December?" and get an email: Customer: Goa package for 2 in December? Draft: "Hi! Our 4-night Goa beach package is [price from your list] per person, with hotel and breakfast. Shall I share the full itinerary?" Approve / Decline. After you click Approve, the reply arrives on your phone.

6. Worked example 3: a daily news digest

Goal: every weekday at 8 am, you get one short email with the 5 most useful headlines in your field.

Steps:

  1. Add a Schedule Trigger: every weekday at 08:00 (check that the workflow's time zone is set to your own, for example Asia/Kolkata).
  2. Add an RSS Read node with the feed address of a news site or blog you trust. (Most news sites list their RSS feed address at the bottom of the page.)
  3. Add a Limit node to keep the newest 20 items, then an Aggregate node so all items go to the AI in one message.
  4. Add an AI Agent with a Chat Model:
From these headlines and links, pick the 5 most useful for a small travel agency owner.
For each: the headline, one plain sentence on why it matters, and the link.
Do not add facts that are not in the items.
Items: {{ JSON.stringify($json) }}
  1. Add Gmail → Send a message to your own address, with the subject "Morning digest" and the agent's output as the body.
  2. Run it once by hand, read the email, then make it active.

Expected output (yours will be similar, not the same): an email at 8 am with 5 numbered lines, each with a headline, a one-sentence reason and a link. Each run counts as one execution, so this workflow uses about 22 executions a month.

7. Keep your workflows safe and cheap

  • Smallest permissions: use a separate Gmail label; share only the one sheet the workflow needs.
  • Approval before customers: anything a customer sees goes through a "wait for response" step until you trust it.
  • Watch the executions list for errors in the first week. Set an Error Workflow (in workflow settings) that emails you when a run fails.
  • AI costs are separate: the AI provider bills for model usage on its own, unless your n8n Cloud plan includes AI credits. Short prompts and a cheaper model keep costs low.
  • Personal data: customer messages contain phone numbers and names. Do not send them to tools or sheets that more people can see than need to.

8. Worked example 4: WhatsApp lead auto-reply (draft only)

Bluehill Tours gets WhatsApp leads like "Goa 4 adults December?". Build a workflow that drafts a reply from a price sheet and waits for Sameer's click (health-check: EXPANDOCT23-N8N-WHATSAPP-LEAD-GST). Never auto-send prices you have not checked.

Steps:

  1. Trigger: WhatsApp Business Cloud (same setup as example 2) or a webhook from your lead form.
  2. AI Agent prompt:
You are Bluehill Tours' assistant. Draft a short WhatsApp reply.
Use only this price list:
- Goa 3N honeymoon pack: from Rs 18,999 per couple (sample)
- Goa family 4 adults 3N: from Rs 42,000 (sample)
If dates or people are missing, ask one clear question.
Do not invent discounts. Sign as Sameer.
Customer message: {{ $json.text }}
  1. Action: Gmail or Slack message to Sameer with the draft — or WhatsApp 'send and wait for approval' if your n8n version supports it.
  2. Only after approval, send to the customer.
  3. Log Name, Destination, Draft, Status in Google Sheet.

Expected output (yours will be similar, not the same): Sameer gets a draft like "Hi! For 4 adults in Goa ~3 nights, packages start around Rs 42,000 (sample). Share exact dates? — Sameer". He edits, then sends.

9. Worked example 5: GST / accounts reminder to Google Sheet

Suppose Bluehill's accountant needs a Friday reminder of invoices still unpaid past 15 days. n8n can read a Sheet, ask AI to write polite reminder lines, and park them for human send — not auto-email to clients on day one.

Steps:

  1. Schedule Trigger: every Friday 10:00 Asia/Kolkata.
  2. Google Sheets → Get rows from "Invoices" where Status = Due and DueDate older than 15 days.
  3. AI Agent: turn each row into a short reminder subject + body using placeholders only (no bank passwords).
  4. Append results to Sheet "ReminderDrafts".
  5. Optional: email the accountant a digest. Accountant sends the real reminders after checking GST invoices.

AI prompt sketch:

Using this invoice row JSON, write a polite payment reminder email body in 5 lines.
Mention invoice number and amount. Do not threaten. Do not invent late fees.
Row: {{ JSON.stringify($json) }}

Ravindra Bagale's Tip

Accounts workflows that auto-mail clients will one day send a wrong amount. Write drafts to a Sheet first for two weeks. Connect Send only when the drafts are boringly correct.

10. Beginner mistakes and quick fixes

Mistake What happens Quick fix
Building without test data Later nodes have no fields to map Use Fetch Test Event first
Keys pasted into prompts Keys leak in logs and exports Use Credentials only
Sending to customers on day one Wrong replies go out Draft or approval step first
Workflow not active It works when you test, never by itself Switch it to Active after testing
Wrong time zone The digest arrives at the wrong hour Set the workflow time zone
Ignoring failed runs Silent gaps in your sheet Add an Error Workflow

11. Try at home

Try at home

Task 1: install and say hello

  1. Start n8n with Docker or the Cloud trial.
  2. Add a Manual Trigger and an AI Agent with a Chat Model.
  3. Ask it for 3 names for a tea shop and read the output.

Task 2: the enquiry sheet

  1. Build example 1 with a test label.
  2. Send yourself 5 dummy enquiries.
  3. Check that every row is correct, and fix the prompt if not.

Task 3: your digest

  1. Build example 3 with one RSS feed you like.
  2. Run it by hand twice.
  3. Make it active and read tomorrow's email.

Recap

In short

  1. n8n connects nodes into workflows: a trigger, actions, and AI steps.
  2. The Community Edition is free to self-host; n8n Cloud has a 14-day free trial, and Starter costs €20 a month billed yearly (checked 23 October 2026).
  3. The AI Agent node needs a Chat Model and can use Memory and Tools.
  4. Save logins in Credentials, never in prompts.
  5. Build in order: trigger → AI → sheet or draft, test on real samples, then add sending.
  6. Use the "Send and Wait for Response" approval step before customers see anything.
  7. Check executions, add an Error Workflow, and set the right time zone.
  8. WhatsApp lead drafts and GST reminder drafts should land in a Sheet or approval step before anything reaches a customer.

Start with the enquiry-to-sheet workflow this week. Once you trust its rows, every other workflow in this chapter is just a few more nodes.

Previous chapter: What Is an AI Agent? Agentic AI vs Generative AI Explained with Examples

Next chapter: AI Browser Agents: Let AI Do Web Tasks Safely


Ravindra Bagale, trainer: linkedin.com/in/ravindra-bagale. Bluehill Tours, Sameer, Kavita and the prices in the examples are made up for learning. n8n plans and prices were checked on n8n's pricing page and docs on 23 October 2026; check them again before you buy. AI output changes every time, so your output will be similar, not the same.