Quick overview
This workflow receives a company name via webhook, runs three Tavily web searches (company info, recent news, and key people), uses Groq (Llama 3.3 70B) to synthesize a structured lead profile, optionally appends the results to Google Sheets, and returns the enriched profile in the webhook response.
How it works
- Receives a POST webhook request containing a company name and an optional domain.
- Queries the Tavily Search API for company overview details, then searches Tavily again for recent news and key executives/leadership.
- Sends the combined search results to a Groq LLM agent to generate a sales-ready lead enrichment profile as strict JSON (company details, products, signals, news, pain points, and outreach angles).
- Parses the AI output, extracts valid JSON if possible, and flattens key fields into a single row-friendly structure.
- If parsing succeeds, appends the enriched lead data to a Google Sheets spreadsheet and returns the full profile in the webhook response.
- If parsing fails, returns an HTTP 422 error response with the raw AI output for troubleshooting.
Setup
- Create a Groq API key, add it as an n8n Groq credential, and select it in the Groq LLM node.
- Create a Tavily API key and replace
YOUR_TAVILY_API_KEY in all three Tavily HTTP Request nodes.
- (Optional) Add Google Sheets OAuth2 credentials, set the Google Sheet document ID (replace
YOUR_GOOGLE_SHEET_ID), and ensure the target sheet (named “Leads”) has matching column headers for the flattened fields.