Automate Lost Backlink Checks with n8n & DataForSEO

Discover how to automatically verify lost backlinks using n8n with Google Sheets and the DataForSEO API. This workflow saves you hours by updating backlink statuses precisely, preventing costly SEO mistakes.
googleSheets
httpRequest
code
+4
Workflow Identifier: 1948
NODES in Use: manualTrigger, googleSheets, code, splitInBatches, httpRequest, wait, stickyNote

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Sarah, an SEO specialist tasked with managing hundreds of backlinks to her website. Backlinks are crucial for SEO success, but many of them can go “lost” or become “nofollow,” reducing their value. Manually checking each backlink’s status on multiple pages by visiting URLs and cross-referencing spreadsheets is a nightmare. Sarah wastes over 10 hours monthly on this repetitive, error-prone process, risking lost revenue and decreased search rankings.

This exact pain is what our n8n workflow tackles head-on. It automatically checks if backlinks still exist and are “live” (dofollow) by crawling the backlink URLs and scanning for the presence of her landing page links. If a backlink is lost or marked nofollow, the workflow updates a Google Sheet so Sarah always has accurate, up-to-date backlink data without lifting a finger.

2. What This Automation Does

When you trigger this n8n workflow, here’s exactly what happens:

  • Reads backlink URLs and landing page data from a specified range in a Google Sheet.
  • Extracts the domain from each backlink URL for targeted crawling.
  • Sends each domain and URL pair to the DataForSEO On-Page Analysis API for live crawling and backlink data retrieval.
  • Waits 20 seconds to allow API processing.
  • Requests link status data from DataForSEO on each crawl task.
  • Runs code to determine if the backlink exists on the landing page and whether it’s dofollow or lost.
  • Updates the original Google Sheet with the backlink status (“Live”, “Lost”, or “Lost (Nofollow)”).

This workflow saves Sarah up to 10 hours per month by automating backlink verification, reducing manual errors, and enabling proactive SEO fixes.

3. Prerequisites ⚙️

  • n8n account (cloud or self-hosted). For self-hosting check options like Hostinger.
  • Google Sheets account with a sheet containing backlink data:
    Columns: Backlink URL and Landing page.
    Data range specified like D1:E.
  • Google Sheets OAuth2 credentials connected in n8n.
  • DataForSEO API account:
    API key and password for HTTP Basic Authentication.

4. Step-by-Step Guide to Build the Workflow

Step 1: Add Manual Trigger

Navigate to Nodes → Triggers → Manual Trigger. This node lets you run the workflow on-demand for testing or scheduled runs. Name it “When clicking ‘Test workflow'”. Leave parameters default.

Outcome: You will be able to start this workflow manually.

Common mistake: Forgetting to connect this node forward will prevent the workflow from starting.

Step 2: Read Data from Google Sheets

Add a Google Sheets node. Connect it from the manual trigger. Choose the proper spreadsheet (documentId) and the specific sheet (sheetName) containing backlink data. Set the range to D1:E to select “Backlink URL” and “Landing page” columns.

Outcome: Node returns each row of your backlink data for processing.

Common mistake: Incorrect range or sheet name will result in empty or wrong data.

Step 3: Clean and Extract Domain from Backlink URL Using Code Node

Add a Code node connected after Google Sheets. Use this JavaScript code:

return items.map(item => {
  let url = item.json['Backlink URL'];
  let domain = url.match(/https?://(?:www.)?([^/]+)/)[1];
  return { json: { domain, url } };
});

This extracts the domain from the backlink URL to target the right part in the next API call.

Outcome: Each item now has domain and url for further processing.

Common mistake: Ensure “Backlink URL” matches exactly your sheet’s column name; typos cause runtime errors.

Step 4: Loop Over Items in Batches

Use the SplitInBatches node named “Loop Over Items”. Connect it from the Code node. It processes URLs one by one or in sets (batch size defaults to 1).

Outcome: Prevents overwhelming the API by pacing requests.

Common mistake: Leaving batch size too high may exceed API rate limits.

Step 5: Send POST Request to DataForSEO for On-Page Task

Add an HTTP Request node. Configure it with:

  • Method: POST
  • URL: https://api.dataforseo.com/v3/on_page/task_post
  • Authentication: HTTP Basic with your API credentials
  • Body (JSON):
  • [
      {
        "target": "{{ $json.domain }}",
        "start_url": "{{ $json.url }}",
        "max_crawl_pages": 1
      }
    ]
    

    Outcome: Starts the backlink crawling task on DataForSEO.

    Common mistake: Incorrect JSON template or missing credentials causes POST failure.

    Step 6: Add a Wait Node to Delay 20 Seconds

    Insert a Wait node to pause the workflow for 20 seconds after submitting the task request. This ensures DataForSEO has time to process the crawl.

    Outcome: Avoids fetching incomplete results.

    Common mistake: Skipping this may lead to empty or partial data in the next step.

    Step 7: Request Links Data from DataForSEO

    Add another HTTP Request node configured as:

    • Method: POST
    • URL: https://api.dataforseo.com/v3/on_page/links
    • Authentication: HTTP Basic (same as previous)
    • Body (JSON):
    • [
        {
          "id": "{{ $json.tasks[0].id }}"
        }
      ]
      

      Outcome: Fetches backlink link info from DataForSEO based on the crawl task ID.

      Note: This node uses batching set to size 1 to maintain sync.

      Common mistake: Not setting “id” dynamically causes invalid request errors.

      Step 8: Check Backlink Status Using Code Node

      Add a Code node to analyze the returned data. Use this code:

      const result = $json.tasks?.[0]?.result?.[0];
      const links = result?.items || [];
      
      let backlink = $('Reads Google Sheets').item.json['Landing page'];
      
      let foundLink = links.find(link => link.link_to === backlink);
      
      let status = "Lost";
      if (foundLink) {
        status = foundLink.dofollow ? "Live" : "Lost (Nofollow)";
      }
      
      return {
        json: {
          backlink: backlink,
          status: status
        }
      };
      

      This determines if the backlink is “Live” or “Lost” based on the DataForSEO crawl results.

      Outcome: Outputs backlink status for updating the sheet.

      Common mistake: Mismatched “Landing page” URL between sheet and code causes false negatives.

      Step 9: Update the Google Sheet with Backlink Status

      Add a Google Sheets node configured to append or update the sheet rows. Map the columns as:

      • Backlink URL – from Loop Over Items node
      • Status – from previous Code node

      Ensure “Backlink URL” column exists and is used as the matching column to update correct rows in your sheet.

      Outcome: Your Google Sheet now automatically reflects “Live,” “Lost,” or “Lost (Nofollow)” status per backlink.

      Common mistake: Mistyping column names or missing columns break row updates.

      5. Customizations ✏️

      • Adjust crawl depth: In the HTTP Request to DataForSEO “task_post” node, change max_crawl_pages from 1 to higher to scan more linked pages.
      • Batch size tuning: In “Loop Over Items” node, increase batch size to process multiple backlinks concurrently, balancing API limits.
      • Add Slack notifications: Insert a Slack node to notify your team in real-time about lost backlinks when updating the sheet.
      • Check only dofollow links: Modify the status Code node to ignore nofollow backlinks and mark them as “Skipped.”
      • Extend data range: Update the Google Sheets read node range to include additional backlink metadata (e.g., anchor text).

      6. Troubleshooting 🔧

      Problem: “HTTP 401 Unauthorized” error on DataForSEO requests.
      Cause: API credentials missing or incorrect.
      Solution: Go to Credentials in n8n, re-enter your DataForSEO API key and password, then retry.

      Problem: Google Sheets node returns empty data.
      Cause: Incorrect sheet name or data range.
      Solution: Confirm sheet and range exactly match your Google Sheet setup and test connectivity.

      Problem: Backlink status never updates in sheet.
      Cause: Column names mismatch or wrong mapping.
      Solution: Verify the “Backlink URL” and “Status” column names match your sheet exactly and check the mapping settings in the Google Sheets update node.

      7. Pre-Production Checklist ✅

      • Confirm Google Sheets has columns labeled exactly “Backlink URL” and “Landing page.”
      • Test DataForSEO API credentials with a manual API call.
      • Run workflow once manually with a single URL to confirm expected results.
      • Check the logs in n8n for any errors and fix before scheduling.
      • Backup your Google Sheet data before running bulk updates.

      8. Deployment Guide

      Once you confirm the workflow runs successfully manually, you can:

      • Activate the workflow in n8n so it listens for manual triggers or scheduled executions.
      • Set up a CRON trigger if you want routine backlink status checks (e.g., weekly/monthly).
      • Monitor runs via n8n’s execution log to ensure backlinks are checked regularly.
      • Adjust batching and wait times to stay within API rate limits as volume grows.

      9. FAQs

      Q: Can I use another backlink checking API instead of DataForSEO?
      A: Yes, but you’d need to adjust the HTTP Request nodes to fit the new API’s endpoints and response format.

      Q: Does this workflow consume a lot of API credits?
      A: Each backlink crawl counts as one task against your DataForSEO plan. Adjust batch size and frequency to manage costs.

      Q: Is my backlink data safe?
      A: Your data is handled securely between your Google Sheets and DataForSEO over HTTPS with authenticated API calls.

      10. Conclusion

      By building this automated lost backlink checker, you’ve empowered Sarah—and yourself—to regain hours previously spent chasing broken backlinks. You now have a reliable, hands-off system that verifies backlink health and updates your key marketing data instantly.

      The workflow directly saves you over 10 hours monthly and lets you react faster to SEO changes. Next steps could include expanding this system to monitor keyword rankings or integrate Slack alerts for real-time team updates.

      Keep experimenting with n8n to automate repetitive SEO tasks that drain your time and energy, and watch your productivity soar.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free