An n8n flow example is a practical demonstration of how to build an automation workflow using n8n’s visual canvas. It consists of a series of connected nodes, starting with a Trigger Node that initiates the process based on a specific event (like a new email), followed by one or more Action Nodes that perform tasks with the data received. This guide will walk you through creating a simple yet powerful workflow: automatically sending a Slack notification whenever a new row is added to a Google Sheet, providing a solid foundation for understanding n8n’s core concepts.
What Are the Building Blocks of an n8n Workflow?
So, you’ve opened up n8n and you’re staring at a blank canvas. What now? It can feel a little intimidating, but trust me, it’s simpler than it looks. Think of an n8n workflow like a recipe. You have your ingredients (data), your instructions (nodes), and a specific reason to start cooking (the trigger).
Let’s break down the key components you’ll be working with in every n8n flow example.
The Trigger Node: Your Starting Gun
Every workflow has to start somewhere. The Trigger node is the official starting gun for your automation. It’s the ‘when this happens…’ part of your automation sentence. It listens for a specific event and, when that event occurs, it grabs the data associated with it and kicks off the rest of the workflow.
Common triggers include:
- Schedule Trigger: Run a workflow at a specific time (e.g., every day at 9 AM).
- Webhook: Run when it receives a call from another app or service.
- Google Sheets Trigger: Run when a new row is added to a spreadsheet.
- Gmail Trigger: Run when a new email arrives.
Action Nodes: The Worker Bees
If the trigger is the ‘when,’ the Action nodes are the ‘do this.’ These nodes are the workhorses of your flow. They take the data passed to them from the previous node and perform a specific task. You can chain as many of these together as you need to build complex logic.
For example, an Action node could:
- Send a Slack message.
- Add a new contact to your CRM.
- Create a task in Asana.
- Use an IF node to make a decision based on the data.
Connections and Data Flow: The Assembly Line
That little line you draw between nodes? We affectionately call it ‘the noodle.’ This is the assembly line that carries your data from one step to the next. The output of one node becomes the input for the next, allowing you to build on and transform data as your workflow progresses. This is the magic of n8n—seeing your data flow visually from start to finish.
Here’s a simple comparison to make it stick:
Component | Analogy | Purpose in n8n |
---|---|---|
Trigger Node | A doorbell ringing | Starts the workflow when an event happens. |
Action Node | Opening the door | Performs a specific task with the data. |
Connection | The hallway | Passes data from one node to the next. |
Let’s Build a Simple n8n Flow Example: Google Sheets to Slack
Enough theory! The best way to learn is by doing. Let’s build one of the most common and useful automations I recommend to beginners.
The Goal: When we add a new lead’s information to a row in a Google Sheet, we want to instantly notify our sales channel in Slack. No more copy-pasting!
Step 1: Setting Up Your Trigger (Google Sheets)
First, we need to tell n8n to watch our spreadsheet.
- On your blank canvas, click the ‘+’ button to open the node menu.
- Search for
Google Sheets Trigger
and select it. - Credentials: The first thing you’ll see is a prompt for credentials. Click the dropdown and select ‘Create New’. Follow the prompts to connect your Google account. This is a one-time setup; n8n will securely store these credentials for future use.
- Configuration: In the node’s parameters, select the Sheet ID of your spreadsheet and the specific Sheet Name you want to monitor.
- Test it: Click Fetch Test Event. n8n will pull in the data from the latest row in your sheet. You should see the column headers and their values appear in the output. Perfect! You now have sample data to work with.
Step 2: Adding Your Action (Slack)
Now that we have our trigger, let’s tell n8n what to do with that data.
- Click the small ‘+’ on the right side of your Google Sheets node to add the next step.
- Search for
Slack
and select the Slack node. - Credentials: Just like before, you’ll need to connect your Slack account if you haven’t already.
- Configuration: This is where the magic happens.
- Select the Slack Channel you want to post in.
- In the Text field, you can write your message. To include data from the Google Sheet, simply drag the variable from the ‘INPUT’ panel on the left into the text box. For instance, you might write:
New Lead Alert! Name: {{ $json.Name }}, Email: {{ $json.Email }}
.
Let’s be honest, that expression {{ $json.Name }}
looks a bit like computer code, doesn’t it? But don’t worry. All it means is “Hey n8n, go look at the JSON data from the previous step and grab the value from the field called ‘Name’.” The visual editor makes this incredibly easy.
Step 3: Test and Activate!
Your two nodes are connected. It’s time for the final check.
- Click the Execute Node button on the Slack node. Within seconds, you should see your formatted message appear in your designated Slack channel. Success!
- To make this workflow run automatically for all new rows, simply click the Activate toggle at the top right of the screen. Save your workflow, and you’re done!
Why This Simple n8n Flow Example is So Powerful
Okay, so we connected two apps. Big deal, right? Actually, it is. What you’ve just learned are the fundamental principles for automating almost any process.
This simple n8n flow example is a gateway. You could easily add more nodes:
- Add an IF node after the trigger to only send a Slack message if the lead is from a specific country.
- Add a Gmail node to send a welcome email to the lead’s email address.
- Add a HubSpot node to create a new contact in your CRM.
The possibilities are truly endless, and they all start with the same basic building blocks you just mastered. One potential challenge for newcomers is getting the credentials right, as every app has a slightly different authentication method. But once you’ve done it once, you’ll see the pattern, and n8n’s documentation is always there to help.
So go ahead, open that blank canvas and start building. What will you automate first?