Complete "Lesson 1: Getting Started with n8n and the Visual Editor" first to unlock this lesson.Go to previous lesson

Introduction

In n8n, every automation starts with a trigger node — something that kicks off the workflow — and is followed by one or more action nodes that perform the actual work. In this lesson you will build a small but real workflow: every time a new row is added to a Google Sheets spreadsheet, the workflow extracts the email and name, sends a personalized welcome email via Gmail, and then logs that the email was sent by writing a status back to the sheet. This pattern — trigger, transform, act, record — is the backbone of nearly every automation you will ever build.

flowchart showing a Google Sheets trigger node connecting to a Gmail action node connecting to a Google Sheets update node, with arrows and labels for each step

Understanding Triggers vs Actions

A trigger node listens for an event and starts the workflow. n8n differentiates between Polling Triggers (which check for new data on a schedule) and Webhook Triggers (which receive data instantly via an HTTP call). In this lesson we use a Polling Trigger from Google Sheets because it is the easiest to set up without exposing a public URL.

An action node does something with that data — send an email, write to a database, call an API. Action nodes only run after a trigger has fired and produced at least one item of data. Each item flows from node to node, and every node can read and transform it.

Building the Workflow Step by Step

Open n8n and create a new workflow. Add the first node, search for "Google Sheets", and select the "Google Sheets Trigger" node. Configure it to watch a specific spreadsheet and a specific sheet (for example, "Signups"), and set the trigger to fire "On Row Added". This means n8n will poll the sheet every minute and detect any newly inserted row.

The trigger produces one item per new row, containing the column values. Now add a "Set" node right after the trigger. The Set node lets you explicitly map which fields you want to keep and rename them, making the data easier to reference later. Map the email column to a field called `email` and the name column to a field called `firstName`.

Next, add a "Gmail" node and choose the "Send Message" operation. In the message body, reference the fields you just defined so each email is personalized. n8n uses double-curly-brace expressions to inject data from previous nodes.

javascript
To: {{ $json.email }}
Subject: Welcome, {{ $json.firstName }}!
Body: Hi {{ $json.firstName }}, thanks for signing up. We're glad to have you.

Finally, add another Google Sheets node, but this time choose the "Update Row" operation. Map the row to update using the same row number that came from the trigger, and set a column called "Status" to the value "Email Sent". This gives you a clear audit trail in the spreadsheet itself.

Testing and Activating

Before turning the workflow on, run it manually using the "Execute Workflow" button. Add a test row to your sheet with an email and a name. You should see the trigger fire, the Set node pass the mapped values, the Gmail node send the message, and the update node write "Email Sent" back to that row. If any step fails, click on the node to inspect its input and output — this is the fastest way to debug.

Once the test works, toggle the workflow from "Inactive" to "Active". From now on, every new signup row will automatically generate a welcome email and be marked as processed.

Common Mistakes to Avoid

A frequent error is forgetting that polling triggers have a delay — n8n checks the sheet on an interval, so a row added at second 0 may not be processed until second 59. If you need instant processing, use a Webhook Trigger instead. Another common mistake is using `$node["Node Name"].json` with the wrong node name after renaming a node — expressions are case-sensitive and reference the node's current label. Finally, make sure your Google Sheets and Gmail credentials have the scopes required for both reading and writing; missing scopes often look like authentication errors but are actually permission errors.

Summary

You have built a complete four-node workflow: a Google Sheets Trigger that detects new signups, a Set node that shapes the data, a Gmail node that sends a personalized welcome message, and a Google Sheets update node that records the result. This trigger → transform → act → record pattern is reusable across almost any business process — replacing the Gmail node with Slack, a database write, or an HTTP call lets you adapt the same skeleton to countless scenarios.

Lesson practice

Lesson Checkpoint

Review what you learned and get feedback on your work.

0/1
Answered · 0/1