Library / AI Agents & Assistants
AI Agents & Assistants
Extract lost deal reasons from GoHighLevel conversations with Gemini
Triggered by a webhook for lost deals, pulls the GoHighLevel contact and conversation history, uses a Gemini AI agent to extract the loss reason, and posts it back as a note.
What it does
## Lost Deal Reason AI analysis | Save to GHL back ### How it works This workflow receives a webhook for a lost deal, retrieves the related GoHighLevel contact and opportunity, and verifies that both are valid and the opportunity is actually marked lost. It then fetches the contact’s conversations, processes and filters the message history, and only continues when there is suitable conversation content to analyze. A Gemini-powered AI Agent extracts a structured lost-deal reason and posts that reason back to GoHighLevel as a note. ### Setup steps - Configure the Webhook node URL as the trigger endpoint in GoHighLevel for lost opportunity/deal events. - Connect the HighLevel nodes with valid GoHighLevel credentials and confirm the contact and opportunity IDs are mapped from the webhook payload. - Configure the LeadConnector/GHL HTTP Request nodes with the correct API token, location/account details, API version headers, and conversation/note endpoint parameters. - Set up Google Gemini credentials for the AI Agent’s chat model and confirm the Structured Output Parser schema matches the fields expected in the final note. - Review the IF conditions and Code nodes to ensure they match your exact contact, opportunity status, and conversation filtering rules. ### Customization You can adjust the conversation filtering code, the minimum-message IF condition, the AI prompt/schema, and the final note format to match your sales process or CRM reporting needs.
The steps
- Lead Status Change Trigger
- Retrieve Contact Info
- Fetch Opportunity Data
- Check Contact Existence
- Verify Opportunity Status
- Fetch User Conversations
- Retrieve Conversation Details
- Extract Total Messages Count
- Filter Original Conversations
- Lost Reason Analysis Agent
- Parse Structured Output
- Google Gemini for Analysis
- Post Lost Reason to GHL
- Secondary Google Gemini Chat
15 steps in total.
Similar automations
CRM & Sales PipelineRecover lost GoHighLevel deals with OpenAI, Gmail and Google Sheets15 stepsEmail AutomationTriage watch repair requests with Google Gemini, HighLevel, Sightengine and Gmail21 stepsAI Agents & AssistantsQualify Facebook leads and run WhatsApp outreach with GoHighLevel, Redis and Gemini18 stepsCRM & Sales PipelineAudit sales follow-ups and billing with HighLevel, Stripe, Gemini and Slack19 steps