Skip to main content

Query-to-action automation with Bright Data MCP & OpenAI GPT

Workflow preview

Workflow preview
100%
Query-to-action automation with Bright Data MCP & OpenAI GPT preview
Open on n8n.io

Important notice

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

1. Workflow Overview

AI Agent Template with Bright Data MCP Tool Integration This template obtains all the possible tools from Bright Data MCP, process this through chatbot, then run any tool based on the user's que...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.toolworkflow, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.if, n8n-nodes-base.set

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Query-to-action automation with Bright Data MCP & OpenAI GPT
Workflow name
Query-to-action automation with Bright Data MCP & OpenAI GPT

📌 AI Agent Template with Bright Data MCP Tool Integration

This template obtains all the possible tools from Bright Data MCP, process this through chatbot, then run any tool based on the user's query


❓ Problem It Solves

The problem that the MCP solves is the complexity and difficulty of traditional automation, where users need to have specific knowledge of APIs or interfaces to trigger backend processes. By allowing interaction through natural language, automatically classifying and routing queries, and managing context and memory effectively, MCP simplifies complex data operations, customer support, and workflow orchestration scenarios where inputs and responses change dynamically.


🧰 Pre-requisites

Before deploying this template, ensure you have:

  • An active n8n instance (self-hosted or cloud).
  • A valid OpenAI API key (or any AI models)
  • Access to Bright Data MCP API with credentials.
  • Basic familiarity with n8n workflows and nodes.

⚙️ Setup Instructions

  1. **Install the MCP Community Node in N8N

    • In your N8N self-hosted instance, go to Settings → Community Nodes.
    • Search and install n8n-nodes-mcp.
  2. Configure Credentials:

    • Add your OpenAI API key or any AI mdeols to the relevant nodes. If you want other AI model, please replace all associated nodes of OpenAI in the workflow
    • Set up Bright Data MCP client credentials in the installed community node (STDIO)
    • Obtain your API in Bright Data and put it in Environment field in the credentials window. It should be written as API_Key=<your api key from Bright Data>


🔄 Workflow Functionality (Summary)

  • User message triggers the workflow.
  • AI Classifier (OpenAI) interprets the intent and maps it to a tool from Bright Data MCP.
  • If no match is found, the user is notified.
  • If more information is needed, the AI requests it.
  • Memory preserves context for follow-up actions.
  • The tool is executed, and results are returned contextually to the user.

> 🧠 Optional memory buffer and chat memory manager nodes keep conversations context-aware across multiple messages.


🧩 Use Cases

  • Data Scraping Automation: Trigger scraping tasks via chat.
  • Lead Generation Bots: Use MCP tools to fetch, enrich, or validate data.
  • Customer Support Agents: Automatically classify and respond to queries with tool-backed answers.
  • Internal Workflow Agents: Let team members trigger backend jobs (e.g., reports, lookups) by chatting naturally.

🛠️ Customization

  • Tool Matching Logic: Modify the AI classifier prompt and schema to suit different APIs or services.
  • Memory Size and Retention: Adjust memory buffer size and filtering to fit your app’s complexity.
  • Tool Execution: Extend the "Execute the tool" sub-workflow to handle additional actions, fallback strategies, or logging.
  • Frontend Integration: Connect this with various platforms (e.g., WhatsApp, Slack, web chatbots) using the webhook.

✅ Summary

This template delivers a powerful no-code/low-code agent that turns chat into automation, combining AI intelligence with real-world tool execution. With minimal setup, you can build contextual, dynamic assistants that drive backend operations using natural language.

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 - AI Agent

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

Block 2 - When chat message received

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

Block 3 - OpenAI Chat Model

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

Block 4 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 5 - Execute the tool

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

Block 6 - OpenAI

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

Block 7 - If1

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

Block 8 - Edit Fields1

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

Block 9 - Chat Memory Manager

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

Block 10 - Simple Memory1

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 11 - If

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

Block 12 - Return error message for no matching tool

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

Block 13 - Sticky Note

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

Block 14 - Tool call by the chatbot

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

Block 15 - Sticky Note1

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

Block 16 - Sticky Note2

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

Block 17 - Sticky Note3

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

Block 18 - Sticky Note4

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

Block 19 - Copy the output from the MCP tool

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

Block 20 - Bright Data MCP - List tools

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

Block 21 - Bright Data MCP - Execute a tool

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

3. Summary Table

Workflow Query-to-action automation with Bright Data MCP & OpenAI GPT
Complexity advanced
Nodes 21
Categories Engineering, AI Chatbot
Author Cyril Nicko Gaspar
Published 15 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4077/4077.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 Query-to-action automation with Bright Data MCP & OpenAI GPT do?

AI Agent Template with Bright Data MCP Tool Integration This template obtains all the possible tools from Bright Data MCP, process this through chatbot, then run any tool based on the user's que...

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.