See llms.txt for all machine-readable content.

Back to Templates

Score and triage inbound leads with OpenAI, HubSpot, and Slack

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

  1. Receives a POST request on a webhook endpoint whenever a new lead is submitted.
  2. Normalizes incoming form fields into a consistent lead object (name, email, phone, company, message, source) and prepares an OpenAI Chat Completions request.
  3. Sends the lead details to the OpenAI API to generate a 1–10 score plus a short reason and summary in JSON.
  4. Parses the OpenAI response and attaches the score, reason, and summary to the lead record.
  5. Sends a thank-you email to the lead using your SMTP mail server with a booking link for follow-up.
  6. Upserts the lead as a contact in HubSpot using the email address as the unique identifier.
  7. 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

  1. Configure the webhook URL in your form tool to POST lead submissions to the workflow’s “New lead” production webhook endpoint.
  2. Add an HTTP Header Auth credential for OpenAI (Authorization: Bearer <API key>) and attach it to the OpenAI request.
  3. Add an HTTP Header Auth credential for HubSpot (Authorization: Bearer <private app token>) and attach it to the HubSpot upsert request.
  4. 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.