Quick overview
Youtube Video Explanation: https://youtu.be/A9IURUQlvQs?si=l5USqTcSmCEBEORP
This workflow receives new leads via webhook, enriches them with Apify Google AI Mode, scores them with Google Gemini, and then updates HighLevel contacts and opportunities while sending WhatsApp messages; it also handles WhatsApp support chats with a Gemini-powered agent, Redis memory, and Telegram notifications.
How it works
- Receives a new lead via a webhook and normalizes core fields like name, email, phone, and contact ID.
- Uses Apify (Google AI Mode search actor) to generate a public professional background overview for the lead based on their name and email.
- Sends the enriched lead profile to Google Gemini to produce a structured lead score, rationale, recommendation, and next steps.
- Routes the lead based on score thresholds, then upserts the contact in HighLevel, creates an opportunity, sends a WhatsApp template message, and updates the opportunity stage/pipeline details.
- Triggers on incoming WhatsApp messages, validates the sender, and fetches the related HighLevel contact and opportunities for context.
- Uses a Google Gemini customer service agent with Redis chat history to answer the message, optionally save requirements in HighLevel notes, update/close the opportunity, and notify the team via Telegram.
- Sends the agent’s response back to the user in WhatsApp.
Setup
- Create and connect credentials for Apify, Google Gemini (PaLM/Vertex API connection), HighLevel (GoHighLevel) OAuth2, WhatsApp Business (send + trigger), Redis, and Telegram.
- Configure the “newlead” webhook URL in your lead source to send POST payloads containing at least first_name/full_name, email, phone, and contact_id.
- In HighLevel, create the custom fields used for lead_score, score_breakdown, recommendation, and next_steps, then paste their field IDs plus the correct pipelineId/stageId values into the HighLevel nodes/tools.
- In WhatsApp Business, set the correct phoneNumberId and approved template name (currently “hvac|en”), and ensure the recipient phone format matches your WhatsApp account requirements.
- Set the Telegram chatId in the Telegram message step, and confirm Redis is reachable with an appropriate TTL/session key strategy for your expected conversation volume.
Additional info
Youtube Video Explanation: https://youtu.be/A9IURUQlvQs?si=l5USqTcSmCEBEORP