See llms.txt for all machine-readable content.

Back to Templates

Score inbound leads with OpenAI, Google Sheets and Slack alerts

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

  1. Receives a POST request on a webhook containing lead details from a form or website.
  2. Normalizes the incoming payload into consistent name, email, company, and message fields.
  3. Sends the normalized lead text to OpenAI and parses the model response into structured JSON containing score, tier, reason, and next step.
  4. Combines the original lead fields with the AI scoring results into a single record.
  5. Appends the lead record to a Google Sheets worksheet.
  6. Checks whether the lead score meets the hot-lead threshold (>= 70) and posts a formatted alert to a Slack channel when it does.
  7. Returns a JSON webhook response indicating the lead was received and includes the computed tier.

Setup

  1. Add credentials for OpenAI, Google Sheets (OAuth2), and Slack.
  2. Create a Google Sheet with a “Leads” tab and columns: Date, Name, Email, Company, Message, Score, Tier, Reason, Next Step.
  3. Replace YOUR_SHEET_ID in the Google Sheets append step and confirm the target sheet name matches your document.
  4. Set the Slack channel (for example #sales-leads) where hot-lead alerts should be posted.
  5. 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.