Tag: Google Sheets

  • How to Build a Follow-up Email Sequence in n8n (Workflow)

    How to Build a Follow-up Email Sequence in n8n (Workflow)

    This tutorial shows you how to build an automated 3-email follow-up sequence in n8n that handles all of that for you. The workflow checks your contacts list daily, sends the right email to each person based on timing, and stops automatically when someone replies. (Workflow included)

    Real use cases: People who downloads your ebook, new lead onboarding, anything where you need to stay in touch without manually tracking 50+ conversations.

    Why n8n instead of Mailchimp or Hubspot?

    FREE. Unlimited contacts. You own the data. No monthly fees that scale with your list size. You need a paid subscription in HubSpot to enable automated nurturing email sequences. n8n costs $0 if you self-host, or $20/month for unlimited everything on n8n cloud.

    But, still there are some downsides as well.

    What you need to follow this tutorial?

    I’ll show you how to build the simplest version first, a 3 email sequence that actually works. then I’ll explain how to add reply detection and scaling things up.

    The Email Sequence Strategy (Before You Build)

    Most people jump straight into building workflows and wonder why their sequence feels wrong. The timing is off, or they send too many emails, or not enough.

    You should need to decide first before you add your first node.

    How Many Emails Should You Send?

    Three emails is the sweet spot for most follow-up sequences based on my marketing experience.

    • Email #1: Initial contact or First feedback email(reminds them who you are, offer value)
    • Email #2: Follow-up (adds context, share resources or case study)
    • Email #3: Final check-in (gentle nudge, easy opt-out)

    Why nore more? Industry data shows 80% of responses come from the first three emails. Email 4 and 5 mostly annoy people who’ve already decided not to respond.

    Long-term nurturing sequences (educational content over weeks/months). But that’s a different workflow. For follow-ups after a meeting or demo, stick with three or anyways you can try out your own phase, maybe more than 3 could work for you too. Alright, let’s stick to the plan.

    The Workflow Structure (High Level Overview)

    Before configuring individual nodes, understand how the pieces going to connect. Let’s start the plan.

    Planning our Email sequence workflow in n8n

    The objective: I want to send emails for those who downloaded my marketing e-book

    Right now, I’ve their details such as email, full name.

    Your email sequence workflows has 6 core nodes

    1. Manual trigger (for testing) / Schedule trigger
    2. Google Sheets (Read)
    3. Switch Node
    4. Set Node
    5. AI Agent (Gemini Chat Model)
    6. Code Node
    7. Set Node
    8. Gmail Node
    9. Switch Node
    10. Google Sheets (Update)

    Building the Workflow

    This is where everything comes together. By the end of this section you’ll have a working workflow that reads your contact list, decide which follow-up email to send, generates it with AI, send it via Gmail, and updates your sheet automatically.

    Let’s build it step by step.

    Step 1: Add The Trigger

    For now, use a Manual Trigger while building and testing, We’ll switch this to a schedule trigger later when everything works perfectly.

    Step 2: Get User’s Data

    Connect Google Sheets to the trigger

    Add a Google Sheets node and connect it to the trigger.

    Configurations

    Google sheets node configs
    • Resource: Sheet data
    • Operation: Read (Get Rows)
    • Document: Select your email Follow-up sequence sheet
    • Sheet: Sheet1 (for me)

    When you execute this node you should see all your user details flowing through separate items.

    Email lists in google spreadsheet

    One thing to check: Make sure every row in your sheet has a valid email address in the Users Email column. A single empty row will crash the Gmail node later. If you have blank rows, delete them now.

    Step 3: The Switch Node

    connecting switch node to the google sheets

    This is the brain of the workflow. The Switch node looks at each column and decides which email they need next.

    Read More: How to Build Conditional Logics in n8n (IF / Switch)

    Add a Switch node. set Mode to Rules.

    Add 3 Rules.

    Mapping from google sheets to switch

    Well, basically, you need to create 3 separate Routing Rules for separate follow ups.

    Logics

    • If Follow Up is false means we have to send them the follow-up email
    • If Follow Up is true means we have sent them the follow-up email
    Tagging the follow-ups column to n8n
    • What you’ve to do is, for 3 routes you have to assign those follow ups column appropriately.

    Step 4: Set Node (One Per Route)

    Each Switch route needs to know which email it’s sending. Add a SET node on each of 3 routes.

    • Make sure add a SET node to it’s Switch follow-up route
    • Now add these configurations to SET nodes individually
    • This is for Follow Up #1
      • followUpNumber – 1
      • followUpGoal – Confirm they received the ebook and invite questions
      • columnsToUpdate – Follow Up #1
    • This is for Follow Up #2
      • followUpNumber – 2
      • followUpGoal – Check if they started reading, share one key insight
      • columnsToUpdate – Follow Up #2
    • This is for Follow Up #3
      • followUpNumber – 3
      • followUpGoal – Ask for one-line feedback on the ebook
      • columnsToUpdate – Follow Up #3

    Make sure to know this, you can add whatever here on the followUpGoal for all these 3 SET nodes. It’s all about giving an additional contexts. You maybe have a different goal, add that goal in one liner.

    Step 5: The AI Agent

    Add an AI Agent node. Connect Google Gemini Chat Model to it’s Chat Model input.

    Now add this system prompt to AI Agent node.

    You are an email writer for Shajid from The Owl Logic (theowllogic.com), 
    a blog focused on n8n automation and workflow development.
    
    Shajid recently launched an ebook about n8n automation. The recipient 
    downloaded this ebook and you are writing a follow-up email on his behalf.
    
    ## Recipient Details:
    - Name: {{ $('Get Customer Data').item.json.Name }}
    - Company: {{ $('Get Customer Data').item.json.Company }}
    
    ## Which Email to Write:
    - Follow Up Number: {{ $json['followUpNumber:'] }}
    - Goal: {{$json.followUpGoal}}
    - Column to Update: {{$json.columnToUpdate}}
    
    ## Email Instructions Based on Follow Up Number:
    
    If followUpNumber = 1:
    - Subject: "Your n8n Automation Ebook is Ready, {{ $('Get Customer Data').item.json.Name }}"
    - Goal: Confirm delivery, tell them what's inside, invite questions
    - Tone: Warm welcome, excited but not salesy
    
    If followUpNumber = 2:
    - Subject: "Did you get a chance to read it, {{ $('Get Customer Data').item.json.Name }}?"
    - Goal: Check if they started reading, share ONE specific insight 
      from the ebook to spark curiosity, re-share download link
    - Tone: Casual check-in, friendly nudge
    
    If followUpNumber = 3:
    - Subject: "Quick question about the ebook, {{ $('Get Customer Data').item.json.Name }}"
    - Goal: Ask for one-line feedback, mention you're building more 
      resources and their input shapes what gets built next
    - Tone: Direct, honest, respectful of their time
    
    ## Rules for ALL emails:
    - Max 150 words
    - Write in first person as Shajid
    - Conversational, not corporate
    - No emojis
    - No marketing language or hype words
    - No phrases like "I hope this email finds you well"
    - Sound like a real person writing to one person
    - End with: "- Shajid"
    
    ## Output Format:
    Return ONLY this JSON structure, nothing else:
    
    {
      "subject": "email subject here",
      "body": "email body here",
      "columnToUpdate": "{{$json.columnToUpdate}}"
    }

    You can simply have it in your own way though based on your requirement, for this tutorial, try to copy me until you succeed, after that you can be able to make your own follow-up sequence.

    For the prompt (user message)

    Write follow-up email {{ $json.columnToUpdate }} for:
    
    Name: {{ $('Get Customer Data').item.json.Name }}
    Company: {{ $('Get Customer Data').item.json.Company }}
    Goal: {{$json.followUpGoal}}
    Column to Update: {{$json.columnToUpdate}}
    
    Return the JSON output only.
    • We are asking Gemini to write follow-up email {{ $json.columnToUpdate }} for: which means we are passing down the follow up number whether 1,2,3 – so basically we

    Watch this video below for understanding them perfectly.

    Step 6: The Code Node to Parse JSON

    Adding code node after AI Agent to sanitize it's data structure

    AI Agent returns everything as one string. This Code node breaks it into a separate fields.

    const results = [];
    
    for (const item of $input.all()) {
      // Safety check - skip items without output
      if (!item.json.output) {
        results.push({ json: { ...item.json, error: 'No output from AI Agent' } });
        continue;
      }
    
      try {
        const raw = item.json.output;
        
        // Clean markdown code blocks if present
        const cleaned = raw
          .replace(/```json\n?/g, '')
          .replace(/```\n?/g, '')
          .trim();
    
        const parsed = JSON.parse(cleaned);
    
        results.push({
          json: {
            ...item.json,
            subject: parsed.subject || 'Follow up from Shajid',
            body: parsed.body || '',
            columnToUpdate: parsed.columnToUpdate || item.json.columnToUpdate
          }
        });
    
      } catch (e) {
        // If JSON parse fails, log which item failed and why
        results.push({
          json: {
            ...item.json,
            error: `Parse failed: ${e.message}`,
            rawOutput: item.json.output
          }
        });
      }
    }
    
    return results;

    Step 7: Adding a SET Node (Again)

    Setting a SET node after Code node in n8n

    Now we need to separate what code node gives us, perhaps you don’t need this node, but I added here for easy to access data. I don’t want run into any confusion later though.

    Mapping the code node's response to SET node

    Map the data to SET node from the Code node.

    • Add the body
    • Add the subject
    • Add the Users email from Sheet directly.
    Output from the code node to set node

    So it should come like this all the information.

    Step 8: Gmail Node

    Add a Gmail Node (to send message)

    Configuration

    • To: {{ $json['Users Email'] }}
    • Subject: {{ $json.subject }}
    • Email Type: HTML
    • Message: {{ $json.body }}
    Mapping the SET nodes response to Gmail node

    Step 9: Switch Node to Update Google Sheet

    Switch routes branching out 3 different follow ups

    Alright, now we have to connect another Switch Node.

    You have to connect the previous Switch nodes state to this new Switch node. Simply drag and drop the Follow Up #1 and create a Routing rule.

    Make sure to create 3 separate routing rules for Follow Ups, like how I did.

    Mapping the previous switch node data to this new switch node

    Step 10: Add Google Sheets to Per Route

    Updating google sheets as per switch route

    Now we have 3 different routes for follow-ups, and we need to attach 3 different Google Sheet (update) nodes to the each route.

    Configuration

    • Operation: Update Row
    • From List: Your Document
    • Sheet: Sheet 1 (mine)
    • Mapping Column Mode: Map Each Column Manually
    • Columns to Match On: Users Email
    Follow Up #1 to true
    Follow Up #2 to true on 2nd route switch node
    Follow Up 3 to true

    Make sure to understand this, for each route has follow up.

    • Route 1: Follow Up #1: You need to Update the Google Sheet Follow Up #1 Column to TRUE, and keep others empty
    • Route 2: Follow Up #2: You need to Update the Google Sheet Follow Up #2 Column to TRUE, and keep others empty
    • Route 3: Follow Up #3: You need to Update the Google Sheet Follow Up #3 Column to TRUE, and keep others empty

    Final Execution Email Follow-Up

    So literally before you add your contact lists, you work with one email for testing, whether everything works perfectly, including the formatting, After that gradually test with 5, 10, 20, 30 and once passed without any failure. You can move on with your lists.

    Frequently Asked Questions

    How do I add delays between follow-up emails?

    Don’t use Wait Nodes for multi-days delays. They block your entire workflow – if Contact 1 hits a 3-day wait, every other contact get stuck behind it.

    The correct approach: Scheduled trigger + date in your Switch conditions.

    Your workflow runs daily and asks “has enough time passed?” instead of sitting open for 3 days.

    Add a Last_Email_Date column to your sheet. Each Update node writes today’s date after sending. The Switch condition checks how many days have passed before sending the next email.

    Can I Use SMTP instead of Gmail?

    Yes. Replace the Gmail node with n8n’s Send Email node and plug your SMTP credentials.

    Good free options SendGrid (100/day), Brevo (300/day), Mailgun(1,000/day trial)

    Gmail works fine for testing and small lists. Switch to SMTP when you hit over 200+ contacts per day.

    Can I Connect MailChimp or ActiveCampaign?

    Yes. Instead of the Gmail node, use n8n’s Mailchimp or ActiveCampaign node to add contacts directly into their automations.

    That said, if you’re already building this in n8n, you don’t need them. n8n + Gmail handles everything for almost for free.

    How do I stop the sequence if someone replies?

    That requires a second workflow running alongside with this one, The second workflow.

    1. Monitor your Gmail inbox using an Email trigger (IMAP) node
    2. Check if the sender’s email matches anyone in your Google Sheet
    3. If Yes, update their statuses to mark sequence complete.

    Well, make sure to subscribe to our email newsletter for more information regarding this workflow. You can directly talk to me regarding any issue with this workflow or to make this workflow great.

    My Final Thoughts

    You just built an AI-powered follow-up email sequence from scratch in n8n.

    No mailchimp subscriptions. No hubspot invoices, Just n8n. Pure play.

    What’s next? If you want this running fully or autopilot without manual executing it, switch to a Schedule trigger, with data math as I mentioned above. Workflow handles timing on it’s own.

    Well, This is all up. You can grab the Workflow JSON here.

  • How to Integrate Google Sheets to n8n (Updated 2026)

    How to Integrate Google Sheets to n8n (Updated 2026)

    I was literally spending 5-8 hours every week manually transferring the data – traffic metrics, source channels, sales figures and more.

    Everything was manual, day-to-day grunt work.

    As a business owner, when work piles up (and it always does), I’d skip the data processing entirely. Those tasks would just pile up into my backlog, creating even more stress down the line.

    Then I thought: enough, Let’s automate with n8n.

    I integrated Google Sheets with n8n, and now everything runs on autopilot. EVERYTHING.

    In this post, I’m going to show you exactly how to integrate Google Sheets to n8n. Step by step. This is a beginner friendly guide that assumes zero prior automation experience.

    Prerequisites

    Before we integrating Google Sheets with n8n, make sure following ready.

    1. An n8n account or Self-hosted instance.

    You’ll need access to n8n to build your workflow. You’ve got two options

    • n8n cloud (Recommended for beginners): Sign up for free account at n8n.cloud. No installation required, and you start building workflows immediately.
    • Self-hosted n8n instance: If you prefer running n8n on your server or locally, follow this guide How to install n8n locally (Window + Mac)

    For this tutorial I’m using a local instance.

    2. A Google Account

    You need a Google account to access Google Sheets and Google Cloud Console. If you don’t have one, create a free account.

    3. Google Cloud OAuth Credentials (Already Setup)

    To connect Google Sheets with n8n, you’ll need OAuth credentials from Google Cloud Console.

    If you haven’t setup this yet, follow our comprehensive guide here: Complete n8n credentials and services guide

    This guide covers

    • Creating a Google Cloud Project
    • Enabling Google Sheets API
    • Setting OAuth 2.0 credentials
    • Connecting credentials to n8n

    Already have credentials but they keep expiring? Check out our troubleshooting guide here How to Fix n8n credentials Expiring Issues

    Once your Google OAuth credentials are connected to n8n, come back here continue with the integration workflow.

    4. A Google Sheet to Work With

    Create a simple Google Sheet to to test the integration. You can use existing spreadsheet or create a new one with simple data.

    5. Basic Understanding of Spreadsheets

    You don’t need a coding experience here. If you know how to use Google Spreadsheet (rows, columns, basic data entry), you’re ready to go.

    Step 1: Setting Up Your First Google Sheet Workflow

    Create a New Workflow

    • Log in to your n8n account
    • Click on “New Workflows” in the left sidebar
    • You’ll see a blank canvas – this is where your automation playground

    Add a Manual Trigger

    Every n8n workflow needs a trigger to start it. For testing purposes, We’ll use a manual trigger, which lets you run the workflow whenever you click the execute button.

    Why manual trigger? We want to test everything manually before setting up automated triggers like, schedules, or webhooks. This gives full control during the learning phase.

    Rename Your Workflow

    Rename the workflow to something useful, Always use clear, descriptive names. When you’re managing 10+ workflows, you’ll thank yourself for this habit.

    Step 2: Connect Your Google Sheets Node

    Configuring Google Sheets Node

    1. Click on the “+” icon next to your manual trigger.
    2. In the search bar, “Google Sheets”
    3. Click on the “Google Sheets” to add it to your editor.

    You’ll see the node configuration panel open on the right side.

    There are many operations for sheets, Append, Update, Delete, Create, Get and etc.

    For this tutorial, we are going to use GET operation Get row(s) to read what is inside on the Google Sheets.

    Credentials to Connect With

    Click on the “Credentials to connect with” dropdown and select your Google OAuth credentials that you’d already setup.

    Don’t see your credentials here? Go back to our n8n credentials and services to set it up.

    Document: Select Your Google Sheet

    You have three ways to select your spreadsheet

    • From List: Choose from your recent Google Sheets (easiest)
    • By URL: Paste the full Google Sheets URL
    • By ID: Use the spreadsheet ID from the URL

    For beginners, select “From List” and choose your test spreadsheet from the dropdown.

    Sheet: Select Your Sheet Tab

    If your spreadsheet has multiple tabs (Sheet 1, Sheet 2, etc). Select which one you want to read from.

    In my case, I’m using Sheet 1.(the default tab name)

    Step 3: Execute The Workflow

    Time to see the magic happen! let’s run this workflow and fetch Google Sheets data.

    Run Your First Test

    1. Make sure both nodes are connected (you should see a line in between them)
    2. Click “Execute Workflow”

    What happens next?

    n8n will connect your Google Sheet, fetch all the rows, and display the data in the output panel below the Google Sheets node.

    Congratulations You’ve just fetched (read) data from Google Sheets to n8n.

    What you can do from here?

    Now that you have sheet data flowing into n8n, the automation possibilities are endless.

    • Filter and process the data using n8n’s built-in nodes
    • Send data to other apps like Gmail, Discord, Slack, etc
    • Transform the data with code, AI or data manipulation nodes
    • Trigger action based on specific values in your sheet
    • Append new data back to same or different sheet

    Common Google Sheets Operations Explained

    Now that you’ve successfully read data from Google Sheets, let’s explore the other essential operations you’ll use most frequently. Understand these will give you the foundation to build any Google Sheets automation with n8n.

    Append Row – Adding New Data

    When you want to add new entries to the bottom of your spreadsheet (like logging form submission, new leads or daily reports).

    How it works?

    • Add a Google Sheets node to your workflow
    • Select “Append Row” from operations dropdown
    • Choose your spreadsheet (document) and sheet
    • Map the data you want to add to each column

    Update Row – Modifying Existing Data

    When you need to change information in specific rows (like updating order status, making tasks complete, or changing contact details).

    How it works

    • Add a Google Sheet node
    • Select “Update Row” from Operations
    • Choose your spreadsheet (document) and sheet.
    • Specific which row to update (or use column matching to find the right row)
    • Map the new values for each column

    Important: You need a way to identify which row to update. You can either use

    • The row number (if you know it)
    • Match by unique column value (like email or order ID)

    Append or Update Row – Smart Data Handling

    When you’re not sure if a record already exists. This operation check first, then either updates the existing row or creates a new one.

    How it works

    • Same structure as choosing sheet nodes.
    • Choose your spreadsheet (document) and sheet
    • Define the column to check for existing records (like email or ID)
    • Map your data

    Why this is so powerful? This prevents duplicate entries while keeping your data up-to date automatically.

    What You’ve Learned

    Let’s recap what you’ve learnt in this tutorial

    • Set up Google Sheets integration with n8n – You connected your Google account and configured OAuth credentials to enable secure communication between n8n and Google Sheets.

    • Created your first automation workflow – You build a working n8n workflow from scratch, understanding how nodes connect and execute

    • Successfully fetched data from Google Sheets – You use the “Get Row(s)” operation to pull spreadsheet data into n8n, which is the foundation for any Google Sheets automation

    • Understood the essential operations – You now know the difference between, Append, Update and Append & Update. When to use each one.

    Your Turn & Share Your Progress

    The best way to solidify what you’ve learned is to build something yourself.

    Got your workflow working? Awesome, here’s what you have to do next?

    • Experiment freely – try combining different operations, break things, and rebuilt them.
    • Start small, then scale – don’t jump straight into complex 20-node workflows. Master simple 2 – 4 node flows first.
    • Document your workflows – Use n8n’s notes feature to add comments explaining what each node does.
    • Build something real – The best practice project is one that solves an actual problem you have. What manual tasks could you automate today?