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

LinkedIn Lead Personalization: Google Drive + Apify + AI Cold Outreach Opener

Upload a Google Drive spreadsheet → parse rows and scrape LinkedIn activity → generate a one-sentence personalized opener with an LLM → write back to Google Sheets and send a Telegram summary

Some experienceStepsWorkflowPromptTip
Who
Sales/SDR teams, lead-gen agencies, growth marketers
You get
Auto-generate a single personalized cold-email opener per lead based on their latest LinkedIn post or profile, and write it back to the original sheet
You need
n8n · google-drive · google-sheets · apify · anthropic · openai · telegram

Constraints

Requires an n8n instance; configure Google Drive/Sheets OAuth2, Apify token, Anthropic and/or OpenAI API key, Telegram bot token and chat ID. The sheet must include: First Name, Last Name, Company Name for Emails, Person Linkedin Url, Email, Website. Replace all placeholders (Bearer [put your token here], [put your Telegram Bot Chat ID here]) before running. LinkedIn scraping is subject to platform rate limits and ToS.

What they did

Author marielabg published an official n8n template: place a Google Sheets lead list into a designated Drive folder to auto-trigger the workflow. The workflow parses each row, scrapes the contact's latest LinkedIn post or profile via Apify, uses OpenAI to check post recency, then routes through Anthropic Claude to generate a single personalized cold-email opener. The result is written back to the original sheet and a completion summary is sent via Telegram.

How it went

The template author reports this workflow gives sales teams scalable, authentic personalization for cold outreach to improve reply rates. Effectiveness is an author report; this site has not independently verified it.

Worth knowing

1) The workflow hard-codes the year 2025 in the OpenAI system message; update the year if running in a different year. 2) The system prompts in AI Agent1 and AI Agent_Personalization_no LN post embed the author's own business context (AI automation agency / Lead Generation Sales System); replace with your own business description when reusing. 3) LinkedIn scraping is subject to platform rate limits and blocking risk; follow platform ToS. 4) The Code1 node source contains an inconsistent variable name (return limitedItems should be return processedItems); review and fix after import. 5) Costs depend on chosen LLM models and Apify scraping volume. 6) The Telegram message references score/status fields that are not populated in the standard flow; actual notification content is mainly sheet name and link.

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

  • Anthropic Chat Model1 node: connect Anthropic API credentials.
  • Lead Enrichment is ready node: connect Telegram API credentials.
  • Anthropic Chat Model3 node: connect Anthropic API credentials.
  • Google Drive Trigger1 node: connect Google Drive OAuth2 credentials.
  • Google Drive_DownLoad1 node: connect Google Drive OAuth2 credentials.
  • OpenAI node: connect OpenAI API credentials.
  • Google Sheets Update with Personalization node: connect Google Sheets OAuth2 credentials.
  • Replace __UKH_BEARER_7__ with your real secret/token (path /nodes/7/parameters/headerParameters/parameters/2/value; literal auth header).
  • Replace __UKH_BEARER_10__ with your real secret/token (path /nodes/10/parameters/headerParameters/parameters/2/value; literal auth header).

Configuration to replace

  • Source template is n8n public workflow #8706 (~25 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. 2 literal secret value(s) replaced with __UKH_…__ placeholders.

Template retrieved: 2026-10-24

Steps

  1. Connect credentials and configure trigger

    In n8n, connect: Google Drive/Sheets (OAuth2), Apify (token), Anthropic and/or OpenAI (API key), Telegram (bot token). Open the Google Drive Trigger node and select the folder to watch (triggers when a new spreadsheet is uploaded).

  2. Prepare spreadsheet and map columns

    Ensure the uploaded sheet contains these columns: First Name, Last Name, Company Name for Emails, Person Linkedin Url, Email, Website. The Code1 node maps them to firstName, lastName, company, linkedinUrl, email, website.

  3. Replace placeholders

    In the HTTP Request nodes (Scrape LinkedIn Profile Post, Colect LinkedIn Data), replace the Authorization header with Bearer your actual Apify token. In the Telegram node (Lead Enrichment is ready), replace chatId with your actual Telegram Bot Chat ID.

  4. Scrape LinkedIn and check recency (OpenAI)

    For each contact, the workflow calls Apify LinkedIn Profile Posts to fetch the latest post, while the Date & Time node records the current date. The OpenAI node (gpt-4.1-mini) evaluates whether the post is from the current year, returning only true or false.

    Execution prompt · Source text。OpenAI node system message field

    You are a LinkedIn Post Analyzer that determines if a profile has posts from the current year. Your sole purpose is to examine LinkedIn post data and determine if there are any posts from 2025.
    TASK:
    Analyze the provided LinkedIn profile post data and determine:
    
    If the profile has ANY posts
    If any posts are from the current year (2025)
    
    OUTPUT FORMAT:
    You must respond with EXACTLY ONE of these values:
    
    "true" - If there is at least one post from 2025
    "false" - If there are no posts from 2025
    
    Do not include any explanations, reasoning, or additional text - ONLY return "true" or "false" based on your analysis.

    Execution prompt · Source text。OpenAI node user message field

    =Examine the following LinkedIn profile data and determine if there are any posts from the current year - 2025.
    LinkedIn Profile Data:
    
    Post: {{ $('Scrape LinkedIn Profile Post').item.json.text }}
    Date: {{ $('Scrape LinkedIn Profile Post').item.json.posted_at.date }}
    Current Date: {{ $json.currentDate }}
    
    If the data contains at least one post with a timestamp or date indicating it was posted in 2025, respond with only the word "true".
    If the profile has no posts OR all posts are from years prior to 2025, respond with only the word "false".
    Your entire response must be ONLY "true" or "false" with no additional text.
  5. Branch A: Generate opener from recent post (Anthropic)

    If OpenAI returns true, the AI Agent1 node calls the Anthropic Chat Model (claude-sonnet-4-20250514) to craft a single 25-30 word natural reference sentence based on the recent LinkedIn post.

    Execution prompt · Source text。AI Agent1 node user prompt field (text)

    =I need to create a personalized outreach message for a prospect. Please use this recent LinkedIn post from their profile and generate a single personalized sentence I can use in my outreach email.
    
    LinkedIn Post:
    {{ $('Scrape LinkedIn Profile Post').item.json.text }}
    
    Context: I own an AI automation agency focused on building Lead Generation Outreach and Lead Enrichment Systems. I'm reaching out to this person because their work appears relevant to our services.
    
    Generate a single personalized sentence that references their LinkedIn activity in a natural, non-intrusive way that I can include in my outreach email.

    Execution prompt · Source text。AI Agent1 node system message field (options.systemMessage)

    You are a LinkedIn Post Analyzer specialized in creating personalized outreach sentences. Your purpose is to examine the most recent LinkedIn posts from a prospect's profile and generate a single, authentic engagement sentence that can be used in cold email outreach.
    
    TASK:
    1. Use the most recent LinkedIn post provided in the user prompt.
    2. From the selected post, craft ONE personalized sentence (25-30 words maximum) that:
       - References specific content from the post without appearing stalkerish
       - Creates a genuine connection based on the post's content
       - Uses conversational language that sounds natural in an email
       - Avoids generic compliments or obvious flattery
       - Maintains a professional tone while being personable
    
    IMPORTANT: Your output must ONLY contain the single personalized sentence with no labels or prefixes. Do not include "Personalized Sentence:" or any other text before your response. Do not include greetings, introductions, or closings. Focus solely on creating a natural reference to their LinkedIn post that demonstrates genuine interest in their professional perspective.
    
    The output will be inserted directly into a CRM system with no human review, so it must be ready to use without any additional formatting or labels.
  6. Branch B: Generate opener from profile data (Anthropic)

    If OpenAI returns false, the workflow first calls the Apify LinkedIn Profile Scraper to retrieve headline, about, and experiences, then the AI Agent_Personalization_no LN post node calls Anthropic to generate a 15-25 word cold-email opener.

    Execution prompt · Source text。AI Agent_Personalization_no LN post node user prompt field (text)

    =Create ONE personalized, emotional opening sentence for a cold email to {{ $json.firstName }} {{ $json.lastName }} that will compel them to read further. Focus on our Lead Generation Sales System that saves time.
    Output only the sentence, nothing else.

    Execution prompt · Source text。AI Agent_Personalization_no LN post node system message field (options.systemMessage)

    =You are a sales development expert crafting personalized cold email opening lines without website data.
    
    Your task is to create ONE compelling opening sentence for a cold email that will grab attention immediately. focus on:
    
    1. Using the name of the lead: {{ $json.firstName }}
    2. Using their headline: {{ $json.headline }}
    3. Using their LInkedIN about section: {{ $json.about }}
    4. Current company: {{ $json.experiences[0].subtitle }}
    5. Addressing a universal pain point related to lead generation that resonates with their likely business challenges
    6. Creating curiosity about our Lead Generation Sales System
    7. Mentioning a specific benefit (saving time, reducing costs, increasing conversion rates)
    8. Making it conversational and emotionally engaging (15-25 words maximum)
    
    OUR PRODUCT: We offer a Lead Generation Sales System that automates prospect qualification, outreach sequences and lead enrichment after booking. Key benefits include:
    - 60% reduction in time spent on manual prospecting
    - 40% lower customer acquisition costs
    - 3x higher quality leads through AI-powered targeting
    - Elimination of repetitive sales tasks
    
    TONE GUIDELINES:
    - Confident but not aggressive
    - Curious rather than presumptive
    - Focused on their potential gains, not their current problems
    - Conversational, as if from one professional to another
    
    EXAMPLES OF EXCELLENT OPENERS:
    - "What if your sales team at [Company] could focus exclusively on closing while an automated system handles all prospecting, [First Name]?"
    - "The companies outperforming their competitors this quarter have one thing in common, [First Name]: they've eliminated manual lead generation entirely."
    - "Imagine cutting your customer acquisition costs by 40% while simultaneously improving lead quality, [First Name] - that's what our system recently did for a company similar to [Company]."
    - "While researching innovative companies in the [derived industry] space, [Company]'s approach stood out as perfectly positioned to benefit from automated lead generation."
    
    Remember: ONE sentence only. Make it compelling enough that they WANT to read the next line of the email.
  7. Write back to Google Sheets and loop

    The Personalization node assigns the AI output to the personalization field, along with sheetId, FileName, and SheetName. The Google Sheets Update with Personalization node matches on the email column and writes personalization back to the original sheet. The Loop Over Items1 node processes rows one by one; after all rows finish, execution proceeds to End of Loops.

  8. Send Telegram completion notification

    The End of Loops node (JavaScript Code) aggregates results from all rows,拼接 the sheet name and link, and sends a Markdown-formatted message to Telegram.

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.

This template is an n8n workflow setup guide. Follow this order: 1) Import the workflow JSON into n8n; 2) Connect Google Drive/Sheets, Apify, Anthropic/OpenAI, and Telegram credentials; 3) Select the Drive folder to watch; 4) Confirm sheet column names match the template; 5) Replace placeholders in HTTP and Telegram nodes; 6) Upload a test spreadsheet and execute once to validate.

Replace placeholders before running; first run with a small test batch

Source

LinkedIn lead personalization with Google Drive, Apify & AI · marielabg · n8n.io · 2025-09-18

Comments & feedback

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

Loading…

    Related