Lead Source Quality Analyzer using HighLevel, Sheets, and Slack - n8n Workflow

Automate marketing performance tracking with this robust n8n workflow. Fetch HighLevel won deals, calculate lead source metrics, and report instantly via Google Sheets and Slack.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing Analysts needing automated lead source performance reports.
Sales Operations teams requiring real-time visibility into deal status.
Users looking for high-quality n8n templates integrating CRM and reporting tools.
Automation specialists deploying production-ready n8n workflows for business intelligence.

Overview

Analyzing lead source quality is critical for optimizing marketing spend. This robust n8n workflow solves the tedious task of manually exporting and processing HighLevel CRM data. By utilizing n8n, you can establish an automated pipeline that pulls all opportunities, filters for 'won' deals, calculates performance metrics (deal count and total revenue per source), and distributes the results immediately.

This specific n8n workflow ensures data integrity by logging raw successful deals into Google Sheets while providing immediate, actionable insights via a summary report sent to Slack. It also includes a secondary path to instantly alert teams about non-won opportunities, making this n8n automation a complete CRM monitoring solution.

How it Works

The execution of this comprehensive n8n workflow begins with the manual n8n trigger, initiating the data fetch process.


  1. Data Retrieval (HighLevel): The n8n node configured for HighLevel fetches all opportunities available in the CRM.

  2. Filtering (If Node): The flow then enters an If n8n node, which splits the stream. It checks if the opportunity status is exactly equal to won.

  3. Won Path (Analytics): Opportunities that match 'won' proceed down the true path. First, the raw data is logged into Google Sheets for archival and detailed analysis. Next, a Function n8n node executes custom JavaScript to aggregate the data, totaling the number of deals and the total amount for each unique leadSource.

  4. Reporting (Slack): The aggregated metrics generated by the Function n8n node are immediately formatted and sent as a structured report to a specified channel using a Slack n8n node, providing instant performance feedback.

  5. Non-Won Path (Alerts): Opportunities that are not 'won' (e.g., lost, pending) flow down the false path, where a dedicated Slack n8n node sends individual alerts detailing the opportunity ID and its current non-won status. This two-way architecture makes this a highly effective n8n workflow for continuous monitoring.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance via the 'New' menu > 'Import workflow from JSON'.

  2. HighLevel Credentials: Configure the 'Fetch All HighLevel Opportunities' n8n node by adding your HighLevel OAuth2 API credentials.

  3. Google Sheets Setup: Update the 'Log Won Deals to Sheets' n8n node. Provide the correct Sheet ID and set up or select the necessary Google Sheets OAuth2 API credentials.

  4. Slack Setup: Configure both Slack n8n nodes ('Send Analytics to Slack' and 'Alert Non-Won Status to Slack') by providing or setting up your Slack API credentials. Ensure the correct #channel names or IDs are specified in the parameters.

  5. Execution: Since this uses a Manual Trigger n8n node, click 'Execute Workflow' to run the analysis.

Node Details

Manual Trigger n8n node: The starting n8n trigger for the entire flow. Used here for on-demand execution of the performance report.
HighLevel n8n node (Fetch All HighLevel Opportunities):
Function: Retrieves all opportunity records from the HighLevel CRM.
Key Configuration: Resource set to opportunity, Operation set to getAll, ensuring all available data is pulled for analysis.
If n8n node (Check If Status = Won):
Function: Acts as a flow control n8n node, routing the execution based on the opportunity status.
Key Configuration: Condition checks if {{ $json.status }} equals won.
Google Sheets n8n node (Log Won Deals to Sheets):
Function: Logs the raw JSON data for every opportunity where status is 'won' into a specified Google Sheet for permanent record-keeping.
Key Configuration: Uses the Append operation targeting Sheet1!A1:D1 (ensure this range is accurate for your sheet columns).
Function n8n node (Calculate Lead Source Metrics):
Function: Executes custom JavaScript to aggregate data. It iterates through all 'won' deals and calculates the total count and summed amount for each unique leadSource.
Key Configuration: Contains the core logic for calculating performance metrics before reporting.
Slack n8n node (Send Analytics to Slack):
Function: Delivers the calculated aggregate metrics report to a team Slack channel.
Key Configuration: Uses an expression ={{JSON.stringify($json, null, 2)}} to cleanly format the resulting metrics object into a readable report body, targeting #lead-source-report.
Slack n8n node (Alert Non-Won Status to Slack):
Function: Sends immediate alerts for deals that did not meet the 'won' criteria.
* Key Configuration: Text template is =Opportuniy id: {{ $json.id }} is {{ $json.status }}, providing contextual status updates.

Related n8n Workflows

Free

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

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

Featured*