Quick overview
This workflow receives new lead submissions via a webhook, normalizes the data, scores the lead with OpenAI, sends an acknowledgment email, upserts the contact into HubSpot, and posts a Slack alert when the score meets a configured “hot lead” threshold.
How it works
- Receives a POST request on a webhook endpoint whenever a new lead is submitted.
- Normalizes incoming form fields into a consistent lead object (name, email, phone, company, message, source) and prepares an OpenAI Chat Completions request.
- Sends the lead details to the OpenAI API to generate a 1–10 score plus a short reason and summary in JSON.
- Parses the OpenAI response and attaches the score, reason, and summary to the lead record.
- Sends a thank-you email to the lead using your SMTP mail server with a booking link for follow-up.
- Upserts the lead as a contact in HubSpot using the email address as the unique identifier.
- Posts a message to Slack via an incoming webhook when the lead score is greater than or equal to the configured hot-lead score.
Setup
- Configure the webhook URL in your form tool to POST lead submissions to the workflow’s “New lead” production webhook endpoint.
- Add an HTTP Header Auth credential for OpenAI (Authorization: Bearer <API key>) and attach it to the OpenAI request.
- Add an HTTP Header Auth credential for HubSpot (Authorization: Bearer <private app token>) and attach it to the HubSpot upsert request.
- Add an SMTP credential for sending email and set the from address, business name, booking link, Slack incoming webhook URL, and hot-lead score in the Config values.