Oleksandra Khilova / n8n for link building
automation · free n8n workflowsn8n for link building: a free pipeline with a Telegram bot
Three things eat most of the time in link building: finding donors, filtering out junk and writing each site a real email. I built an n8n pipeline that does all three and leaves a person one decision: who is actually worth emailing. Below is how it works. All four workflows are free to download and import into your own n8n.
I showed this pipeline on an SEO Baza stream with Olesia Korobka. The stream also covers the Ahrefs API (what is paid, what is free, how the limits work), the new Collaborator API 2.0 and why I connect APIs rather than MCP servers.
Stream “n8n for link building: building your own automation with APIs”, SEO Baza, 47 min, in Ukrainian. Watch on YouTube.
What the pipeline does
Four workflows share one Google Sheet, and each has a single job:
LB-0 Telegram bot /start → config check → starts the search; buttons for the next steps LB-1 Discovery+metrics 8 donor sources → free cleanup → Ahrefs DR → traffic and trend LB-2 AI context reads the donor page → OpenAI scores relevance and finds a hook ✋ a person sets approved = yes LB-3 Contacts+email Snov.io finds the email → OpenAI writes it → paused Snov campaign
You never need to open n8n to work with it: everything runs from the Telegram bot, and campaign settings live in the Config tab. To switch to another site or niche, you change rows in the sheet and leave the workflow code alone.
Where donors come from: 8 sources
LB-1 collects candidates from several sources at once. Each one is switched on by its own row in Config; an empty row switches it off.
| Source | What it gives | Config row |
|---|---|---|
| Google (SerpApi) | Articles on your asset's exact topic in the target country | serp_topic_queries |
| Google, adjacent niches | Sites next to the topic where a link still looks natural | serp_adjacent_queries |
| Google AI Overview | Sites that Google's AI answer links to | ai_overview_followup |
| ChatGPT with web search | Sites the LLM cites when answering a buyer's question | llm_queries |
| Google News | Media covering the topic: the base for digital PR | news_queries |
| Competitor donors (Ahrefs) | Who already links to similar pages. The workflow finds competitors in the Google top itself | competitor_find_query |
| domains-monitor.com | Domains with a given word in the name in selected zones | dm_keywords |
| Collaborator API 2.0 | Sites from the catalogue, already with DR, traffic and placement price | collab_keywords |
There is also an Input tab: add domains by hand and they go through the same filters.
How not to burn your Ahrefs budget
Ahrefs is the most expensive part of this automation, so paid requests come last, after free filters have removed the noise:
- Free cleanup. Domain normalisation, duplicates, a blacklist (social networks, marketplaces, giants) and stop words in the domain name. Anything already in the sheet is not checked again.
- DR gate. One Domain Rating request first. Traffic and its 6-month trend are checked only for sites with DR of at least
min_dr. - Per-run limit.
max_domains_per_runsets how many new domains go to Ahrefs per run. Use 3 for the first test. - Traffic ceiling. Giant sites almost never reply to outreach, so
max_trafficdrops them before the AI step. - A person before paid contacts. Snov.io charges a credit per email search, so it runs only for sites a person approved.
AI scoring: what the site is about and how to hook it
LB-2 takes sites with good metrics and reads the exact page where the donor was found, through Jina Reader. If the site is behind Cloudflare or the page is empty, the workflow uses Google snippets for site:domain. OpenAI returns:
- the site type and topic;
- a relevance score from 0 to 10 (the threshold is
min_relevance); - red flags: link farms and “write for us” sites with many unrelated categories, openly sold links, adult, casino, pharma, crypto, thin or AI-spun content, parked domains, brands that never link out;
- hooks for the email and the page where a link would fit.
The site gets the status awaiting_approval, rejected_ai or needs_review, and a report arrives in Telegram.
Why a person approves
Fully automatic outreach turns into spam fast. So the pipeline has one manual step: in the Prospects tab you filter awaiting_approval, read the AI's reasoning and set approved = yes for the sites worth emailing. That takes minutes instead of hours of searching.
Emails: personal, not a template
LB-3 looks up the email in Snov.io and checks the site's contact page. Then a stronger OpenAI model writes the email by rules that work in cold outreach:
- the first sentence is about the donor's specific article, not “I love your site”;
- 50–110 words, the tone of a fan writing to an editor;
- a 3–7 word subject about their page, no clickbait;
- one simple question at the end instead of a list of offers;
- banned clichés: “hope this finds you well”, “quick question”, “mutually beneficial”, “backlink”, “SEO”, “guest post”;
- the email is written in the donor site's language (or the one set in Config).
Finished emails land in a Snov.io drip campaign that stays paused. You review them and start the campaign yourself. Without Snov, the email stays in the sheet with the status draft_ready.
If a donor doesn't reply, there is a fallback: LB-1 looks up every site with good metrics in the Collaborator catalogue. If a placement can be bought there, the row gets the price and a link.
A Telegram bot for the team
LB-0 is the entry point for the whole team. The bot only obeys chat IDs listed in Config → tg_chat_id; anyone else just sees their own chat ID.
| Command | What it does |
|---|---|
/start | Link to the sheet and the “✅ Check and run” button |
/check | Checks Config and says exactly what to fix |
/lb2 | AI-score the next batch of sites |
/lb3 | Find contacts and write emails for approved sites |
/help | Command help |
Why APIs, not MCP
MCP servers are handy when an AI agent works with data in a chat. In a pipeline that runs on a schedule, I care about other things: every request is visible in n8n, limits and budget are numbers in Config, and the same input always gives the same result. A direct HTTP request to an API gives exactly that. AI stays where it is really needed: scoring a site and writing an email.
Bonus: finding domains to buy with the domains-monitor API
domains-monitor is useful beyond donor search. For the GTA 6 Style Map campaign I looked for domains with GTA, GTA6, GTA VI and Grand Theft Auto in the name that can be bought right away. The funnel:
| Step | Domains |
|---|---|
| Everything the API returned for “gta” and its variants | ~150,000 |
| After a strict filter: gta as a separate word, no “sewingtable”, “wingtaxi” or Toronto's GTA | ~9,800 |
| The domain's page says it is for sale | 246 |
| With a fixed price, buyable without negotiation | 96 |
Two takeaways. Substring search in domain names returns a lot of junk, so build the filter on word boundaries, not on “contains”. And of 246 domains “for sale”, only 96 showed a price: the rest were “make an offer” or pages blocked to bots.
What one run costs
| Service | What you pay for |
|---|---|
| Ahrefs API | A domain from search costs 3 requests (DR, traffic now and 6 months ago), about 150 units. Competitor donors already come with DR and traffic, so they cost nothing extra. A refdomains row costs 5 units. |
| SerpApi | 1 search per query, plus 1 site:domain when a site is behind Cloudflare |
| OpenAI API | 1 call to score a site and 1 per email (about $0.005 per email on gpt-4.1) |
| Snov.io API | 1 credit per email search, approved sites only |
| Collaborator API | 1 request per word in collab_keywords; no Ahrefs spend on these sites |
| domains-monitor | 1 search per “zone × word” pair, API limit 100 searches per hour |
How to install
- Sheet. Upload
linkbuilding-template.xlsxto Google Drive and open it as Google Sheets. Config already holds an example. - Import. n8n → Workflows → Import from File, all 4 JSON files one by one.
- Links. In the Google Sheets nodes pick your sheet; in the
Run LB-1/2/3nodes pick the matching workflows. - Keys. Create credentials for Google Sheets, Ahrefs, SerpApi, OpenAI, Telegram, Snov.io and Collaborator; which field goes where is in the README. The domains-monitor token goes into the
DM Queriesnode. - Bot. Create a bot in @BotFather, put your chat ID into
tg_chat_id, activate LB-0. - Test.
max_domains_per_run = 3→/startin the bot → “Check and run”.
Don't use one of the services? Leave its Config rows empty: that source switches off and the rest keeps working.
n8n pitfalls I ran into
$('Node').all()returns only the node's last run. If a node gets data from several branches, it runs several times and the report sees only the last batch. Fix: loop over all runs with$('Node').all(0, run).- Execution order depends on canvas position. In v1 mode branches run top to bottom. But a Merge waiting for all inputs lets later branches run first, so hang “after the main flow” branches off a node placed after the Merge.
- Webhook data sits in
$json.body, not at the root. - Ahrefs v3 requires the
dateparameter on every endpoint, otherwise it returns 400. - Keys in Code nodes are exported with the JSON. Remove them before sharing a workflow. If the file has already gone public, rotate the key.
FAQ
Do I need paid n8n?
No. The workflows run on n8n Cloud and self-hosted n8n. The Telegram trigger needs a public URL, so self-hosted needs a domain or a tunnel.
Can it work without Ahrefs?
Search and AI scoring will work; the DR and traffic filter won't. You can keep only Collaborator: its catalogue provides DR, traffic and price itself.
Does the pipeline send emails on its own?
No. Emails land in a paused Snov.io campaign, and you start it. That is a deliberate safeguard against spam.
Which niches does it work for?
Any. Niche, asset, country, email language and thresholds are all set in Config. The template ships with the GTA 6 Style Map campaign as an example.
Can you build something like this for my project?
Yes. I set up pipelines like this for specific tasks: link building, monitoring, reporting, content. I can also adapt this workflow to your tools and niche. Message me on Telegram or by email and briefly describe what takes up most of your manual time right now.