Skip to main content

AI agent that can scrape webpages

Workflow preview

Workflow preview
100%
AI agent that can scrape webpages 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 is a PoC of a ReAct AI Agent capable of fetching random pages (not only Wikipedia or Google search results). On the top part there's a manual ...

Best for

  • Engineering automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
AI agent that can scrape webpages
Workflow name
AI agent that can scrape webpages

⚙️🛠️🚀🤖🦾

This template is a PoC of a ReAct AI Agent capable of fetching random pages (not only Wikipedia or Google search results).

On the top part there's a manual chat node connected to a LangChain ReAct Agent. The agent has access to a workflow tool for getting page content.

The page content extraction starts with converting query parameters into a JSON object. There are 3 pre-defined parameters:

  • url – an address of the page to fetch
  • method = full / simplified
  • maxlimit - maximum length for the final page. For longer pages an error message is returned back to the agent

Page content fetching is a multistep process:

  1. An HTTP Request mode tries to get the page content.

If the page content was successfuly retrieved, a series of post-processing begin:

  1. Extract HTML BODY; content
  2. Remove all unnecessary tags to recuce the page size
  3. Further eliminate external URLs and IMG scr values (based on the method query parameter)
  4. Remaining HTML is converted to Markdown, thus recuding the page lengh even more while preserving the basic page structure
  5. The remaining content is sent back to an Agent if it's not too long (maxlimit = 70000 by default, see CONFIG node).

NB:

  • You can isolate the HTTP Request part into a separate workflow.
  • Check the Workflow Tool description, it guides the agent to provide a query string with several parameters instead of a JSON object.

Please reach out to Eduard is you need further assistance with you n8n workflows and automations!

Note that to use this template, you need to be on n8n version 1.19.4 or later.

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 - Sticky Note2

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

Block 4 - Sticky Note3

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

Block 5 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 6 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 7 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 8 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 9 - QUERY_PARAMS

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

Block 10 - CONFIG

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

Block 11 - HTTP Request

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

Block 12 - Is error?

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

Block 13 - Stringify error message

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

Block 14 - Exctract HTML Body

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

Block 15 - Remove extra tags

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

Block 16 - Simplify?

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

Block 17 - Simplify output

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

Block 18 - Convert to Markdown

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

Block 19 - Send Page Content

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

Block 20 - HTTP_Request_Tool

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2

3. Summary Table

Workflow AI agent that can scrape webpages
Complexity advanced
Nodes 20
Categories Engineering, AI Chatbot
Author Eduard
Published 06 Dec 2023

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2006/2006.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 AI agent that can scrape webpages do?

️ ️ This template is a PoC of a ReAct AI Agent capable of fetching random pages (not only Wikipedia or Google search results). On the top part there's a manual ...

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 Engineering, AI Chatbot use case.