Quick overview
This workflow receives new lead form submissions via webhook, generates a draft reply (template-based, with an optional OpenAI enhancement), posts the draft to Slack for human approval, then sends the approved reply via Gmail and logs the outcome to Google Sheets.
How it works
- Receives a POST request on a webhook with lead details such as name, email, message, and optional company.
- Validates the payload, detects the lead intent from keywords, and builds a draft reply and email subject from templates (optionally generating an improved draft using OpenAI if enabled).
- Posts the lead details and draft reply to Slack via an Incoming Webhook with a Review button that opens an n8n approval form.
- Waits up to the configured number of hours for a reviewer to approve and optionally edit the reply, or to reject it.
- If approved, sends the final reply to the lead using Gmail with the prepared subject and approved/edited body.
- Appends a row to Google Sheets recording the lead details and the final status (sent, sent_edited, rejected, or expired).
Setup
- Create a Slack Incoming Webhook for your review channel and paste its URL into the workflow’s configuration values.
- Connect Google Sheets OAuth2 credentials and set the target spreadsheet ID and sheet/tab name, ensuring the sheet has the expected header columns.
- Connect Gmail OAuth2 credentials for the account that sends approved replies.
- If self-hosting n8n, set the public
WEBHOOK_URL so the Slack Review button opens the approval form correctly.
- (Optional) To use AI drafting, add an OpenAI API key as an HTTP Header Auth credential, select it on the OpenAI request step, and enable that step.