AutomationFlowsAI & RAG › Gmailautogsheetp1

Gmailautogsheetp1

GmailAutoGsheetP1. Uses googleSheets, openAi, gmailTool. Event-driven trigger; 4 nodes.

Event trigger★★☆☆☆ complexityAI-powered4 nodesGoogle SheetsOpenAIGmail Tool
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Google Sheets → OpenAI 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
{
  "name": "GmailAutoGsheetP1",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -672,
        80
      ],
      "id": "a5f46221-9174-4c3c-8073-d7df1d1a5f68",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1SPPaHvIDKt8sn6y4QXbw_MehaRaw51cg8P5CvE9nuQM",
          "mode": "list",
          "cachedResultName": "AI-demosheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SPPaHvIDKt8sn6y4QXbw_MehaRaw51cg8P5CvE9nuQM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1015163286,
          "mode": "list",
          "cachedResultName": "Feedback",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SPPaHvIDKt8sn6y4QXbw_MehaRaw51cg8P5CvE9nuQM/edit#gid=1015163286"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -464,
        80
      ],
      "id": "9f2527c4-b990-47d5-aa9b-662e6821c053",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "responses": {
          "values": [
            {
              "content": "=Write a customized mail from the given gsheet list.\nTo:\n {{ $json.Email }}"
            },
            {
              "role": "system",
              "content": "You are an assistant that generates beautiful, personalized HTML emails for the brand \u201cBloomy Organics.\u201d  \nYour output MUST always be a completely formatted, ready-to-send HTML email (starting with <!doctype html>).  \nDo NOT output explanations, comments, or markdown.\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  DESIGN REQUIREMENTS (MATCH EXACT STYLE)\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nThe email MUST match this visual layout style exactly:\n\n\u2022 Soft nature-inspired gradient background (very light green \u2192 very light blue)  \n\u2022 Centered WHITE CARD with rounded corners (12\u201318px)  \n\u2022 Subtle shadow under the card  \n\u2022 \u201cBloomy Organics\u201d title centered in green  \n\u2022 Left-aligned body text within the card  \n\u2022 A green, rounded quote box EXACTLY like the screenshot  \n\u2022 A single plant emoji centered under the quote  \n\u2022 A thin green horizontal bar below the emoji (full width of card)  \n\u2022 Premium, soft, clean, modern spacing  \n\u2022 Fonts: Arial / Helvetica / sans-serif  \n\u2022 Mobile responsive  \n\u2022 ONLY inline CSS (no external images or scripts)\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  PERSONALIZATION REQUIREMENTS\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nUse the dynamic fields passed from n8n (Google Sheets):\n\n\u2022 {{name}}  \n\u2022 {{product}}  \n\u2022 {{feedback}}  \n\u2022 {{city}}  \n\u2022 {{custom_note}}  \n\nRules:\n- If a field is missing, smoothly skip it (do NOT show placeholder).\n- Always greet using the name when available.\n- Incorporate customer feedback meaningfully.\n- Mention their product naturally.\n- Add contextual warmth (e.g., \u201cin {{city}}\u201d when provided).\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  CONTENT RULES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nThe body content must be:\n\u2022 Warm, expressive, gentle, and premium  \n\u2022 NOT short \u2014 must contain *at least 3 meaningful paragraphs*  \n\u2022 Should appreciate the customer and speak about:\n  - Organic lifestyle  \n  - Purity and gentle ingredients  \n  - Skin-friendly products  \n  - Natural wellness  \n  - Why their feedback matters  \n\u2022 Include human-sounding, friendly sentences  \n\u2022 Always generate a NEW, unique, poetic *wellness quote* (1\u20132 lines)\n\nExample themes for quotes:\n- nature\u2019s calm\n- organic purity\n- inner glow\n- balance and wellness\n- mindful living\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  SIGNATURE FORMAT (STRICT)\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nSignature MUST be left-aligned inside the card:\n\nWarm regards,<br>\n\ud83c\udf3f<br>\n<strong style=\"letter-spacing:6px;\">B L O O M Y</strong><br>\n<span style=\"letter-spacing:6px;\">O R G A N I C S</span>\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  HTML OUTPUT RULES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nYour output MUST ALWAYS be:\n\n\u2022 Complete HTML email  \n\u2022 With <!doctype html>, <html>, <body>  \n\u2022 Styled WITH inline CSS  \n\u2022 NO markdown  \n\u2022 NO comments  \n\u2022 NO extra explanation  \n\u2022 Only the email body in HTML  \n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  FINAL INSTRUCTION\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nGenerate ONLY the final HTML email, nothing else.\n\n\n\nThe user details are in the google sheet, refer user prompt also\n\nafter generating the email, send using the gmail tool \n"
            }
          ]
        },
        "simplify": false,
        "builtInTools": {},
        "options": {
          "temperature": 0.7
        }
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2,
      "position": [
        -224,
        80
      ],
      "id": "3df11b25-e82f-4e25-bdca-a6ce9bda1397",
      "name": "Message a model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmailTool",
      "typeVersion": 2.1,
      "position": [
        -144,
        288
      ],
      "id": "c4b32495-b962-495f-9b34-a6aef19d95f4",
      "name": "Send a message in Gmail",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        []
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Message a model",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "03d29d83-5bde-40b1-8ff6-056d3467bf63",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "ZsL7hx1yxJ12Afzz",
  "tags": []
}

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

GmailAutoGsheetP1. Uses googleSheets, openAi, gmailTool. Event-driven trigger; 4 nodes.

Source: https://github.com/Selvarani-vka/GenAI-60days/blob/4983ec1e2fcbfcf244d247dd63c6fbb271e93cdd/n8n/GmailAutoGsheetP1.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

This template triggers when a new row appears in Google Sheets (from any intake form that writes to the sheet). It validates key fields, performs light deduplication by email or phone, and sends the d

Google Sheets Trigger, OpenAI, Gmail +2
AI & RAG

Ai Customer Feedback Sentiment Analysis. Uses stickyNote, googleSheets, openAi, formTrigger. Event-driven trigger; 9 nodes.

Google Sheets, OpenAI, Form Trigger
AI & RAG

LOOM Walkthrough: https://www.loom.com/share/4fbe06872cb8483993e7792018594f08

Google Sheets, OpenAI, Form Trigger
AI & RAG

This workflow creates a smart, automated system for capturing leads from an inquiry form, initiating personalized WhatsApp message via Unipile API, and updating your Google Sheet CRM. It uses AI to cr

Google Sheets, OpenAI, HTTP Request Tool +1
AI & RAG

Description: Automatically send structured benign payloads (PDF/HTML/JS markers) to test email gateways and sandbox response. AI-generated phishing-style content helps simulate real-world threats with

Google Sheets, OpenAI