{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e94546ef-bfe5-411f-9b9c-3ae9e1504c52",
      "name": "Manual Trigger - Start Email Campaign",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "430db32d-7a8a-4431-90f8-14117a927662",
      "name": "Get Pending Emails from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "To send",
              "lookupColumn": "Status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit#gid=0",
          "cachedResultName": "Emails"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit?usp=drivesdk",
          "cachedResultName": "Email Manager"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "88df1718-90fc-48ee-b0d9-0af76c205e8c",
      "name": "Send Email via Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        416,
        0
      ],
      "parameters": {
        "sendTo": "={{ $json.To }}",
        "message": "={{ $json.Message }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.Subject }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c1551e54-79a8-4e5d-880c-41a36e2ba393",
      "name": "Mark Email as Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        640,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Sent",
            "row_number": "={{ $('Get Pending Emails from Sheet').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "To",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "To",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subject",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit#gid=0",
          "cachedResultName": "Emails"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit?usp=drivesdk",
          "cachedResultName": "Email Manager"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "de5ec251-db30-4d13-89a7-2606f0a255f4",
      "name": "On New Email Received",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        112,
        256
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "31379967-644d-4bb0-a09f-357168c02896",
      "name": "Find Original Email Row",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        320,
        256
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.from.value[0].address }}",
              "lookupColumn": "To"
            },
            {
              "lookupColumn": "Response"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit#gid=0",
          "cachedResultName": "Emails"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit?usp=drivesdk",
          "cachedResultName": "Email Manager"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b5e7505f-2ee5-4da8-a890-a1cdedf60374",
      "name": "Save Email Response",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        528,
        256
      ],
      "parameters": {
        "columns": {
          "value": {
            "Response": "={{ $('On New Email Received').item.json.text }}",
            "row_number": "={{ $json.row_number }}"
          },
          "schema": [
            {
              "id": "To",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "To",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subject",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Response",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Response",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit#gid=0",
          "cachedResultName": "Emails"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14XPphTi6va5o2c5bb4Ue3A6-B5aeZqi8oxAhThmKRi0/edit?usp=drivesdk",
          "cachedResultName": "Email Manager"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "doc-note-1774531506929",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -150
      ],
      "parameters": {
        "width": 600,
        "height": 943,
        "content": "## Workflow Overview\n\nThis workflow automates repetitive email sending directly from Google Sheets and tracks responses, helping you reclaim hours spent on manual emailing. Simply maintain your email list in a spreadsheet with columns for recipient, subject, message, and status\u2014then let n8n handle the rest.\n\n### How It Works\n\nThe workflow has two parallel automation flows:\n\n**Email Sending Flow (Manual Trigger):**\n- Retrieves all rows from your Google Sheet where Status = \"To send\"\n- Sends personalized emails via Gmail to each recipient\n- Updates the Status to \"Sent\" to prevent duplicates\n\n**Response Tracking Flow (Automatic):**\n- Monitors your Gmail inbox every minute for new messages\n- Matches incoming emails to the sender's address in your sheet\n- Logs the response text back to a \"Response\" column\n\n### First Setup\n\n1. Create a Google Sheet with columns: To, Subject, Message, Status, and Response\n2. Connect your Google account to n8n (Google Sheets OAuth2 credential)\n3. Connect your Gmail account to n8n (Gmail OAuth2 credential)\n4. Update the document ID and sheet references to point to your own spreadsheet\n\n### Configuration\n\nReconfigure the Google Sheets document ID and sheet name to match your own email management spreadsheet. The filter looks for \"To send\" status\u2014adjust this value if you prefer different status labels."
      },
      "typeVersion": 1
    },
    {
      "id": "contact-note-1774531551219",
      "name": "Creator Contact Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -610
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 440,
        "content": "# Contact Us:\n## Milan @ SmoothWork - [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d89142925422?r=pg&d=retro&size=100)\n\n\n### We help businesses eliminate busywork by building compact business tools tailored to your process.\n### Contact us for customizing this, or building similar automations.\n\n\ud83d\udce7 hello@smoothwork.ai\n\u25b6\ufe0f [Check us on YouTube](https://www.youtube.com/@vasarmilan)\n\ud83d\udcde [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n\ud83d\udcbc [Add me on Linkedin](https://www.linkedin.com/in/mil%C3%A1n-v%C3%A1s%C3%A1rhelyi-3a9985123/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "video-note-1774531563386",
      "name": "Video Walkthrough",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -90,
        -610
      ],
      "parameters": {
        "width": 420,
        "height": 340,
        "content": "# Video Walkthrough\n[![image.png](https://vasarmilan-public.s3.us-east-1.amazonaws.com/blog_thumbnails/thumbnail_recrji7w9W5rhpyhr.jpg)](https://www.youtube.com/watch?v=jxT6XO4eUwI)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Send Email via Gmail": {
      "main": [
        [
          {
            "node": "Mark Email as Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On New Email Received": {
      "main": [
        [
          {
            "node": "Find Original Email Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Original Email Row": {
      "main": [
        [
          {
            "node": "Save Email Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending Emails from Sheet": {
      "main": [
        [
          {
            "node": "Send Email via Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger - Start Email Campaign": {
      "main": [
        [
          {
            "node": "Get Pending Emails from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}