AutomationFlowsAI & RAG › Transform Support Emails Into Faqs with Gpt-4o, Gmail, Notion, and Slack

Transform Support Emails Into Faqs with Gpt-4o, Gmail, Notion, and Slack

ByRahul Joshi @rahul08 on n8n.io

This end-to-end automation transforms developer support emails into actionable FAQs and sentiment insights using Azure OpenAI GPT-4o, Gmail, Notion, Slack, and Google Sheets. It not only classifies and summarizes each email into a Notion knowledge base but also detects sentiment…

Event trigger★★★★☆ complexityAI-powered21 nodesLm Chat Azure Open AiGmail TriggerAgentNotionSlackGoogle SheetsGmail
AI & RAG Trigger: Event Nodes: 21 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #10340 — we link there as the canonical source.

This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "uQWmgAxfU9ZS3EEu",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Support Inbox-to-FAQ Backfill (Gmail/Outlook)",
  "tags": [],
  "nodes": [
    {
      "id": "bc069f30-5bcf-4e2c-a657-492eacdae39a",
      "name": "Configure GPT-4o Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -144,
        208
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2c8072df-420c-441c-8beb-137df1737650",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        416
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 464,
        "content": "## Error Handling & Logging\nRecords any parsing or API errors into a Google Sheet for debugging.  \nEnsures every failed event is logged and traceable.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "337ea8c7-d28c-43a4-a288-d7c48ea8788b",
      "name": "Gmail Polling Trigger \u2013 Developer Support Inbox",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -912,
        -16
      ],
      "parameters": {
        "filters": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "04a188b4-507a-4eb7-8466-5b7703316a61",
      "name": "Validate Email Payload",
      "type": "n8n-nodes-base.if",
      "position": [
        -624,
        -16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e2adb005-2b3c-4d1e-8445-442df1fe925a",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1a39d3cf-2b08-4f3d-b9c2-8da386f42283",
      "name": "Analyze & Classify Developer Email (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -208,
        -32
      ],
      "parameters": {
        "text": "={\n  \"subject\": {{ $json.Subject }} ,\n  \"body\": \"{{$json[\"snippet\"]}}\"\n}\n",
        "options": {
          "systemMessage": "=You are an AI assistant trained to analyze developer support emails and identify recurring questions or issues.\n\nYour task:\n1. Read the email subject and snippet.\n2. Summarize the main problem.\n3. Identify the most likely FAQ category (e.g., API, Authentication, Billing, Setup, Errors, UI).\n4. Suggest a short FAQ title.\n5. Write a 2\u20133 line clear and helpful answer.\n6. Detect if it matches an existing FAQ type (is_recurring = true/false).\n\nReturn result in **valid JSON** only.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f3a597c5-7f03-437e-b6b9-c9b9d79cff2d",
      "name": "Parse & Clean AI JSON Output",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        -32
      ],
      "parameters": {
        "jsCode": "// Remove Markdown code block and parse JSON\nlet raw = $json.output || \"\";\nraw = raw.replace(/```json|```/g, '').trim();\n\nlet parsed = {};\ntry {\n  parsed = JSON.parse(raw);\n} catch (e) {\n  parsed = { error: \"Failed to parse AI output\", raw_output: raw };\n}\n\nreturn parsed;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "a10bfd08-a073-4160-ae69-ebe3ae93c6e2",
      "name": "Save FAQ Entry to Notion Database",
      "type": "n8n-nodes-base.notion",
      "position": [
        1312,
        48
      ],
      "parameters": {
        "title": "={{ $json.problem_summary }}",
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "29a802b9-1fa0-804a-b406-e078961e0659",
          "cachedResultUrl": "https://www.notion.so/29a802b91fa0804ab406e078961e0659",
          "cachedResultName": "Release Notes"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Priority|rich_text",
              "textContent": "={{ $json.faq_category }}"
            },
            {
              "key": "FAQ Content|rich_text",
              "textContent": "={{ $json.faq_answer }}"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "06741c0d-d998-41e9-9453-eed31e77a189",
      "name": "Announce New FAQ in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1568,
        48
      ],
      "parameters": {
        "text": "=\ud83e\udde0 *FAQ Update Logged!*\n\u2022 *Title:* {{$json[\"properties\"][\"Name\"][\"title\"][0][\"plain_text\"]}}\n\u2022 *Category:* {{$json[\"properties\"][\"Priority\"][\"rich_text\"][0][\"plain_text\"]}}\n\u2022 *Summary:* {{$json[\"properties\"][\"FAQ Content\"][\"rich_text\"][0][\"plain_text\"].slice(0, 150)}}...\n\n\ud83d\udd17 *View in Notion:* <{{$json[\"url\"]}}|Open FAQ>\n\ud83d\udcc5 *Logged On:* {{new Date().toLocaleString()}}\n",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U09HMPVD466",
          "cachedResultName": "newscctv22"
        },
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "1201a420-9656-47b1-9ef6-65fa62d8e245",
      "name": "Log Workflow Errors to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -464,
        672
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "error_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "error_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1338537721,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit#gid=1338537721",
          "cachedResultName": "error log sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit?usp=drivesdk",
          "cachedResultName": "Interviewer Brief Pack "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "625832c2-b6f8-4f12-b246-eb9d8be74531",
      "name": "Configure GPT-4o Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        512,
        -304
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a8b1fec3-a3a5-4da6-82cb-85297ef8a092",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        -816
      ],
      "parameters": {
        "color": 7,
        "height": 496,
        "content": "## Acknowledgment & Feedback Loop\nAutomatically replies to the sender with a polite acknowledgment and  \nAI-generated answer, confirming that their issue was added to the FAQ base.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "65fa6207-1bd4-414b-ab20-46517842d2f4",
      "name": "Analyze Email Sentiment & Urgency (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        528,
        -512
      ],
      "parameters": {
        "text": "=Analyze this email and determine:\n1. Urgency level (Low/Medium/High/Critical)\n2. Customer sentiment (Positive/Neutral/Frustrated/Angry)\n3. Requires immediate response? (Yes/No)\n\nEmail: {{ $('Gmail Polling Trigger \u2013 Developer Support Inbox').item.json.snippet }}\n\nReturn only JSON:\n{\n  \"urgency\": \"High\",\n  \"sentiment\": \"Frustrated\",\n  \"immediate_response_needed\": \"Yes\",\n  \"reason\": \"brief explanation\"\n}",
        "options": {
          "systemMessage": "=You are an expert at analyzing customer support emails. Rate urgency and sentiment accurately and concisely"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "17018fa2-153a-4ca8-8e3b-fc04195a26ce",
      "name": "Parse AI JSON Output \u2013 Sentiment Analysis",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        -512
      ],
      "parameters": {
        "jsCode": "// Remove Markdown code block and parse JSON\nlet raw = $json.output || \"\";\nraw = raw.replace(/```json|```/g, '').trim();\n\nlet parsed = {};\ntry {\n  parsed = JSON.parse(raw);\n} catch (e) {\n  parsed = { error: \"Failed to parse AI output\", raw_output: raw };\n}\n\nreturn parsed;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5d7e3019-0c17-4840-9302-f6c4bbe47432",
      "name": "Filter Critical or High-Urgency Emails",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        -512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "db2ac827-dd91-42cd-a79d-b1a78c104dad",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.urgency }}",
              "rightValue": "High"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7a0f4533-2afc-42f2-926a-298aa2183d3f",
      "name": "Alert Team in Slack \u2013 Critical Issue",
      "type": "n8n-nodes-base.slack",
      "position": [
        1424,
        -528
      ],
      "parameters": {
        "text": "=\ud83d\udea8 *CRITICAL ISSUE DETECTED*\n   \n   \ud83d\udce7 Email: {{ $('Gmail Polling Trigger \u2013 Developer Support Inbox').item.json.snippet }}\n   \ud83d\ude24 Sentiment: {{ $json.sentiment }}\n   \u26a1 Urgency: {{ $json.urgency }}\n   \ud83d\udcdd Reason: {{ $json.reason }}\n   \n   \ud83d\udc49 *Action Required Immediately*",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U09HMPVD466",
          "cachedResultName": "newscctv22"
        },
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "0edeebbe-2001-4a84-823a-e712757190b8",
      "name": " Send Acknowledgment Email to Sender",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1696,
        -528
      ],
      "parameters": {
        "sendTo": "={{ $('Gmail Polling Trigger \u2013 Developer Support Inbox').item.json.From.match(/<(.+?)>/)?.[1] || $('Gmail Polling Trigger \u2013 Developer Support Inbox').item.json.From }}",
        "message": "=Hi there,\n\nThank you for reaching out! We've received your question and added it to our knowledge base.\n\nHere's a quick answer to help you:\n\n\ud83d\udccc Issue: {{ $('Parse & Clean AI JSON Output').item.json.problem_summary }}\n\ud83d\udca1 Solution: {{ $('Parse & Clean AI JSON Output').item.json.faq_answer }}\n\nOur team will follow up if additional assistance is needed.\n\nBest regards,\nDeveloper Support Team",
        "options": {},
        "subject": "={{ $('Gmail Polling Trigger \u2013 Developer Support Inbox').item.json.snippet }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "aab47485-abe6-4f47-9b71-8a75939ace39",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -960
      ],
      "parameters": {
        "width": 512,
        "height": 624,
        "content": "## How it works\nThis automation streamlines developer support management by turning incoming Gmail emails into structured FAQ entries.  \nIt continuously monitors your support inbox, validates each message, and uses Azure OpenAI GPT-4o to analyze the content.  \nThe AI classifies the issue, summarizes it, and creates a concise FAQ title and answer.  \nThe result is parsed into clean JSON, stored in a Notion database, and shared with your internal team via Slack.  \nCritical or urgent emails are separately analyzed for sentiment and priority \u2014 instantly alerting your team if immediate action is required.  \nEach failure or parsing issue is automatically logged in Google Sheets for easy troubleshooting.  \nThe workflow also sends an acknowledgment email back to the original sender, closing the communication loop.\n\n## Setup steps\n1. Connect your credentials:\n   - Gmail (inbox and sender)\n   - Azure OpenAI API\n   - Notion database (\u201cRelease Notes\u201d)\n   - Slack workspace\n   - Google Sheets (for error logs)\n2. Replace Notion Database ID and Google Sheet IDs with your own.\n3. Update Slack user/channel in the Slack nodes.\n4. Adjust Gmail trigger polling frequency if needed.\n5. Run once manually to confirm all credentials and data mappings.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b360458f-2d91-4c7c-bcb4-d7a80b5f7ca6",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -208
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 384,
        "content": "## Email Intake & Validation\nPolls the Gmail inbox for new support messages.  \nEnsures valid payload (ID, subject, body) before AI processing.  \nInvalid or empty messages are routed to the Google Sheets error log.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cc440d05-5ed8-4819-b6a6-f06fc6b55c4d",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -208
      ],
      "parameters": {
        "color": 7,
        "width": 704,
        "height": 576,
        "content": "## AI Analysis & FAQ Generation\nUses GPT-4o to read each email and generate structured FAQ data \u2014  \nincluding summary, category, short solution, and recurrence flag.  \nThe output is cleaned and converted to valid JSON for downstream use.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b738631b-0ab0-4c57-80b4-2d011b01a5ce",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 432,
        "content": "## Knowledge Storage & Team Notification\nSaves the AI-generated FAQ entry to Notion and notifies your team on Slack.  \nEach new FAQ includes title, category, and answer snippet with a Notion link.  \nHelps your team stay aligned on new recurring issues.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d95516c3-0ce4-4515-91f0-7ca19ecc3957",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -768
      ],
      "parameters": {
        "color": 7,
        "width": 1104,
        "height": 608,
        "content": "## Urgency & Sentiment Detection\nAnalyzes the emotional tone and urgency of incoming emails.  \nFlags critical or frustrated messages for instant Slack escalation.  \nEnsures urgent support requests are handled in real time.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7df077a3-0fb2-48e1-9c72-5b88f926f197",
  "connections": {
    "Configure GPT-4o Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze & Classify Developer Email (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Validate Email Payload": {
      "main": [
        [
          {
            "node": "Analyze & Classify Developer Email (AI)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Workflow Errors to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure GPT-4o Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Email Sentiment & Urgency (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse & Clean AI JSON Output": {
      "main": [
        [
          {
            "node": "Save FAQ Entry to Notion Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Analyze Email Sentiment & Urgency (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save FAQ Entry to Notion Database": {
      "main": [
        [
          {
            "node": "Announce New FAQ in Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Alert Team in Slack \u2013 Critical Issue": {
      "main": [
        [
          {
            "node": " Send Acknowledgment Email to Sender",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Email Sentiment & Urgency (AI)": {
      "main": [
        [
          {
            "node": "Parse AI JSON Output \u2013 Sentiment Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Critical or High-Urgency Emails": {
      "main": [
        [
          {
            "node": "Alert Team in Slack \u2013 Critical Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze & Classify Developer Email (AI)": {
      "main": [
        [
          {
            "node": "Parse & Clean AI JSON Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI JSON Output \u2013 Sentiment Analysis": {
      "main": [
        [
          {
            "node": "Filter Critical or High-Urgency Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Polling Trigger \u2013 Developer Support Inbox": {
      "main": [
        [
          {
            "node": "Validate Email Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This end-to-end automation transforms developer support emails into actionable FAQs and sentiment insights using Azure OpenAI GPT-4o, Gmail, Notion, Slack, and Google Sheets. It not only classifies and summarizes each email into a Notion knowledge base but also detects sentiment…

Source: https://n8n.io/workflows/10340/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Automate your weekly social media analytics with this end-to-end AI reporting workflow. 📊🤖 This system collects real-time Twitter (X) and Facebook metrics, merges and validates data, formats it with J

Lm Chat Azure Open Ai, HTTP Request, Google Sheets +4
AI & RAG

This workflow automates the entire release note creation and announcement process whenever a task status changes in ClickUp. Using Azure OpenAI GPT-4o, Notion, Slack, Gmail, and Google Sheets, it conv

Lm Chat Azure Open Ai, Google Sheets, ClickUp Trigger +5
AI & RAG

This workflow intelligently analyzes incoming Gmail emails, classifies intent using GPT-4, and sends real-time Slack notifications while logging structured data into Google Sheets. It provides a smart

Gmail Trigger, Slack, Output Parser Structured +4
AI & RAG

This workflow automates end-to-end validation, assessment, and reporting of n8n workflow JSON templates using Google Drive, Azure OpenAI GPT-4o, Gmail, and Slack. It retrieves workflows from a Drive f

Memory Buffer Window, Lm Chat Azure Open Ai, Output Parser Structured +5
AI & RAG

Automatically capture customer onboarding help requests from Typeform, log them in Google Sheets, validate email addresses, and send a professional HTML welcome email via Gmail. Ensures smooth onboard

Typeform Trigger, Google Sheets, Gmail +6