ChatGPTSalesFinding leadsAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

LinkedIn Lead Generation with GPT-4o, Apify, Google Sheets, and Phantombuster

Audience description → GPT-4o generates Apollo search URL → Apify scrapes leads → GPT-4o writes icebreakers → Write to Google Sheets → Optionally trigger Phantombuster connection requests

Some experienceStepsWorkflowPromptTip
Who
Sales/SDR teams, indie hackers, or anyone automating LinkedIn lead sourcing and initial outreach
You get
Input audience description via form, auto-generate Apollo search URL, scrape lead data, write personalized icebreakers, log to Google Sheets, and optionally auto-trigger Phantombuster to send LinkedIn connection requests
You need
n8n · openai · http-request · google-sheets

Constraints

Requires an n8n instance; OpenAI API key (GPT-4o access); Apify API token; Google Service Account credentials (shared with target sheet); Phantombuster API key and Agent ID; Apollo account (debugging only). Costs depend on API usage; source provides no specific pricing.

What they did

Author basil published an n8n workflow template that collects audience descriptions via form, uses GPT-4o to generate an Apollo search URL, scrapes lead data via an Apify Actor, then uses GPT-4o again to write personalized icebreakers for each lead, logs results to Google Sheets, and optionally triggers Phantombuster to batch-send LinkedIn connection requests. The template contains 12 nodes (7 functional + 5 sticky notes) with complete connections.

How it went

Source provides no specific execution results, success rates, or ROI data. Claims in the description that the flow can scale 'from 10 to 1,000+ connections/day' and that 'micro-icebreakers outperform canned intros' are author-reported (author_report), not verified by this site.

Worth knowing

Google Sheets documentId and sheetName are empty strings in the source workflow.json and must be configured manually; Apify and Phantombuster API credentials appear as placeholders (YOUR_TOKEN_HERE key / api key goes here / your agent id goes here) in the source and will fail if not replaced; the Aggregate node's specific aggregation logic is not detailed in the description, only labeled as 'batched output'; to collect leads and icebreakers without sending connection requests, disable the final Phantombuster node; source contains multiple spelling errors ('descritpion', 'audinece', 'proscpect', 'incebreaker') that do not affect function but require exact field name matching.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Genrating appolo Url for apify to scrap node: connect OpenAI API credentials.
  • Genrate ice breaker by scraping linkedin data node: connect OpenAI API credentials.
  • Replace __UKH_BEARER_3__ with your real secret/token (path /nodes/3/parameters/headerParameters/parameters/1/value; literal auth header).

Configuration to replace

  • Source template is n8n public workflow #7182 (~12 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use. 1 literal secret value(s) replaced with __UKH_…__ placeholders.

Template retrieved: 2026-10-24

Steps

  1. Collect audience description via form

    Configure the Form Trigger node in n8n. Form title is 'Audience', with one required field 'descritpion of the company ' (source spelling), placeholder prompting for company location, size, industry, etc. Publish the form URL; users or SDRs submit target audience descriptions through it.

  2. Generate Apollo search URL with GPT-4o

    Configure an OpenAI node, select GPT-4o model, enable JSON output. System prompt sets a sales assistant role; user prompt includes an Apollo URL template example, explains modifiable fields (location, titles, keywords), and requests output in {"SearchUrl":"..."} format. Input variable is the form-submitted 'descritpion of the company '.

    Execution prompt · Source text。OpenAI node system message (node: Genrating appolo Url for apify to scrap)

    you are a helpful intelligent sales assitant

    Execution prompt · Source text。OpenAI node user message template (node: Genrating appolo Url for apify to scrap)

    your task is to take as input of a prospect audeince and turn that into a apollo serach URL here is an example of the URL 
    https://app.apollo.io/#/people?personLocations[]=United%20States&includedOrganizationKeywordFields[]=tags&includedOrganizationKeywordFields[]=name&sortAscending=false&sortByField=recommendations_score&qKeywords=marketing%20agency%20&page=1&personTitles[]=ceo%20and%20founder&personTitles[]=co-founder
    This url describes a search for peolpe that are 
    -located in the united state 
    - Holds the titles: CEO,founder,co founder 
    - have a keyword assosiated with "marketing "agency"
    you can only make changes to these fields only 
    return your response as using this format  
    {"SearchUrl":"SearchUrlgoeshere"}

    Execution prompt · Source text。OpenAI node dynamic input expression

    ={{ $json['descritpion of the company '] }}
  3. Scrape leads via Apify Actor

    Configure an HTTP Request node, method POST, URL fixed at https://api.apify.com/v2/acts/jljBwyyQakqrL1wae/run-sync-get-dataset-items. JSON body includes cleanOutput: true and a url field referencing the SearchUrl from the previous step. Headers must include Accept: application/json and Authorization: Bearer YOUR_TOKEN_HERE key (replace YOUR_TOKEN_HERE key with actual Apify API token).

    Execution prompt · Source text。HTTP Request node JSON body (node: Run apify actor to scrap the proscpect)

    ={
        "cleanOutput": true,
        "url": "{{ $json.message.content.SearchUrl }}"
    }

    Execution prompt · Source text。HTTP Request node Authorization header value (placeholder to be replaced)

    Bearer YOUR_TOKEN_HERE key
  4. Generate personalized icebreakers with GPT-4o

    Configure a second OpenAI node, same GPT-4o model. System prompt is 'you are a helpful '; user prompt requests an ultra-short, punchy icebreaker based on LinkedIn profile data, specifying template format 'Hey {{name}}, loved seeing {{thingaboutThem}}, Im also into {{plausibleTieIN}}, thought Id connect.' Emphasizes paraphrasing (not direct quoting from LinkedIn fields), avoiding clichés, and maintaining a laconic, spartan style. Output format: {"Icebreaker":"..."}. Input is lead data returned by Apify.

    Execution prompt · Source text。OpenAI node system message (node: Genrate ice breaker by scraping linkedin data)

    you are a helpful

    Execution prompt · Source text。OpenAI node user message template (node: Genrate ice breaker by scraping linkedin data)

    your task is to input a bunch of linkedin profile information of a user, and then geenrate a very short,very punchy incebreaker that i can use as a variable in my connection request 
    return your output in this format 
    {"Icebreaker":"Icebreakergoeshere"}
    in order to ensure icebreakers are punchy and high quality, make them follow this template 
    Hey {{name}}, loved seeing {{thingaboutThem}}, Im also into {{plausibleTieIN}}, thought Id connect.
    For {{thingaboutThem}}and {{plausibleTiein}}, never use the exact information provided in a linked in field. instead,always parapharse. this makes it seems human written instead of just an automated message, Also, make it super short. Dont say stuff like ""passionate about truning vision into reality " or anything like that be extremely Laconic and spartan.

    Execution prompt · Source text。OpenAI node dynamic input expression

    map the prospect's LinkedIn or details from the previous node.
  5. Append icebreakers to Google Sheets

    Configure a Google Sheets node, operation appendOrUpdate. Pre-create a Google Sheet with columns: name, linkedin url, company website, description, and other columns generated by the Apify node. Map corresponding fields in the node; documentId and sheetName must be filled with actual sheet details (left empty in source, user-configured). Ensure Google Service Account credentials are shared with the sheet.

    Setup guidance · Source text。Sticky Note guidance for Google Sheets column setup

    Create a google sheet add relevant colums name,linkedin url,company website,description and oter coloums that are genrated by the apify node and map them accordingly
  6. Aggregate data batch

    Configure an Aggregate node, select aggregateAllItemData. This node aggregates multi-row Google Sheets output into batched format, preparing for the Phantombuster trigger. No additional prompts needed.

  7. Trigger Phantombuster to send connection requests (optional)

    Configure an HTTP Request node, method POST, URL https://api.phantombuster.com/api/v2/(your agent id goes here)/launch, replacing (your agent id goes here) with actual Agent ID. Header: X-Phantombuster-Key: api key goes here (replace with actual API key). No request body. Disable this node if auto-sending connection requests is not needed.

    Setup guidance · Source text。Sticky Note guidance for Phantombuster HTTP Request configuration

    Triggers the phantom buster a platform that sends linkedin connection requests. to your leads, you have to go to the api credentials to get the relevant url but i hvae harcoded one for the connection request and add your api key to the header, and the agent ID of the agent you are running will be available in the url of the agent in phantombuster thats it no body  is needed.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are an n8n workflow setup assistant. The user wants to reproduce a LinkedIn lead generation automation. Help them: 1) Confirm all required credentials (OpenAI, Apify, Google Sheets, Phantombuster); 2) Import workflow.json and configure each node step-by-step; 3) Replace all placeholders (YOUR_TOKEN_HERE key, your agent id goes here, documentId/sheetName); 4) Run one end-to-end test with sample data. Do not execute actual API calls or send real connection requests on behalf of the user.

To adjust icebreaker style, modify the user prompt in step 4's OpenAI node; to target different industries, modify the prompt in step 2.

Source

LinkedIn lead generation with GPT-4o, Apify scraping, and automated outreach · basil · n8n.io · 2025-08-08

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related