๐ Recover lost backlinks with DataForSEO, OpenAI, Google Sheets, and Slack
โก 18 views ยท ๐ Market Research & Insights
Description
Quick overview
This workflow runs weekly to fetch recently lost backlinks from DataForSEO, deduplicate them by referring domain, and triage each loss with a live status check. It logs results to Google Sheets, drafts recovery email angles with OpenAI for actionable removals, and posts a digest to Slack.
How it works
- Runs every Monday morning (or manually) and loads your domain and thresholds such as how many days back to check and spam/rank limits.
- Queries the DataForSEO Backlinks API for backlinks with status โlostโ seen within the configured time window.
- Deduplicates results to one best lost link per referring domain, filters by rank and spam score, and removes links already recorded in the n8n Data Table watch list.
- For each remaining lost link, checks your target URL live with an HTTP request and classifies the loss into recovery buckets (your page gone, your redirect, link removed, their page gone, or unchecked).
- Uses OpenAI to write one-sentence outreach angles only for links classified as โremoved while both pages are healthy.โ
- Builds a Slack digest summarizing counts and top items, appends the full triage rows to a Google Sheets tab, and upserts each processed link into the n8n Data Table so it isnโt re-reported.
- If there is nothing new (or the API response indicates a failure), posts a โnothing new / API issueโ message to Slack, and if the workflow errors, posts an alert message to a separate Slack channel.
Setup
- Add a DataForSEO HTTP Basic Auth credential (login and password) and ensure your account can access the Backlinks API.
- Update the Settings values (domain, lost_since_days, min_rank, max_spam_score, caps, and Slack channel names) to match your environment.
- Connect Google Sheets credentials and replace the spreadsheet URL/ID and target sheet name where the โLost linksโ rows are appended.
- Connect Slack credentials and set the digest channel plus the separate #alerts (or your preferred) channel for error notifications.
- Create an n8n Data Table named
lost_link_watchwith text columnslink_id,bucket, andseen_onto track processed losses. - Add an OpenAI credential and ensure the selected chat model is available in your account (or change it to a model you can use).
๐ Nodes Used
Google Sheets, HTTP Request, Slack, Schedule Trigger, Basic LLM Chain, OpenAI Chat Model
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File