Skip to main content

Email Automation Workflow

1. Purpose​

This workflow runs a campaign email pipeline from Google Sheets: optional platform / page audit, template merge, filtered recipient send via SMTP, and sheet updates for sent / failed status. It is used for outreach campaigns where rows in a campaign sheet drive who gets emailed and when.

Path in n8n: Personal / Email automation
Status: Active

2. Trigger​

Type: Manual

Details:

Node: Manual Trigger

Follow-up: USER INPUT - edit before run - set campaign / run parameters in n8n before executing.

Operators start the workflow from the Editor when a campaign is ready (audit + send, or send-only).

3. Step-by-Step Process​

Step 1: Manual Trigger​

What happens here: Operator starts the workflow.

Why this step is needed: Campaign sends are intentional, not cron-driven.

Step 2: USER INPUT - edit before run​

What happens here: Capture / confirm run parameters (campaign id, skip-audit flag, send-now vs wait, etc.) before the rest of the flow.

Why this step is needed: Same canvas supports audit-only, send-only, and full runs without editing many nodes.

Step 3: Read Campaign Data for Audit​

What happens here: Reads campaign rows from Google Sheets for the audit phase.

Why this step is needed: Platform URLs and recipient rows come from the campaign sheet.

Step 4: Skip Audit?​

What happens here: IF branch - skip audit and jump to send phase, or continue into platform audit.

Branches:

  • Skip - go to Start Send Phase
  • Do not skip - continue to dedupe / platform audit

Step 5: Dedupe Platform URLs​

What happens here: Code step removes duplicate platform URLs so each site is audited once.

Step 6: Has Platform?​

What happens here: IF - if there is no platform to audit, jump to send phase; otherwise enter the platform loop.

Step 7: Loop One Platform at a Time (audit loop)​

Inside the loop:

  1. Wix / DNS Page Audit API - HTTP call to audit the platform / page
  2. Parse Audit Results - normalize API response
  3. Expand to All Matching Rows - map audit result back onto all campaign rows for that platform
  4. Update Campaigns Sheet - write audit findings to Google Sheets
  5. Wait 1s - rate-limit between platforms

Why this step is needed: Enrich campaign rows with host / DNS / Wix-style audit data before emailing.

Step 8: Start Send Phase​

What happens here: Marks the transition from audit to email send (also entry when audit was skipped).

Step 9: Read Email Templates​

What happens here: Loads email templates from Google Sheets.

Step 10: Re-read Campaign Data for Send​

What happens here: Reloads campaign sheet (including any audit updates) before filtering recipients.

Step 11: Filter Unsent + CampaignID​

What happens here: Keeps only unsent rows for the selected campaign id.

Why this step is needed: Prevents duplicate sends on re-runs.

Step 12: Build Email from Template​

What happens here: Code step merges recipient / campaign fields into the template body and subject.

Step 13: Send Now?​

What happens here: IF - send immediately or wait until a scheduled send time.

Branches:

  • Wait - Wait until Send Time, then continue
  • Send now - go straight to recipient loop

Step 14: Loop One Recipient at a Time​

Inside the loop:

  1. Send via SMTP - send the built email
  2. On success - Mark Sent (update Google Sheet)
  3. On failure - Mark Failed (update Google Sheet)
  4. Wait 2s (debouncing) - pace SMTP / sheet writes

Why this step is needed: Controlled one-by-one send with durable status in the sheet.

4. Workflow Logic Summary​

  1. Operator starts run and confirms user inputs
  2. Optionally audit each unique platform URL and write results to the campaign sheet
  3. Load templates and re-read campaign rows
  4. Filter to unsent rows for the campaign
  5. Build each email from template
  6. Wait until send time if needed, then send via SMTP one recipient at a time
  7. Mark sent or failed back on the Google Sheet

5. Diagram / Screenshot​

High-level flow:

Manual Trigger
-> USER INPUT - edit before run
-> Read Campaign Data for Audit
-> Skip Audit?
yes -> Start Send Phase
no -> Dedupe Platform URLs
-> Has Platform?
no -> Start Send Phase
yes -> Loop platforms:
Audit API -> Parse -> Expand rows
-> Update Campaigns Sheet -> Wait 1s
-> Start Send Phase
-> Read Email Templates
-> Re-read Campaign Data for Send
-> Filter Unsent + CampaignID
-> Build Email from Template
-> Send Now?
no -> Wait until Send Time
yes -> (continue)
-> Loop recipients:
Send via SMTP -> Mark Sent / Mark Failed -> Wait 2s

6. Dependencies​

Google Sheets​

  • Campaign data (audit + send)
  • Email templates
  • Sent / failed status columns
  • Requires Auth: Yes (Google Sheets OAuth in n8n)

SMTP​

  • Purpose: Deliver campaign emails
  • Node: Send via SMTP
  • Requires Auth: Yes (SMTP credentials in n8n)

Page / Platform Audit API​

  • Purpose: Wix / DNS style page audit per platform URL
  • Node: Wix / DNS Page Audit API (HTTP)
  • Requires Auth: As configured on the HTTP node / API key in n8n

External Services​

ServiceRole
Google SheetsCampaign + templates + status
SMTP providerOutbound email
Audit / page APIPlatform URL checks

n8n Instance​

Workflow URL: https://agent.fsgarage.in/workflow/705c1VbvDQeEsink

Workflow Name: Email automation

Workflow ID: 705c1VbvDQeEsink

n8n Instance URL: https://agent.fsgarage.in