Quick overview
This workflow receives inbound leads via a webhook, normalizes the submitted fields, uses OpenAI to score and categorize each lead, appends the results to Google Sheets, and posts a Slack alert for hot leads before responding to the webhook caller with the lead tier.
How it works
- Receives a POST request on a webhook containing lead details from a form or website.
- Normalizes the incoming payload into consistent name, email, company, and message fields.
- Sends the normalized lead text to OpenAI and parses the model response into structured JSON containing score, tier, reason, and next step.
- Combines the original lead fields with the AI scoring results into a single record.
- Appends the lead record to a Google Sheets worksheet.
- Checks whether the lead score meets the hot-lead threshold (>= 70) and posts a formatted alert to a Slack channel when it does.
- Returns a JSON webhook response indicating the lead was received and includes the computed tier.
Setup
- Add credentials for OpenAI, Google Sheets (OAuth2), and Slack.
- Create a Google Sheet with a “Leads” tab and columns: Date, Name, Email, Company, Message, Score, Tier, Reason, Next Step.
- Replace YOUR_SHEET_ID in the Google Sheets append step and confirm the target sheet name matches your document.
- Set the Slack channel (for example #sales-leads) where hot-lead alerts should be posted.
- Copy the webhook URL and configure your form tool or website to send a POST payload with fields like name/full_name, email, company, and message/details.