π£ Score and qualify B2B leads via webhook with Groq Chat Completions
β‘ 4 views Β· π£ Lead Generation & Enrichment
Description
Quick overview
This workflow receives lead details via a webhook and sends them to Groqβs OpenAI-compatible Chat Completions API to score and qualify the lead, then returns a structured JSON response with score, tier, recommended next action, and reasons.
How it works
- Receives a POST request on the
/ai-lead-qualificationwebhook containing lead details in the request body. - Builds a chat prompt that asks Groq to score the lead (0β100) on budget/authority/fit/urgency/detail and return only a JSON object with qualification fields.
- Calls Groqβs Chat Completions endpoint with the
openai/gpt-oss-120bmodel and requests a JSON-formatted response. - Parses Groqβs response, applies defaults if fields are missing, and maps the result to a consistent output schema (score, tier, qualified, recommended_action, reasons).
- Returns the qualification result as a JSON response to the original webhook request.
Setup
- Create a Groq API key and add it as an HTTP Header Auth credential used by the HTTP request to
https://api.groq.com/openai/v1/chat/completions. - Copy the production webhook URL for
/ai-lead-qualificationand configure your form/app/CRM to send lead data as a POST request body to that URL. - Ensure the webhook payload includes the expected fields (for example
name,email,company,role,budget,need,source,message) so the prompt has enough context to score the lead.
π Nodes Used
HTTP Request, Webhook
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File