Generate GoHighLevel deal follow-up actions with OpenAI and Cognee

Go to Workflow
1 views
Built by Rahul Joshi Rahul Joshi
Created on September 21, 2026

Description

Quick overview
This workflow triggers from a GoHighLevel webhook, schedule, or manual run to pull open opportunity and pipeline details, generate deal-specific follow-up actions using an OpenAI GPT-4o-mini agent with Cognee knowledge search, then posts results to Slack, sends an email via Gmail, logs the deal to Sheets.

How it works
Triggers when a GoHighLevel webhook is received, on a schedule, or from a manual run to start processing open opportunities.
Searches GoHighLevel for open opportunities and fetches the current pipeline and stage metadata via the LeadConnector (GoHighLevel) API.
Normalizes the opportunity payload into structured fields (deal, pipeline, stage, contact, owner, value) and prepares it for downstream processing.
Uses an OpenAI GPT-4o-mini agent that first queries Cognee to retrieve relevant SOPs/playbooks from your company knowledge base and then generates a 3–6 item follow-up checklist.
Formats the agent output into Slack text, an HTML email body, and a Google Sheets row.
Posts the follow-up checklist to Slack, emails the follow-up actions via Gmail, and appends the deal and actions to a Google Sheets log.
On any error, formats the failure details and posts an alert to Slack.

Setup
Add your GoHighLevel (LeadConnector) Private Integration token and locationId query values in the two HTTP requests for pipelines and opportunity search.
Connect OpenAI credentials for the GPT-4o-mini chat model and connect Cognee credentials, then set the correct Cognee dataset ID for knowledge search.
Connect Slack credentials and choose the target channel for both the follow-up message and error alerts.
Connect Gmail OAuth2 credentials and replace the recipient address (for example, [email protected]).
Connect Google Sheets OAuth2 credentials and update the spreadsheet/document ID and sheet/tab used to append deal follow-up rows.
If using the webhook trigger, copy the n8n webhook URL into your GoHighLevel workflow/action that fires on deal creation.

Nodes Used (7)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Slack
n8n-nodes-base.slack