Real-Time Sales Pipeline Analytics using AI Agents and Google Sheets - n8n Workflow

Automate real-time sales pipeline analysis using an n8n workflow, Bright Data scraping, and OpenAI agents. Extract complex CRM metrics and store actionable insights directly in Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Sales Operations (Sales Ops) professionals needing reliable, automated pipeline reporting via n8n.

  • Data analysts looking for sophisticated web scraping and data structuring tools built within n8n.

  • Users seeking advanced n8n templates for combining AI models (OpenAI) with external scraping services (Bright Data).

  • Business owners who require live visibility into sales health without performing manual data extraction.

Overview

Keeping track of sales pipeline health often requires tedious manual extraction from CRM dashboards. Furthermore, many modern CRM interfaces are protected against basic web scraping. This powerful n8n workflow solves this by utilizing an advanced AI Agent paired with the Bright Data MCP (Mobile Collector Proxy) n8n node. This integration allows the n8n workflow to reliably access and extract data, even from complex interfaces. The agent performs complex calculations (like total value, status counts, and identifying top reps) entirely within the automation flow. The final structured data is then instantly appended to a Google Sheet using the dedicated Google Sheets n8n node, making this one of the most practical n8n templates for building dynamic sales dashboards and reports.

How it Works

This robust n8n workflow begins with the Manual Trigger n8n trigger, initiating the process upon demand.


  1. URL Definition: The workflow first uses a Set n8n node to define the target CRM URL. This URL is passed to the AI agent as the data source.

  2. AI Agent Execution: The core of the automation is the "Monitor Sales Pipeline (CRM AI Agent)" n8n node. This agent, powered by an OpenAI Language Model, receives a detailed prompt instructing it to scrape the data, simulate essential CRM fields (stage, value, status), and perform five distinct analytical tasks.

  3. Scraping via Bright Data: The AI agent dynamically calls the Bright Data MCP n8n node, which executes the scrapeasmarkdown tool to retrieve the complex sales pipeline data.

  4. Data Structuring: The raw output is processed by a Structured Output Parser n8n node, ensuring the resulting metrics are clean and predictable JSON—a crucial step for robust n8n workflow automation.

  5. Metric Splitting: A custom Code n8n node, named "Split Metrics for Sheet Rows," then processes the resulting single JSON object containing all summary metrics. This n8n node iterates through all status counts, stage counts, and top rep details, transforming the data into multiple individual items. This preparation is essential for the next step, as Google Sheets requires data row-by-row.

  6. Google Sheets Storage: Finally, the Google Sheets n8n node receives these separated metrics and appends them row by row to the designated spreadsheet, completing the automated data delivery of this powerful n8n workflow.

Installation Guide

To deploy and utilize this sales pipeline n8n workflow effectively, follow these steps:


  1. Import the n8n Workflow Template: Copy the provided JSON code and paste it into your n8n instance using the 'Import Workflow' function.

  2. OpenAI Credentials Setup: Configure the credentials for the "AI Brain" n8n node. You will need an active OpenAI API key for the agent to function.

  3. Bright Data Credentials Setup: Configure the credentials for the "Bright Data MCP" n8n node, linking your Bright Data account. This is necessary for the scraping tool to execute correctly within the n8n environment.

  4. Google Sheets Setup: Set up OAuth2 credentials for the Google Sheets n8n node. Ensure your Google service account has write access to the target spreadsheet document.

  5. Customize Source URL: In the "Set Source URL" n8n node, replace the placeholder URL with the actual CRM dashboard or data endpoint you wish to analyze. This variable drives the entire n8n workflow.

  6. Activate and Test: Activate the n8n workflow and run the n8n trigger manually to confirm all connections and the analytical data flow are functioning as expected.

Node Details

⚡ Trigger: Start CRM Scraper (Manual Trigger n8n node)
Function: Acts as the entry point and primary n8n trigger, allowing the user to initiate the pipeline analysis on demand.
Key Configuration: Simple execution start.
🔗 Set Source URL (Set n8n node)
Function: Explicitly defines the web page URL containing the sales data to be scraped by the AI Agent.
Key Configuration: Defines the URL assignment.
🤖 Monitor Sales Pipeline (CRM AI Agent n8n node)
Function: The orchestrator that processes the prompt, determines that scraping is needed, calls the Bright Data tool, and structures the analysis of pipeline metrics.
Key Configuration: A detailed text prompt instructing the AI to simulate and analyze complex sales metrics from the scraped data.
🌐 Bright Data MCP (MCP Client Tool n8n node)
Function: Serves as the web access tool called by the AI agent to execute data extraction (scrapeasmarkdown) from the defined source URL.
Key Configuration: Uses executeTool operation with scrapeasmarkdown tool name.
🧾 Clean JSON Parser (Structured Output Parser n8n node)
Function: Guarantees that the analyzed output from the AI agent adheres to a strict schema, ensuring data integrity before writing to the spreadsheet.
Key Configuration: Provides a JSON example schema for metrics like totalLeads, statusBreakdown, and topReps.
🧩 Split Metrics for Sheet Rows (Code n8n node)
Function: A critical preparation step. It transforms the single complex JSON output item into multiple, flat data items (one per metric/rep), making the data consumable by the Google Sheets n8n node for row-by-row insertion.
Key Configuration: Custom JavaScript logic to iterate and map metrics to 'Metric Type', 'Label', and 'Value'.
📊 Store CRM Insights (Google Sheets n8n node)
Function: The final action n8n node. It connects to Google Sheets and appends the stream of analyzed metrics as new rows, maintaining a historical record of pipeline health.
* Key Configuration: Operation set to append, mapping the input fields to the sheet columns.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos

Featured*