Quick overview
This workflow receives web leads via a secured webhook, enriches them with Tavily search results, scores and formats them using Google Gemini, then creates a lead in Odoo and sends a personalized email via Resend only when the lead meets the qualification threshold.
How it works
- Receives a POST request on a header-authenticated webhook and returns 400 if required fields like email and name are missing.
- Immediately responds with HTTP 202 to confirm receipt, then normalizes and cleans the incoming lead data (budget, company/domain, technologies) and prepares targeted Tavily search queries.
- Enriches the lead by searching Tavily for both the person and the company/domain, then compiles the results into a single context summary.
- Sends the lead data plus Tavily context to Google Gemini using a structured schema to generate a score, justification, Odoo-ready HTML notes, and a personalized email subject/body.
- Compares the Gemini score to the configured threshold to classify the lead as hot or cold and selects the corresponding Odoo tag/priority.
- Creates a new lead record in Odoo CRM with the AI-generated description and lead fields, and for hot leads sends the generated email to the lead via Resend.
Setup
- Configure webhook header authentication (shared secret/header) and register the webhook URL in your lead capture form or source system.
- Add credentials for Tavily (Bearer token), Google Gemini/PaLM (API key), Resend (Bearer token), and an Odoo API connection.
- Update the ⚙️ Config values (score threshold, company name/website, from/reply-to email addresses, and Tavily search depth) to match your environment.
- Verify your Odoo CRM has access to the crm.lead model and that the workflow’s stage/tag IDs and field mappings match your Odoo configuration.
Requirements
- Tavily API key
- Gemini API Key
- Resend API Key with verified domain.
- Odoo account
Additional info
Use any email provider such as SendGrid, Brevo, Resend...