Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

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

  1. Lead Status Change Trigger
  2. Retrieve Contact Info
  3. Fetch Opportunity Data
  4. Check Contact Existence
  5. Verify Opportunity Status
  6. Fetch User Conversations
  7. Retrieve Conversation Details
  8. Extract Total Messages Count
  9. Filter Original Conversations
  10. Lost Reason Analysis Agent
  11. Parse Structured Output
  12. Google Gemini for Analysis
  13. Post Lost Reason to GHL
  14. Secondary Google Gemini Chat

15 steps in total.

Similar automations