AutomationFlowsData & Sheets › Ai-powered Automated Outreach with Scheduling, Gemini, Gmail & Google Sheets

Ai-powered Automated Outreach with Scheduling, Gemini, Gmail & Google Sheets

BySarfaraz Muhammad Sajib @sarfarazmuhammad on n8n.io

Automate your lead generation and outreach process seamlessly using AI, Gmail, and Google Sheets—all within n8n. No complicated setup—just import, activate, and start reaching prospects with personalized messages generated by Google Gemini’s AI model. Import the Workflow…

Cron / scheduled trigger★★★★☆ complexityAI-powered13 nodesHTTP RequestGoogle SheetsGmailChat TriggerGoogle Gemini ChatChain Llm
Data & Sheets Trigger: Cron / scheduled Nodes: 13 Complexity: ★★★★☆ AI nodes: yes Added:
Ai-powered Automated Outreach with Scheduling, Gemini, Gmail & Google Sheets — n8n workflow card showing HTTP Request, Google Sheets, Gmail integration

This workflow corresponds to n8n.io template #5479 — we link there as the canonical source.

This workflow follows the Chainllm → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "ksmLrthCRqippMsj",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Automated Outreach Scheduling Using Gemini, Gmail & Spreadsheets",
  "tags": [],
  "nodes": [
    {
      "id": "7333fddf-f4a0-42c1-b5c2-171d5f52e8e9",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1320,
        35
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9ad90cee-d408-499f-85ff-64aa79e277fb",
      "name": "HTTP Request: Get Website",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -660,
        -65
      ],
      "parameters": {
        "url": "={{ $json.website }}",
        "options": {
          "timeout": 10000
        },
        "responseFormat": "string"
      },
      "typeVersion": 2,
      "continueOnFail": true
    },
    {
      "id": "48ff2089-8431-4d01-befa-28257e10492e",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1100,
        35
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 932253400,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LYaFs-SpNwbLfcyQx8BvAwhjDQw2KCk0rLhy2gAkjo0/edit#gid=932253400",
          "cachedResultName": "Lead Lists"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1LYaFs-SpNwbLfcyQx8BvAwhjDQw2KCk0rLhy2gAkjo0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LYaFs-SpNwbLfcyQx8BvAwhjDQw2KCk0rLhy2gAkjo0/edit?usp=drivesdk",
          "cachedResultName": "Lead Lists"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "a0ec6aac-404b-49f6-990e-da5dcf43ae2e",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -440,
        185
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "status": "INVALID_EMAIL"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "first_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "first_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "last_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "company_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xx5Zi4Of1SYZNGOC7DvZ6Uz-LBS6DK0zGhSe_1cHaSk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1LYaFs-SpNwbLfcyQx8BvAwhjDQw2KCk0rLhy2gAkjo0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LYaFs-SpNwbLfcyQx8BvAwhjDQw2KCk0rLhy2gAkjo0/edit?usp=drivesdk",
          "cachedResultName": "Lead Lists"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "53e4114f-d6d7-4c2d-8f51-d90a17627569",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        376,
        10
      ],
      "parameters": {
        "sendTo": "={{ $('Validate E-mail with regex').first().json.email }}",
        "message": "={{ $json.greeting }}\n\n{{ $json.opening_line }}\n\n{{ $json.main_body }}\n\n{{ $json.ending }}",
        "options": {},
        "subject": "={{ $json.subject }}\n",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d385e620-e133-4b96-b4e5-f76f7a02671c",
      "name": "Wait (We have rate limit)",
      "type": "n8n-nodes-base.wait",
      "position": [
        -660,
        185
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "dcefb450-5d91-4a3f-a54d-c99d54b7ccd3",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -440,
        385
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "a3854e94-9fae-423e-85fe-d088de445f30",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -132,
        230
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-1.5-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "730b5d50-9160-4393-8ba7-44d6846ad6d4",
      "name": "Outreach Prompt",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -200,
        300
      ],
      "parameters": {
        "text": "=Generate a personalized initial cold outreach message for a potential B2B lead. Use the lead\u2019s company website to identify what they do and craft a compelling opening line that shows genuine interest. Then follow with a brief message introducing our solution, highlighting how it aligns with their business goals, and ends with a soft CTA (call to action). The tone should be professional yet friendly, optimized for high response rates. Return the subject line, opening sentence, and main body in plain text. Make sure the mail is short under 120 words at max. Always ends you email with this \"Looking forward to hearing from you!\"\n\nUse these information:\nLeads:\nfirst_Name:{{ $('Validate E-mail with regex').item.json.first_name }}\ncoompany_bame:{{ $('Validate E-mail with regex').item.json.company_name }}\nwebsite_url: {{ $('Validate E-mail with regex').item.json.website }}\nwebsite_content: {{ $json.cleanedData }}\n\nOur Company:\ncompany_name: XYZ Inc,\nour_solution: We provide employee managament solution at scale.\n\n\nMust Follow Instrcutions:\nYou must always respond in the following JSON format or else i will be fired.\n\n{  \"subject\": \"...\", \n\"greeting\":\"...\" \n\"opening_line\": \"...\", \n\"main_body\": \"...\" \n\"ending\":\"...\"}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "Act as Marketer with 25 years of experience."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "d0bb321c-7e59-4daf-8ba5-f4d0633396d6",
      "name": "Clean Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -440,
        -140
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field 'cleanedData' with HTML removed from 'data'\nfor (const item of $input.all()) {\n  const html = item.json.data || '';\n  // Remove all HTML tags but keep text content\n  const cleaned = html.replace(/<[^>]*>/g, '').trim();\n  item.json.cleanedData = cleaned;\n}\n\n// Return all items with the new field added\nreturn $input.all();\n"
      },
      "typeVersion": 2
    },
    {
      "id": "3eab20a8-365f-431f-a744-33a47388e0b0",
      "name": "Validate E-mail with regex",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        40
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "844ae7ce-d7ad-4742-9e88-8a73ec5abd59",
              "operator": {
                "type": "string",
                "operation": "regex"
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": "/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "e928071a-2a80-43d6-8c35-c9f580361bb4",
      "name": "Parse Json",
      "type": "n8n-nodes-base.code",
      "position": [
        156,
        10
      ],
      "parameters": {
        "jsCode": "const rawText = $input.first().json.text || \"\";\n\ntry {\n  // Match JSON content between ```json and ```\n  const jsonMatch = rawText.match(/```json\\s*([\\s\\S]+?)\\s*```/i);\n\n  if (!jsonMatch || !jsonMatch[1]) {\n    throw new Error(\"No valid JSON block found in input.\");\n  }\n\n  const jsonString = jsonMatch[1].trim();\n\n  // Safely parse JSON\n  const parsedJson = JSON.parse(jsonString);\n\n  return [{ json: parsedJson }];\n} catch (error) {\n  return [{\n    json: {\n      error: \"Failed to parse JSON\",\n      details: error.message,\n    },\n  }];\n}\n"
      },
      "typeVersion": 2
    },
    {
      "id": "34b2951f-e2e8-494c-9bfb-41ee7bb04fe2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        -660
      ],
      "parameters": {
        "width": 760,
        "height": 500,
        "content": "- Import the workflow into your n8n instance.\n- Connect your Google Sheets and Gmail accounts.\n- Set up your leads using the provided spreadsheet template.\n- Get your Gemini API key and add it to n8n credentials.\n- Adjust the Schedule Trigger to control when emails are sent.\n- Customize the email prompts for your outreach tone.\n- Set rate limits to comply with Gmail policies.\n- Enable the workflow to start automated outreach.\n- Track replies and update lead status in Google Sheets.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2c6420c4-697e-4fad-b4f6-bc9c5ecacb98",
  "connections": {
    "Clean Data": {
      "main": [
        [
          {
            "node": "Outreach Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Json": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Outreach Prompt": {
      "main": [
        [
          {
            "node": "Parse Json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Validate E-mail with regex",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Outreach Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request: Get Website": {
      "main": [
        [
          {
            "node": "Clean Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Outreach Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait (We have rate limit)": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate E-mail with regex": {
      "main": [
        [
          {
            "node": "HTTP Request: Get Website",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait (We have rate limit)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Outreach Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Automate your lead generation and outreach process seamlessly using AI, Gmail, and Google Sheets—all within n8n. No complicated setup—just import, activate, and start reaching prospects with personalized messages generated by Google Gemini’s AI model. Import the Workflow…

Source: https://n8n.io/workflows/5479/ — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Revenue operations teams, SaaS growth managers, and sales directors who need automated weekly insights from their Stripe payment data. Perfect for small to medium businesses tracking subscription reve

HTTP Request, Google Sheets, Google Gemini Chat +4
Data & Sheets

Lead Generating Web Scraper & CRM Automation. Uses httpRequest, airtable, googleSheets, gmail. Scheduled trigger; 38 nodes.

HTTP Request, Airtable, Google Sheets +4
Data & Sheets

This n8n template demonstrates how to use AI to score the all Resumes by matching it with Job profile

HTTP Request, Google Gemini Chat, Gmail Trigger +5
Data & Sheets

Product managers, customer success teams, and small business owners who collect feedback via Google Forms and want automated sentiment analysis without manual review. Ideal for teams processing 10-100

Google Sheets, Chain Llm, Google Gemini Chat +2
Data & Sheets

Splitout Code. Uses httpRequest, splitOut, lmChatAnthropic, spotify. Scheduled trigger; 37 nodes.

HTTP Request, Anthropic Chat, Spotify +3