Apify to Google Sheets, clean leads for Gmail outreach
Your outreach process probably isn’t “hard.” It’s just annoyingly fragile. One bad export, one messy CSV column, one rushed personalization, and suddenly you’re staring at bounced emails, angry replies, and a sheet full of half-usable leads.
This Apify Gmail outreach setup hits agency owners running campaigns for clients, but founders and marketing leads doing their own prospecting feel it too. You will collect targeted leads, clean and structure them automatically, then send personalized emails at a controlled pace that doesn’t look like spam.
Below is the exact workflow logic, what it automates, and what results you can expect once it’s running in n8n.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Apify to Google Sheets, clean leads for Gmail outreach
flowchart LR
subgraph sg0["On form submission Flow"]
direction LR
n0@{ icon: "mdi:database", form: "rounded", label: "Add to Google Sheet", pos: "b", h: 48 }
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>On form submission"]
n2@{ icon: "mdi:robot", form: "rounded", label: "Apollo URL Generator", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Run Apify"]
n4@{ icon: "mdi:cog", form: "rounded", label: "Limit", pos: "b", h: 48 }
n5@{ icon: "mdi:robot", form: "rounded", label: "Structured Output Parser", pos: "b", h: 48 }
n6@{ icon: "mdi:robot", form: "rounded", label: "Parse Lead Data", pos: "b", h: 48 }
n7@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n8@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items1", pos: "b", h: 48 }
n9@{ icon: "mdi:cog", form: "rounded", label: "Wait", pos: "b", h: 48 }
n10@{ icon: "mdi:cog", form: "rounded", label: "No Operation, do nothing", pos: "b", h: 48 }
n11@{ icon: "mdi:message-outline", form: "rounded", label: "message confirming end of work", pos: "b", h: 48 }
n12@{ icon: "mdi:message-outline", form: "rounded", label: "Sending cold email", pos: "b", h: 48 }
n14@{ icon: "mdi:robot", form: "rounded", label: "Creating a email", pos: "b", h: 48 }
n15@{ icon: "mdi:database", form: "rounded", label: "Leads without email", pos: "b", h: 48 }
n16@{ icon: "mdi:brain", form: "rounded", label: "Parse Data module", pos: "b", h: 48 }
n17@{ icon: "mdi:brain", form: "rounded", label: "LINK PASER", pos: "b", h: 48 }
n7 --> n15
n7 --> n0
n9 --> n8
n4 --> n6
n3 --> n4
n17 -.-> n2
n6 --> n7
n14 --> n8
n8 --> n11
n8 --> n12
n16 -.-> n6
n1 --> n2
n12 --> n9
n0 --> n14
n2 --> n3
n5 -.-> n6
n11 --> n10
end
subgraph sg1["Flow 2"]
direction LR
n13@{ icon: "mdi:message-outline", form: "rounded", label: "Sending cold email Gmail", pos: "b", h: 48 }
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n1 trigger
class n2,n5,n6,n14 ai
class n16,n17 aiModel
class n7 decision
class n0,n15 database
class n3 api
classDef customIcon fill:none,stroke:none
class n1,n3 customIcon
The Problem: Lead lists are messy and outreach is risky
Lead generation tools can find names all day. The problem is everything that happens after. You pull a list, then you spend an hour cleaning columns, hunting for missing emails, and trying to figure out who’s actually worth contacting. Then comes the worst part: writing “personalized” emails that still sound templated because you’re rushing. If you send too fast, deliverability takes a hit. If you go too slow, your pipeline dries up. It’s a constant tradeoff, and frankly it gets old.
The friction compounds, especially once you try to scale beyond a tiny batch.
- Exported leads rarely arrive in the structure your CRM or sheet needs, so you end up doing cleanup by hand.
- Some contacts have no email address, and mixing them into your “send list” creates chaos later.
- Personalization becomes copy-paste theater, which means more edits and more second-guessing.
- Sending too many emails too quickly can trigger spam filters and hurt your domain reputation.
The Solution: Apify finds leads, Sheets organizes, AI personalizes, Gmail sends safely
This workflow turns lead sourcing and outreach into a repeatable system. It starts with a simple form where you define who you want: job title, company size, keywords, and location. From that, OpenAI generates a clean Apollo search URL, and an Apify Actor pulls matching contacts and companies. The workflow caps the number of records per run (so you don’t accidentally blast through a huge list), then uses AI again to parse the raw lead data into consistent fields like name, title, LinkedIn, company, and email. Leads with emails go into your main Google Sheet and into the email-drafting path, while leads missing emails are written to a separate sheet for enrichment later.
Next, OpenAI drafts a personalized version of your fixed email template for each lead. Finally, n8n sends the emails one-by-one using a loop with a Wait delay in between, then sends you a “campaign complete” confirmation when the batch finishes.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you want to contact 5 new leads per run (the workflow’s built-in cap) and you run it every 10 minutes during a prospecting block. Manually, finding 5 leads, cleaning fields, splitting “no email” contacts, and drafting 5 decent emails can easily take about 45 minutes. With this workflow, you spend roughly 2 minutes filling the form, then wait for Apify + AI processing and the paced sending. The hands-on work drops to a few minutes, and you still keep the “send slow” safety that protects deliverability.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Apify to fetch targeted leads via an Actor
- Google Sheets for lead storage and routing
- OpenAI API key (get it from the OpenAI dashboard)
Skill level: Intermediate. You’ll connect credentials, choose the right Sheets, and adjust limits and wait times safely.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
Form intake starts the run. You enter your targeting details (job title, company size, keywords, location), which keeps list-building consistent across your team.
AI turns your intent into a real search. The workflow uses an OpenAI model to generate an Apollo search URL from the form inputs, then uses an HTTP request to run an Apify Actor against that target.
Leads are cleaned and structured. Another AI step parses the results into usable fields (name, email, title, LinkedIn, company, links) and even produces a short summary so you know why the lead is relevant.
Sheets and sending are routed automatically. Leads with emails are appended to your main Google Sheet, drafted into personalized outreach copy, then sent via Gmail (or SMTP) using a loop with a Wait delay between sends. Missing-email leads go to a separate sheet for later enrichment.
You can easily modify the record cap and the sending delay based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
Start the workflow by capturing new lead details from the embedded form.
- Add and open Form Intake Trigger.
- Define the form fields that your outreach process needs (e.g., name, company, website, email).
- Copy the form URL generated by Form Intake Trigger and embed it where leads will submit data.
- Connect Form Intake Trigger to Apollo Link Builder.
Step 2: Connect Google Sheets
Store and triage lead data using the two Sheets nodes that capture successful and missing email records.
- Open Append to Sheets and select the target spreadsheet and sheet tab for valid lead records.
- Map fields from the incoming lead data into the columns you want to store.
- Open Leads Missing Email and select the spreadsheet/sheet where you log leads without an email.
- Connect Conditional Gate to both Sheets nodes as shown in the workflow.
- Credential Required: Connect your Google Sheets credentials in both Append to Sheets and Leads Missing Email.
Step 3: Set Up AI Processing and Lead Enrichment
Configure the AI and enrichment chain that builds Apollo links, scrapes data, interprets results, and drafts outreach copy.
- Open Apollo Link Builder and configure the prompt to generate the appropriate Apollo search link or query for the lead.
- Open Link Parsing Model and select the OpenAI model you want to use for link generation and parsing.
- Connect Link Parsing Model to Apollo Link Builder as its language model (already wired in the workflow).
- Open Execute Apify Request and set the Apify endpoint, HTTP method, and authorization headers required by your Apify actor.
- Open Cap Record Count and set a max record limit to control how many leads are processed per run.
- Open Interpret Lead Details and verify it uses Chat Data Parser as the language model and Structured Result Parser as the output parser.
- Open Draft Outreach Email and configure the prompt and message format for the final outreach email.
- Credential Required: Connect your OpenAI credentials in Link Parsing Model, Chat Data Parser, and Draft Outreach Email.
Step 4: Configure Output and Email Delivery
Route leads through the conditional gate, send outreach emails in batches, and send completion notices.
- Open Conditional Gate and define the rule that determines whether a lead is missing an email address.
- Confirm the branch where leads with missing emails go to Leads Missing Email, and valid leads go to Append to Sheets.
- Verify Append to Sheets outputs to Draft Outreach Email so every stored lead gets a drafted email.
- Open Batch Iterator and set the batch size to control outreach throughput.
- Batch Iterator outputs to both Completion Notice Email and Dispatch Outreach Email in parallel.
- Open Dispatch Outreach Email and configure recipient, subject, and message body fields using the drafted email content.
- Open Completion Notice Email and set the recipient for the end-of-run notification.
- Credential Required: Connect your Gmail credentials in Completion Notice Email and Utility: Gmail Send.
- Credential Required: Connect your SMTP credentials in Dispatch Outreach Email.
Step 5: Configure Timing and Loop Control
Throttle outreach sends to prevent rate limits and keep the loop stable.
- Open Pause Timer and set your desired wait duration between outreach sends.
- Confirm Dispatch Outreach Email outputs to Pause Timer to enforce delays.
- Ensure Pause Timer outputs back to Batch Iterator to continue batching.
- Leave Idle Pass-Through as-is; it serves as a terminal node after the completion notice.
Step 6: Test and Activate Your Workflow
Run a full test to verify data flow from form intake to outreach delivery.
- Click Execute Workflow and submit a test entry through the Form Intake Trigger form.
- Confirm that Execute Apify Request returns lead data and Cap Record Count limits the output as expected.
- Check Append to Sheets and Leads Missing Email to ensure the conditional routing works.
- Verify that Draft Outreach Email creates a draft and that Dispatch Outreach Email sends a message.
- Confirm a completion message is sent by Completion Notice Email once batches finish.
- When satisfied, toggle the workflow to Active for production use.
Common Gotchas
- Google credentials can expire or need specific permissions. If things break, check the Google connection status in n8n Credentials and confirm the Sheets scope is allowed.
- If you’re using Wait nodes or external processing, execution times vary. Bump up the wait duration if downstream email steps fail because they’re running before the loop is ready.
- Default prompts in AI nodes are generic. Add your brand voice inside the “Draft Outreach Email” prompt early or you’ll be editing every message anyway.
Frequently Asked Questions
About 30 minutes once your keys and accounts are ready.
No. You’ll mostly connect credentials, pick the right Sheets, and adjust the record limit and Wait delay.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage and your Apify plan.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll swap the sending step. Replace the Gmail-based sender with an SMTP/Outlook email node in the “Dispatch Outreach Email” part of the workflow, then keep the Loop and Wait logic the same. Common tweaks include changing the sender identity, adjusting the pause duration, and routing replies to a shared inbox.
Usually it’s the bearer token. Regenerate your Apify API token, update it in the “Execute Apify Request” credentials or headers, and confirm the Actor you’re calling is available in your Apify account. If it fails only sometimes, you may be hitting rate limits or the target source is returning inconsistent data, which means the parser can choke on unexpected fields.
In practice, most people run it in small batches (like 5 per run) and repeat on a schedule. On n8n Cloud Starter, you’re limited by monthly executions; on self-hosting there’s no execution cap, so it mostly depends on your server and the speed of Apify + OpenAI steps. If you want higher volume, increase the Limit node gradually and keep the Wait delay conservative so deliverability stays healthy.
Often, yes, because this workflow relies on branching, looping, and paced sending, and those get expensive or awkward in many “simple automation” tools. n8n also gives you tighter control over data shaping before it hits Google Sheets, which matters when you’re separating leads with emails from leads without emails. The other big factor is cost at volume: self-hosting means you can run it as much as you want. Zapier or Make can still win if you only need a tiny two-step flow and you don’t care about batching logic. Talk to an automation expert if you want a quick recommendation for your exact use case.
Set it up once, then let it quietly pull, clean, draft, and send while you focus on calls and follow-ups. Honestly, that’s the part that moves revenue.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.