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.