FindPrompts
n8nCustomer SupportAdvanced5 steps

AI Support Email Auto-Responder (Human-in-the-Loop)

Reads new support emails from Gmail, drafts a context-aware reply with GPT, and posts it to Slack with approve/edit buttons. Nothing is sent until a human signs off, so you get the speed of AI with the safety of review.

GmailOpenAISlack

How it works

  1. 1Trigger: new email arrives in the support Gmail inbox
  2. 2Draft a reply with GPT based on the email body
  3. 3Send the draft to Slack and wait for human approval
  4. 4On approval, send the reply via Gmail
  5. 5Label the original thread as handled

Setup

  • Connect Gmail and Slack OAuth2 plus OpenAI credentials.
  • Create a 'support' Gmail label and a 'handled' label.
  • For true gated approval, add a Slack interactivity/wait step.
  • Tune the system prompt with your tone and FAQ knowledge.

Workflow JSON

{
  "name": "AI Support Email Auto-Responder",
  "nodes": [
    {
      "id": "se01aa",
      "name": "New Support Email",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        200,
        300
      ],
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "filters": {
          "labelIds": [
            "INBOX"
          ],
          "q": "label:support is:unread"
        }
      }
    },
    {
      "id": "se02bb",
      "name": "Draft Reply",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.4,
      "position": [
        420,
        300
      ],
      "parameters": {
        "modelId": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a friendly support agent. Draft a concise, helpful reply."
            },
            {
              "role": "user",
              "content": "From: {{ $json.from }}\nSubject: {{ $json.subject }}\nBody: {{ $json.snippet }}"
            }
          ]
        }
      }
    },
    {
      "id": "se03cc",
      "name": "Approve in Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        640,
        300
      ],
      "parameters": {
        "resource": "message",
        "operation": "post",
        "select": "channel",
        "channelId": "#support-approvals",
        "text": "Draft reply to {{ $('New Support Email').item.json.from }}:\n\n{{ $json.message.content }}\n\nReact with white_check_mark to approve."
      }
    },
    {
      "id": "se04dd",
      "name": "Send Reply",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        860,
        300
      ],
      "parameters": {
        "resource": "message",
        "operation": "reply",
        "messageId": "={{ $('New Support Email').item.json.id }}",
        "message": "={{ $('Draft Reply').item.json.message.content }}",
        "options": {}
      }
    },
    {
      "id": "se05ee",
      "name": "Label Handled",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        1080,
        300
      ],
      "parameters": {
        "resource": "message",
        "operation": "addLabels",
        "messageId": "={{ $('New Support Email').item.json.id }}",
        "labelIds": [
          "handled"
        ]
      }
    }
  ],
  "connections": {
    "New Support Email": {
      "main": [
        [
          {
            "node": "Draft Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Draft Reply": {
      "main": [
        [
          {
            "node": "Approve in Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approve in Slack": {
      "main": [
        [
          {
            "node": "Send Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Reply": {
      "main": [
        [
          {
            "node": "Label Handled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "meta": {}
}

Command Palette

Search for a command to run...