AI Chatbot for Web Extraction using Bright Data MCP and OpenRouter - n8n Workflow

Build a powerful AI chatbot with this advanced n8n workflow. Integrate Bright Data MCP and OpenRouter LLMs for real-time web data extraction via a responsive Telegram messenger interface.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Technical users needing robust web scraping capabilities via a chat interface.
Developers looking for sophisticated n8n templates integrating LLMs and external tools.
Teams who require real-time data lookups powered by an n8n workflow and Bright Data MCP.
Automation specialists building custom AI agents within n8n.

Overview

This comprehensive n8n workflow addresses the challenge of creating responsive AI chat agents that perform heavy computational tasks like web scraping or data extraction. By leveraging an asynchronous sub-workflow, this primary n8n trigger ensures the user always sees a 'typing...' indicator in Telegram while the main AI Agent is busy processing the request.

The central component is the LangChain AI Agent n8n node, which uses the Bright Data Mobile Collector Proxy (MCP) tool alongside an OpenRouter language model. This powerful combination allows the agent to execute real-time web searches and structured data extraction based on user queries received through the Telegram webhook n8n trigger. This structure showcases advanced usage of n8n templates for tool-augmented AI operations and complex flow control within n8n.

How it Works

The entire process is initiated by the Receive Message Trigger from Telegram n8n trigger, which acts as a webhook.


  1. Trigger and Response Initiation: The n8n workflow starts when a message is received. Immediately, it executes the Sub-workflow to trigger Typing Action n8n node asynchronously.

  2. Typing Loop (Sub-workflow): The sub-workflow begins with the Execute Workflow Trigger n8n node, receiving the chat ID and execution ID. It sends a Typing action via Telegram, waits 10 seconds, and then uses the n8n node to check the status of the main execution. If the main n8n workflow is still running, it loops back to send the 'Typing action' again, providing continuous feedback.

  3. AI Execution: The main n8n workflow passes the incoming message text to the AI Agent n8n node. This agent uses the OpenRouter Chat Model for reasoning and the Simple Memory n8n node for context retention.

  4. Tool Use: If the query requires external data, the AI Agent activates the MCP Client n8n node, which utilizes the Bright Data tool to perform the necessary web search or scraping.

  5. Deliver Result: Once the AI Agent finishes processing, the final output is routed to the Send AI’s output to the user via Telegram n8n node, delivering the result back to the user.

  6. Error Handling: If the status check in the loop detects that the main n8n workflow failed, the process branches to the Reply Error Message n8n node to notify the user of the failure.

Installation Guide


  1. Import n8n Workflow: Import this JSON into your n8n instance. This advanced n8n workflow requires linking two components: the main flow and the asynchronous typing loop.

  2. Telegram Webhook Setup: Activate the Receive Message Trigger from Telegram n8n trigger and copy the generated webhook URL. Manually run the Set Telegram Webhook HTTP Request n8n node, replacing the API token and URL placeholders with your specific Telegram bot token and the copied webhook URL.

  3. Credential Configuration: Ensure credentials are set up for all required n8n node connections:

OpenRouter: Configure the API key credential for the OpenRouter Chat Model n8n node.
Telegram: Set up the Telegram API credentials for all Telegram n8n node instances.
* n8n API: Configure the internal n8n API credential for the Check if the execution in N8N is finished n8n node to enable internal status polling.

  1. Bright Data MCP Setup: Ensure the Bright Data MCP service is running locally or accessible via a server. Update the SSE endpoint in the MCP Client n8n node if it differs from the default http://localhost:8000.

  2. Sub-Workflow Linking: Verify that the Sub-workflow to trigger Typing Action n8n node correctly references the necessary secondary n8n template for the typing loop logic.

Node Details

Receive Message Trigger from Telegram (Webhook n8n trigger): The entry point for this n8n workflow, configured to listen for new Telegram messages.
AI Agent (LangChain Agent n8n node): The core intelligence, configured to use OpenRouter as the LLM, Simple Memory for conversational context, and the MCP Client tool for data retrieval.
OpenRouter Chat Model (LangChain LLM n8n node): Provides LLM capabilities, specified using the high-performance anthropic/claude-3.7-sonnet model.
MCP Client (LangChain Tool n8n node): Integrates Bright Data’s Mobile Collector Proxy capabilities, allowing the AI agent to initiate real-time, high-quality web data extraction via a specified SSE endpoint.
Sub-workflow to trigger Typing Action (Execute Workflow n8n node): Executes an asynchronous n8n workflow to send continuous 'typing' feedback, essential when processing time-consuming tasks like those initiated by the n8n trigger.
Check if the execution in N8N is finished (n8n node): Used within the sub-workflow loop to check the completion status of the parent n8n workflow using its execution ID, governing when the 'typing' action stops.


  • Send AI’s output to the user via Telegram (Telegram n8n node): Sends the final, extracted, or reasoned output from the AI Agent back to the Telegram chat.

Related n8n Workflows

Free

Nodes: 14 Nodes
Updated: December 26 2025
View all

Featured*