LinkedIn Lead Finder & Gemini-Powered Personalized Outreach (n8n Template)
Input keywords + purpose → Gemini generates Boolean search string → Google Custom Search fetches LinkedIn results → Write to Google Sheets → Loop to generate personalized outreach messages → Optional email notification
- Who
- Sales/BD teams, recruiters, marketers, or founders who want to automate LinkedIn prospecting and first-draft outreach
- You get
- Automatically fetch up to 20 LinkedIn leads via form trigger and generate personalized outreach drafts for each, saved to Google Sheets with optional email notification
- You need
- n8n · google-gemini · http-request · google-sheets · email
Constraints
Prerequisites: n8n instance; Google Sheets account with target spreadsheet; Google Custom Search Engine (CSE) with 'Search the entire web' enabled and valid cx + API key; Gemini API access (googlePalmApi credential); SMTP credentials (optional). Costs: Google Custom Search and Gemini API billed per platform pricing; n8n per hosting plan. Boundaries: HTTP Request defaults hl=vi and gl=vn—adjust to your locale; Writing message node is actually gemini-1.5-flash, not gemini-2.5-flash; Google Sheets documentId and SMTP addresses are placeholders.
What they did
Template author cong-nguyen built an n8n workflow: after a user submits keywords and purpose via form, Gemini generates a Boolean search string with site:linkedin.com; Google Custom Search API returns up to 20 results; results are written to Google Sheets, then split and looped through one by one. For each entry, Gemini generates a personalized outreach message based on company info and purpose, writing it back to Sheets; an optional email notification concludes the flow.
How it went
The author reports this workflow automates LinkedIn prospecting and outreach drafting, reducing manual search and copy-paste (author_report). Up to 20 results are returned; email notification is optional.
Worth knowing
1. Model mismatch: Scout and template title list gemini-2.5-flash, but workflow.json shows the 'Writing message' node uses gemini-1.5-flash while 'Create boolean search strings' uses gemini-2.5-flash. Change manually if unification is needed. 2. Locale defaults: HTTP Request has hl=vi (Vietnamese) and gl=vn (Vietnam); non-Vietnam users must adjust. 3. Placeholders: HTTP Request key/cx, Google Sheets documentId (=xxxxx), and SMTP from/to emails are examples—must be replaced with real values. 4. Sheets column names must exactly match: name, linkedin_url, des, message. 5. This site has not tested the workflow; reproduction=not_tested. Validate CSE and Gemini credentials with test data before production use.
n8n workflow template
Structure checked · Not run-testedUse “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
- Create boolean search strings node: connect Google Gemini/PaLM API credentials.
- Writing message node: connect Google Gemini/PaLM API credentials.
- Update sheet node: connect Google Sheets OAuth2 credentials.
- Send email node: connect smtp credentials.
- Append row in sheet node: connect Google Sheets OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #7983 (~13 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.
Template retrieved: 2026-10-24
Steps
Configure Form Trigger and Gemini Boolean Query Node
After importing the template into n8n, configure the Form submit trigger: form title is 'Find LinkedIn Accounts by keywords and Write personal message for contact', with two fields: 'Keywords to find Company / Professional' and 'Purpose of Contact'. Then configure the 'Create boolean search strings' Gemini node: select model gemini-2.5-flash and bind the googlePalmApi credential. The prompt is embedded and should not need editing, but verify the credential is active.
Execution prompt · Source text。Create boolean search strings node, messages.values[].content field
=You are a tool that generates Boolean search strings for Google, in order to search for companies or professionals on LinkedIn. # Task: - Based on the keyword and the purpose, generate a suitable keyword string for searching on LinkedIn. - Only return the keyword string, without any explanation or additional information. - Always add site:linkedin.com to the keyword string. # Input: Keyword: {{ $json['Keywords to find Company / Professional'] }} Purpose: {{ $json['Purpose of Contact'] }}Configure Google Custom Search HTTP Request Node
Open the 'Get Linkedin Company' HTTP Request node; URL is fixed at https://www.googleapis.com/customsearch/v1. In Query Parameters, enter your CSE API key, cx (search engine ID), and query string (referencing previous Gemini output). Set num to 20; adjust hl and gl to your target locale (default vi/vn is Vietnam/Vietnamese—change to e.g. en/us).
Configure Google Sheets Append Node
Configure the 'Append row in sheet' Google Sheets node: bind googleSheetsOAuth2Api credential, select target spreadsheet and Sheet1. In Columns mapping: name → {{ $json.title }}, linkedin_url → {{ $json.link }}, des → {{ $json.pagemap.metatags[0]["og:description"] }}. Ensure the spreadsheet has matching column headers.
Configure Loop Split and Gemini Message Writer Node
The 'Split Out' node splits the HTTP result items array into individual entries; 'Loop Over Items' processes them one by one. For each entry, the 'Writing message' Gemini node (actually configured as gemini-1.5-flash, not gemini-2.5-flash) binds to the same googlePalmApi credential. It reads the entry's name/des and the form-submitted Purpose of Contact to generate a personalized outreach message. Then the 'Update sheet' node updates the message field matched by linkedin_url.
Execution prompt · Source text。Writing message node, messages.values[].content field
=You are an AI that drafts outreach messages. # Requirements Based on the purpose: {{ $('Form submit').item.json['Purpose of Contact'] }} and the company information: name: {{ $json.name }} description: {{ $json.des }} Write a suitable and personalized outreach message for that specific company. Only return the outreach message, without any explanation or additional text. If some information is missing, use placeholders.Configure Optional Email Notification Node
If email notification is desired, configure the 'Send email' node: bind SMTP credential, set fromEmail, toEmail, subject (default 'Your auto writing message be completed'), and html body with a link to the sheet. This node is optional; the core flow works without it.
Publish Form and Test
Save and publish the workflow, activating the Form trigger. Submit a test set of keywords and purpose via the public form link. Verify: 1) new rows appear in Sheets; 2) the message column is populated; 3) email is received (if enabled). First test with a small keyword set to confirm hl/gl and CSE configuration.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant: confirm inputs and permissions, then configure nodes step by step
This block is the prompt. Ads are never placed here.
You are setting up an n8n workflow to automate LinkedIn lead finding and personalized outreach drafting. Please confirm the following prerequisites:
1. n8n instance (cloud or self-hosted)
2. Google Sheets account with a blank spreadsheet, columns: name, linkedin_url, des, message
3. Google Custom Search Engine ('Search the entire web' enabled) API key and cx
4. Gemini API credential (googlePalmApi)
5. SMTP credentials (optional)
Once confirmed, configure the form trigger, both Gemini nodes, HTTP Request, Google Sheets read/write, loop, and optional email nodes in order. Note that the Writing message node is currently gemini-1.5-flash; change manually if a different model is desired.Check all 5 prerequisites first, then configure node by node; pay special attention to CSE cx/key, hl/gl locale parameters, and replacing the Sheets documentId placeholder with a real value.
Source
LinkedIn lead finder & Gemini-powered personalized outreach with Google Sheets · cong-nguyen · n8n.io · 2025-08-28
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.