Quick Overview
This workflow captures new leads via webhook, enriches them with Apify-powered Google AI search, scores them using Google Gemini, and updates HighLevel CRM while sending WhatsApp template messages; it also handles inbound WhatsApp support with a Gemini-driven agent that uses Redis memory, updates HighLevel, and notifies a team via Telegram.
How it works
- Receives new lead details through an HTTP webhook.
- Normalizes the lead fields and uses Apify (Google AI Mode search) to fetch a public professional background overview for the lead.
- Sends the enriched lead context to Google Gemini to produce a structured lead score, rationale, recommendation, and next steps.
- Routes the lead based on the score threshold and upserts the contact in HighLevel with the AI scoring details stored in custom fields.
- Creates a HighLevel opportunity, sends a WhatsApp template message to the lead, and updates the opportunity’s pipeline/stage fields.
- Triggers on incoming WhatsApp messages, looks up the sender in HighLevel, fetches related opportunities, and hands the conversation to a Google Gemini agent with Redis chat history.
- Uses the agent’s decisions to save requirement notes and update/close the HighLevel opportunity, sends an internal Telegram notification, and replies to the customer via WhatsApp.
Setup
- Create and connect credentials for Google Gemini (Google PaLM API), HighLevel OAuth2, WhatsApp Business API (send + trigger), Apify API, Redis, and Telegram.
- Configure the “newlead” webhook URL in your lead source so it sends first_name, last_name/full_name, email, phone, and contact_id in the request body.
- In HighLevel, create the needed custom fields for lead_score, score_breakdown, recommendation, and next_steps, then paste their field IDs into the contact upsert steps.
- Set your HighLevel pipelineId and stageId values in the opportunity create/update steps (including “Proposal Sent” and “Closed” stages).
- In WhatsApp, set the correct phoneNumberId and template name (and ensure the template is approved), and in Telegram replace the placeholder chatId with your target chat or user ID.