See llms.txt for all machine-readable content.

Back to Templates

Approve lead reply emails in Slack with Gmail and Google Sheets

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

  1. Receives a POST request on a webhook with lead details such as name, email, message, and optional company.
  2. 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).
  3. Posts the lead details and draft reply to Slack via an Incoming Webhook with a Review button that opens an n8n approval form.
  4. Waits up to the configured number of hours for a reviewer to approve and optionally edit the reply, or to reject it.
  5. If approved, sends the final reply to the lead using Gmail with the prepared subject and approved/edited body.
  6. Appends a row to Google Sheets recording the lead details and the final status (sent, sent_edited, rejected, or expired).

Setup

  1. Create a Slack Incoming Webhook for your review channel and paste its URL into the workflow’s configuration values.
  2. Connect Google Sheets OAuth2 credentials and set the target spreadsheet ID and sheet/tab name, ensuring the sheet has the expected header columns.
  3. Connect Gmail OAuth2 credentials for the account that sends approved replies.
  4. If self-hosting n8n, set the public WEBHOOK_URL so the Slack Review button opens the approval form correctly.
  5. (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.