Lesson 2 · Module 2: Your First Working AI Automation
Building a lead capture flow: web form to Google Sheets to email
Video coming soon
Learn it with your tutor on the live board
Key points from the video
The lead that got away
- A visitor fills in your contact form
- The message lands in a busy inbox
- Nobody replies for three days
- The client books someone else
What you will learn
- Capture form submissions with an n8n Form Trigger
- Save every lead as a clean row in Google Sheets
- Send an instant thank-you and an owner alert
The whole flow at a glance
- One trigger, one cleaning step, three actions
- Data flows down, one item per lead
- The sheet is your record, emails are the response
Step 1: the Form Trigger
- Built-in node: n8n hosts the form for you
- Add fields: name, email, service, budget
- Mark name and email as required
- Embed the link on your site or share it
Step 2: clean the fields
- Add an Edit Fields node, rename it Clean fields
- Add one field per line, each with an expression
- Budget is already a number: pass it through
name {{ $json.name.trim().toTitleCase() }}
email {{ $json.email.trim().toLowerCase() }}
service {{ $json.service }}
budget {{ $json.budget }} Step 3: append a row to Google Sheets
- Node: Google Sheets, operation Append Row
- Connect your Google account once
- Map each field to a column by name
layout: side
cells:
A1: Name
B1: Email
C1: Service
D1: Budget
A2: Sara Ahmed
B2: [email protected]
C2: Website
D2: 800
A3: Omar Ali
B3: [email protected]
C3: Logo
D3: 300
format: {D: currency:0}
steps:
- at: "a third lead arrives"
type: {A4: "Lina Hassan", B4: "[email protected]", C4: "Shop setup", D4: 1200}
highlight: A4
- at: "the whole pipeline"
type: {A6: "Pipeline", D6: "=SUM(D2:D4)"}
highlight: D6 Step 4: two emails, two jobs
- Gmail node: thank-you to the lead
- Second Gmail node: alert to you
- Connect your Gmail account once
- After the sheet, use the column names
To: {{ $json.Email }}
Subject: Thanks, {{ $json.Name }}!
Hi {{ $json.Name }},
we got your request for {{ $json.Service }}.
I'll reply within one business day. Worked example: a yoga studio
- Maria fills in the form on her phone
- A new, clean row appears in the sheet
- The teacher gets an alert between classes
- Maria reads her thank-you email
Test with one fake lead
- Click Execute step, then fill the test form
- Check every node's output, trigger to emails
- Look at the sheet and both inboxes
- Delete the test row before going live
Common mistake: the test URL
- Test URL works only while you are listening
- Production URL works only when the workflow is active
- Put the production link on the client's site
- Then activate the workflow
Recap
- A trigger starts the flow on every submission
- Clean data first, then save it as a row
- Reply to the lead and alert the owner
Your exercise
- Build the four-step flow for a business you know
- Add one extra field, such as preferred date
- Send three fake leads and check the sheet
- Screenshot the sheet and both emails
Transcript
The lead that got away. Picture a small web design studio. A potential client fills in the contact form on Friday evening, asking about a new website with a budget of eight hundred dollars. The message lands in an inbox full of newsletters and invoices. The owner scribbles a few notes, and on Monday it's buried. By Wednesday, that client has hired someone who replied in ten minutes. This happens every week in small businesses, and it isn't about effort. It's about having no system. Today we fix that with a small workflow that catches every lead, saves it, and answers it within seconds, even at midnight.
What you will learn. By the end of this lesson you'll be able to do three things. First, capture form submissions with a trigger, so the workflow starts the moment someone presses submit. Second, save every lead as a clean row in a Google Sheet, which becomes your simple sales pipeline. Third, reply automatically, with a thank-you email to the lead and an alert to you, the owner. These three steps, capture, save and reply, are the backbone of almost every client automation you'll sell, from booking requests to quote forms.
The whole flow at a glance. Here's the full picture before we build it. A visitor fills in a web form. The Form Trigger node receives the answers and starts the workflow. Next, a cleaning step tidies up the fields, because people type names in odd ways. Then the lead goes into Google Sheets as a new row. Finally, two emails go out, one thanking the lead and one alerting you. Remember from the last lesson that data flows from node to node as items. Here each submission is one item, so every lead travels through the whole chain on its own.
Step 1: the Form Trigger. In n8n, start a new workflow and add the node called On form submission, also known as the Form Trigger. The nice part is that n8n hosts the form itself, so you don't need a website builder or a paid form tool. Give the form a title like Request a quote, then add four fields: name, email, the service they want, and their budget as a number. Mark name and email as required, so nobody can submit an empty form. n8n gives you a link you can put behind a button on your site or send by message.
Step 2: clean the fields. Real people type messy data. Sara typed her name in lowercase with extra spaces and her email with capital letters. If you save that as it is, your sheet looks sloppy and the same person can appear twice with different spellings. So add an Edit Fields node after the trigger and rename it Clean fields. Add one field per line and drag in the expressions you see here. For the name, trim removes the extra spaces and to title case capitalises each word. For the email, trim and then to lower case. The service needs no change, and the budget already arrives as a number, because we made it a number field. Run the node and the output shows a tidy Sara Ahmed with a clean email.
Step 3: append a row to Google Sheets. Now add a Google Sheets node and pick the operation Append Row. You'll connect your Google account once, then choose the spreadsheet and the tab. Create the headers yourself first: Name, Email, Service and Budget. n8n then lets you map each cleaned field to the column with the same name. Watch what happens when a third lead arrives: Lina's request for a shop setup simply appears as a new row. Add one sum formula at the bottom and you can see the whole pipeline at a glance, two thousand three hundred dollars of potential work.
Step 4: two emails, two jobs. Last, add two Gmail nodes after the sheet, and connect your Gmail account once, just as you did for the sheet. The first one thanks the lead. Inside the email you use expressions, the bits in double curly braces, which pull values from the current item. One catch: after the Google Sheets node, the current item is the row the sheet sent back, so its names are your column headers, with capital letters. So dollar json dot Name becomes Sara Ahmed, and the service becomes Website. The lead gets a personal reply in seconds. The second Gmail node goes to you, the owner, with a short alert whose subject shows the new lead's name, service and budget. Keep the two jobs separate. One email makes the client feel heard, the other makes sure you actually follow up.
Worked example: a yoga studio. Let's follow one real lead through a small yoga studio's flow. It starts with the form, where Maria fills in her name, her email, private classes as the service, and a budget of two hundred dollars, all on her phone during a lunch break. Seconds later the sheet on the studio's computer gains a new row, with her name neatly capitalised and her budget saved as a number the owner can add up. Finally, the alert reaches the teacher's phone between two classes, while Maria is already reading her thank-you email. Nobody typed anything by hand.
Test with one fake lead. Before any real client touches this, test it with one fake lead. Open the Form Trigger and click Execute step. n8n opens a test version of your form, so fill it in with a made-up name and your own email address. Then walk through each node in order, from the trigger to the emails, and read its output. Did the name come out capitalised? Did the row land in the right columns? Did both emails arrive? If something looks wrong, fix that one node and test again. When everything passes, delete the test row so your pipeline stays clean.
Common mistake: the test URL. Here's the mistake that catches almost everyone once. The Form Trigger has two links, a test URL and a production URL. The test URL only works while you're actively listening in the editor. If you paste it on the client's website, it works during your demo and then silently stops, and leads vanish. The production URL is the one for real visitors, and it only works when the workflow is switched to active. So copy the production link onto the site, activate the workflow, send one more fake lead through to be sure, and delete that row afterwards.
Recap. Let's recap. First, a Form Trigger catches every submission the moment it happens, with no paid form tool. Second, clean the data before you store it, then append it as a row, so your sheet becomes a simple, reliable sales pipeline. Third, send two emails with different jobs: a personal thank-you to the lead and an alert to the owner. With these few nodes, the studio from our opening story would never lose a Friday evening lead again. And this is a workflow clients understand instantly and happily pay for.
Your exercise. Now it's your turn. Pick a small business you know, maybe a hairdresser, a tutor or a photographer, and build this flow for them: Form Trigger, clean fields, Google Sheets row and two emails. Add one extra field that fits that business, such as a preferred date for a photographer. Send three fake leads with messy spelling and check that each one lands as a clean row. Take a screenshot of the sheet and both emails. Next lesson, we'll add an AI step that reads each message and sorts it for you.
Explore the animation
The animations from the video, exact and live: play them, pause, drag the slider or jump to a step at your own pace.
Loading the animation...
Lesson summary
- Video watched
- A trigger starts the flow on every submission
- Clean data first, then save it as a row
- Reply to the lead and alert the owner