Quick Overview
This workflow receives inbound leads via a webhook, optionally fetches and cleans the company website content, uses OpenAI (GPT-4.1 mini) to qualify and score the lead and generate outreach copy, sends a Telegram alert for high-priority leads, and logs every result to Google Sheets.
How it works
- Receives a lead submission via a POST webhook with fields like name, email, company, website, phone, and message.
- Normalizes the incoming lead fields into a consistent structure for downstream processing.
- If a website is provided, downloads the website HTML and trims/cleans it to a limited text payload.
- Combines the lead details with the cleaned website content and sends it to OpenAI (GPT-4.1 mini) to produce a structured lead qualification report with score, priority, intent, recommended follow-up, and outreach messages.
- Checks whether the AI lead score is 70 or higher and, if so, sends a formatted high-priority alert via Telegram.
- Appends the lead details and the AI-generated qualification and outreach fields to a Google Sheets spreadsheet.
Setup
- Create an OpenAI credential in n8n and ensure the workflow can access the GPT-4.1 mini model.
- Add a Telegram bot credential and set the target chat for where high-priority lead alerts should be delivered.
- Connect Google Sheets OAuth2 credentials and update the target spreadsheet/document ID, sheet name, and column headers to match the fields being appended.
- Copy the webhook URL from the “Receive Lead” trigger and configure your lead source (form, website, or CRM) to POST the expected fields to it.