Skip to main content

Domain-specific web content crawler with depth control & text extraction

Workflow preview

Workflow preview
100%
Domain-specific web content crawler with depth control & text extraction preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This template implements a recursive web crawler inside n8n. Starting from a given URL, it crawls linked pages up to a maximum depth (default: 3), extracts text and links, and returns the collected...

Best for

  • Document Extraction automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.splitinbatches, n8n-nodes-base.if, n8n-nodes-base.html, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.merge

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Le Nguyen.

Original n8n.io source

1.1 Workflow description

Title
Domain-specific web content crawler with depth control & text extraction
Workflow name
Domain-specific web content crawler with depth control & text extraction

This template implements a recursive web crawler inside n8n. Starting from a given URL, it crawls linked pages up to a maximum depth (default: 3), extracts text and links, and returns the collected content via webhook.


🚀 How It Works

  1. Webhook Trigger
    Accepts a JSON body with a url field.
    Example payload:

    { "url": "https://example.com" }

  2. Initialization

    • Sets crawl parameters: url, domain, maxDepth = 3, and depth = 0.
    • Initializes global static data (pending, visited, queued, pages).
  3. Recursive Crawling

    • Fetches each page (HTTP Request).
    • Extracts body text and links (HTML node).
    • Cleans and deduplicates links.
    • Filters out:
      • External domains (only same-site is followed)
      • Anchors (#), mailto/tel/javascript links
      • Non-HTML files (.pdf, .docx, .xlsx, .pptx)
  4. Depth Control & Queue

    • Tracks visited URLs
    • Stops at maxDepth to prevent infinite loops
    • Uses SplitInBatches to loop the queue
  5. Data Collection

    • Saves each crawled page (url, depth, content) into pages[]
    • When pending = 0, combines results
  6. Output

    • Responds via the Webhook node with:
      • combinedContent (all pages concatenated)
      • pages[] (array of individual results)
    • Large results are chunked when exceeding ~12,000 characters

🛠️ Setup Instructions

  1. Import Template
    Load from n8n Community Templates.

  2. Configure Webhook

    • Open the Webhook node
    • Copy the Test URL (development) or Production URL (after deploy)
    • You’ll POST crawl requests to this endpoint
  3. Run a Test
    Send a POST with JSON:

    curl -X POST https://<your-n8n>/webhook/<id>
    -H "Content-Type: application/json"
    -d '{"url": "https://example.com"}'

  4. View Response
    The crawler returns a JSON object containing combinedContent and pages[].


⚙️ Configuration

  • maxDepth
    Default: 3. Adjust in the Init Crawl Params (Set) node.

  • Timeouts
    HTTP Request node timeout is 5 seconds per request; increase if needed.

  • Filtering Rules

    • Only same-domain links are followed (apex and www treated as same-site)
    • Skips anchors, mailto:, tel:, javascript:
    • Skips document links (.pdf, .docx, .xlsx, .pptx)
    • You can tweak the regex and logic in Queue & Dedup Links (Code) node

📌 Limitations

  • No JavaScript rendering (static HTML only)
  • No authentication/cookies/session handling
  • Large sites can be slow or hit timeouts; chunking mitigates response size

✅ Example Use Cases

  • Extract text across your site for AI ingestion / embeddings
  • SEO/content audit and internal link checks
  • Build a lightweight page corpus for downstream processing in n8n

⏱️ Estimated Setup Time

~10 minutes (import → set webhook → test request)

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 4 - Loop Links (Batches)

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 1

Block 5 - IF Crawl Depth OK?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 6 - Extract Body & Links

Type / Role
n8n-nodes-base.html - html
Config choices
Version 1

Block 7 - Attach URL/Depth to HTML

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Fetch HTML Page

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Seed Root Crawl Item

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 10 - Collect Pages & Emit When Done

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Store Page Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 2

Block 12 - Merge Web Pages

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 13 - Combine & Chunk

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 15 - Init Globals

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Init Crawl Params

Type / Role
n8n-nodes-base.set - set
Config choices
Version 2

Block 17 - Requeue Link Item

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Queue & Dedup Links

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

3. Summary Table

Workflow Domain-specific web content crawler with depth control & text extraction
Complexity advanced
Nodes 18
Categories Document Extraction
Author Le Nguyen
Published 23 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8852/8852.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Domain-specific web content crawler with depth control & text extraction do?

This template implements a recursive web crawler inside n8n. Starting from a given URL, it crawls linked pages up to a maximum depth (default: 3), extracts text and links, and returns the collected...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction use case.