Category: Automations › Lead Generation & CRM · Best for: Founders doing outbound sales · Platform: n8n · Steps: 12
What it does
It finds companies on LinkedIn, the AI scores how good a fit each one is, and saves them to a sheet.
This section initiates the workflow and searches for your target companies on LinkedIn using the Ghost Genius API.
Works with: Google Sheets, OpenAI
What you get
- The n8n workflow file (
workflow.json), ready to import - This setup guide
- The list of fields to change for your own accounts (see Install below)
- Email support if you get stuck
Before you start
-
An n8n account. Easiest: n8n Cloud (free trial). Self-host for free with Docker:
docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n, then open http://localhost:5678. -
Accounts and API keys for these services:
- API key sent as an HTTP header (see the node for which service): how to connect (used by Get Company Info, Search Companies)
- Google (Sheets, Gmail, Drive, Calendar, Docs): how to connect (used by Check If Company Exists, Add Company to CRM)
- OpenAI API key: how to connect (used by AI Company Scoring)
Install
- In n8n, click Create workflow (top right).
- Click the ⋯ menu → Import from file and choose
workflow.json. Or open the file, copy everything and paste it onto the empty canvas with Ctrl/Cmd + V. - Open each node with a red warning triangle and pick or create the matching credential from the list above.
- Point these fields at your own sheets, chats and accounts:
- Check If Company Exists →
sheetName: choose your own - Check If Company Exists →
documentId: choose your own - Add Company to CRM →
sheetName: choose your own - Add Company to CRM →
documentId: choose your own
- Check If Company Exists →
- Click Save.
Test it
- Click Test workflow (or Execute workflow). Start starts it. Trigger it once with real sample data.
- Click each node to check its output. A green tick means the step worked.
- Fix any red node: it's almost always a credential or a field that still points at a sheet or chat that isn't yours.
Go live
Toggle Active (top right). From now on it runs on its own. Check Executions in the left sidebar to see every run.
How it works, step by step
- Start starts the workflow (Manual).
- Set Variables reshapes the data for the next step.
- Search Companies calls an external API (https://api.ghostgenius.fr/v2/search/companies).
- Extract Company Data uses Split Out.
- Process Each Company uses Split In Batches.
- Get Company Info calls an external API (https://api.ghostgenius.fr/v2/company).
- Filter Valid Companies checks a condition and routes items accordingly.
- Check If Company Exists uses Google Sheets.
- Is New Company? checks a condition and routes items accordingly.
- AI Company Scoring uses AI (OpenAI).
- Wait 2s pauses before continuing.
- Add Company to CRM uses Google Sheets to append.
India & US notes
India: Zoho CRM and WhatsApp follow-ups are the most common combo; you can swap the CRM node for Zoho CRM. US: HubSpot free CRM is the usual starting point.
Extra setup notes
These notes are also on the canvas as yellow sticky notes:
LinkedIn Company Search
This section initiates the workflow and searches for your target companies on LinkedIn using the Ghost Genius API.
You can filter and refine your search using keywords, company size, location, industry, or even whether the company has active job postings. Use the "Set Variables" node for it (this node also allows you to customize the AI Lead Scoring prompt).
Note that you can retrieve a maximum of 1000 companies per search (corresponding to 100 LinkedIn pages), so it's important not to exceed this number of results to avoid losing prospects.
Example: Let's say I want to target Growth Marketing Agencies with 11-50 employees. I do my search and see that there are 10,000 results. So I refine my search by using location to go country by country and retrieve all 10,000 results in several batches ranging from 500 to 1000 depending on the country.
Tips: To test the workflow or to see the number of results of your search, change the pagination parameter (Max Pages) in the "Search Companies" node. It will be displayed at the very top of the response JSON.
Company Data Processing
This section processes each company individually.
We retrieve all the company information using Get Company Details by using the LinkedIn link obtained from the previous section.
Then we filter the company based on the number of followers, which gives us a first indication of the company's credibility (200 in this case), and whether their LinkedIn page has a website listed.
The workflow implements batch processing with a 2-second delay between requests to respect API rate limits. This methodical approach ensures reliable data collection while preventing API timeouts.
You can adjust these thresholds based on your target market - increasing the follower count for more established businesses or decreasing it for emerging markets.
The last two modules checks if the company already exists in your database (using LinkedIn ID) to prevent duplicates because when you do close enough searches, some companies may come up several times.
AI Scoring and Storage
This section scores the company and stores it in a Google Sheet.
It's important to properly fill in the "Set variables" node at the beginning of the workflow to get a result relevant to your use case. You can also manually modify the system prompt.
Regardless of the score obtained, it's very important to always store the company. Note that we add a 2-second "wait" module to respect Google Sheet's rate limits.
We add the company to the "Companies" sheet in this Google Sheet which you can make a copy of and use.
This AI scoring functionality is extremely impressive once perfectly configured, so I recommend taking some time to test with several companies to ensure the scoring system works well for your needs!
Introduction
Welcome to my template! Before explaining how to set it up, here's some important information:
This automation is an alternative version of this template that differs by using Google Sheets instead of Airtable and adding a Lead Scoring system allowing for more precision in our targeting.
This automation therefore allows you, starting from a LinkedIn search, to enrich company data and score them to determine if they might be interested in your services/product.
For any questions, you can send me a DM on my LinkedIn :)
Setup
-
Create an account on Ghost Genius API and get your API key.
-
Configure the Search Companies and Get Company Info modules by creating a "Header Auth" credential: Name: "Authorization" Value: "Bearer api_key"
-
Create a copy of this Google Sheet by clicking on File => Make a copy (in Google Sheet).
-
Configure your Google Sheet credential by following the n8n documentation.
-
Create an OpenAI key here and add the credential to the "AI Company Scoring" node following the n8n documentation.
-
Add your information to the "Set Variables" node.
Tools
(You can use the API and CRM of your choice; this is only a suggestion)
-
API Linkedin : Ghost Genius API
-
API Documentation : Documentation
-
CRM : Google Sheet
-
AI : OpenAI
-
LinkedIn Location ID Finder : Ghost Genius Locations ID Finder
Troubleshooting
- "Credentials not found": open the node and select your credential again.
- Google "access blocked": in Google Cloud, add your email as a test user on the OAuth consent screen.
- Webhook not firing: copy the node's Production URL (not Test URL) into the other app, and make sure the workflow is Active.
- AI node errors: check your API key has billing enabled and the model name exists on your plan.
- Nothing happens on schedule: the workflow must be Active, and self-hosted n8n must stay running.
Need help?
Reply to your Morning Method order email and we'll help you get it running.
© Morning Method