Quick overview
This workflow receives website leads via webhook, uses OpenRouter to score the enquiry and draft a short reply, then sends the response through Gmail and logs the lead (and any errors) to Google Sheets.
How it works
- Receives a lead submission via a POST webhook.
- Normalizes the incoming fields (name, email, phone, message), adds a timestamp, and applies business-specific settings.
- Sends the lead details to OpenRouter to classify the lead as hot/warm/cold, summarize the need, and generate a concise email reply.
- Parses and validates the JSON returned by OpenRouter, falling back to safe defaults if parsing fails.
- If the lead includes an email address, sends the drafted reply via Gmail and appends the lead details, score, and “Reply Sent” status to a Google Sheets “Leads” tab.
- If no email is provided, skips sending and still appends the lead details and “email not supplied” status to the Google Sheets “Leads” tab.
- If the lead is scored as hot, emails the business owner via Gmail with the lead details, and if any step errors, logs the failure to a Google Sheets “Errors” tab and alerts the owner by email.
Setup
- Create an OpenRouter credential in n8n and ensure the selected model (stealth/space-bunny-alpha) is available for your account.
- Connect a Gmail account in n8n for sending both lead replies and owner alerts.
- Connect Google Sheets credentials in n8n and set the Google Sheet document ID in the workflow settings field used for logging.
- In the workflow’s settings step, fill in the owner email address and confirm the business name.
- In your Google Sheet, create two tabs named “Leads” and “Errors” with headers matching the columns the workflow appends.
- Copy the webhook Production URL and configure your form tool to POST lead data (for example: name, email, phone, and message) to that endpoint.