{
  "id": "lBKKbdwQ12KKriEM",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automate FAQ Generation from Stack Overflow to Notion with Slack Alerts and Google Sheet",
  "tags": [],
  "nodes": [
    {
      "id": "b5595d8e-b9ae-4b39-aa44-eb4729834068",
      "name": "Sticky Note - Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        -1024
      ],
      "parameters": {
        "width": 541,
        "height": 577,
        "content": "## \ud83e\udde9 Automate FAQ Generation from Stack Overflow\n\n### How it works\nThis workflow watches Stack Overflow for new technical questions using RSS, classifies each question topic with OpenAI GPT-4o-mini, and turns it into a structured FAQ entry.  \nEach entry is then saved to Notion, logged in Google Sheets, and shared in Slack.  \nIf any step fails, an alert is sent automatically to your Slack channel.\n\n### Setup steps\n1. Connect your **RSS Feed** node and set the Stack Overflow tag query.  \n2. Add **OpenAI credentials** (model: gpt-4o-mini).  \n3. Connect your **Notion** workspace and choose your FAQ database.  \n4. Link your **Google Sheets** account and specify the document + sheet.  \n5. Connect **Slack**, select your workspace, and set a target channel ID.  \n6. Run once manually to test and confirm that all nodes are working.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "09a30fdb-1191-4dd0-a320-da7885a0ef02",
      "name": "Sticky Note - RSS Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1173.5,
        -345
      ],
      "parameters": {
        "color": 2,
        "width": 427,
        "height": 449,
        "content": "## \ud83d\udce1 Stack Overflow Feed & Filter  \n\nThis section monitors Stack Overflow RSS for new questions and filters out duplicates or irrelevant ones before AI processing.  \nUpdate the RSS tag query and adjust filter rules to match your tech stack.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ec540539-a6bc-44ed-8d2b-f729111c6bcf",
      "name": "Sticky Note - AI Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -560
      ],
      "parameters": {
        "color": 2,
        "width": 219,
        "height": 651,
        "content": "## \ud83e\uddf1 Data Preparation & Integration \n\n \nThis section formats the AI output into a clean structure for Notion, Google Sheets, and Slack.  \nMerges AI and Notion data so other nodes can access full FAQ details.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "96b6069f-edda-407b-b972-a9540cdb705c",
      "name": "Sticky Note - Formatting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -709.5,
        -323
      ],
      "parameters": {
        "color": 2,
        "width": 651,
        "height": 427,
        "content": "## \ud83e\udde0 AI Understanding & FAQ Generation  \n\nUses GPT-4o-mini to first classify each question (Frontend, Backend, DevOps, etc.), then generate a structured FAQ entry including title, summary, insights, and tags.  \nKeep prompts concise for best performance.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "47599144-192f-4490-aa46-8e20a205026b",
      "name": "Sticky Note - Notion Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -448
      ],
      "parameters": {
        "color": 2,
        "width": 379,
        "height": 597,
        "content": "## \ud83d\uddc2\ufe0f Knowledge Base Logging \n\n \nSaves each AI-generated FAQ to Notion for internal reference and logs it in Google Sheets for analytics or backup.  \nEnsure your Notion DB and Sheet fields match the formatted data.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6e4fa5ce-aeb7-4359-ad21-727e92f7e76f",
      "name": "Sticky Note - Slack Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -144
      ],
      "parameters": {
        "color": 2,
        "width": 347,
        "height": 357,
        "content": "## \ud83d\udcac Team Notifications  \n\n\nSends a Slack update when a new FAQ is added.  \nIncludes summary, category, and links to both Notion and the original Stack Overflow question.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b47b56b1-4ae3-4e88-9e97-76ce454cda09",
      "name": "OpenAI - Topic Classifier",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "notes": "Classifies question topic (Frontend, Backend, DevOps, etc.) before FAQ generation.",
      "position": [
        -672,
        -56
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {
          "maxTokens": 200,
          "temperature": 0
        },
        "messages": {
          "values": [
            {
              "content": "You are a technical classifier. Categorize this Stack Overflow question into one of the following: Frontend, Backend, DevOps, API, Database, AI/ML, or Other.\n\nReturn a JSON response in this exact format:\n{\n  \"topic_category\": \"<category>\"\n}\n\nQuestion Title: {{ $json.title }}\nQuestion Summary: {{ $json.summary }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "81c6d665-83ce-454b-b570-e5ee63769e70",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -1104,
        512
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "875a2618-4bec-4979-a9c3-fcab55406729",
      "name": "Slack - Error Alert",
      "type": "n8n-nodes-base.slack",
      "notes": "Sends an error alert message if Topic Classifier, FAQ Generator, or Notion fails.",
      "position": [
        -832,
        512
      ],
      "parameters": {
        "text": "=\u274c *FAQ Automation Error Detected!*\n\n*Node:* {{ $json.node.name }}\n*Error:* {{ $json.error.message }}\n*Time:* {{ $json.timestamp }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3667ae53-1e2d-4660-a37a-dbf9bf527b1b",
      "name": "OpenAI - FAQ Generator",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "notes": "Uses GPT-4o-mini to analyze Stack Overflow content and generate structured FAQ entries with product-specific guidance",
      "position": [
        -320,
        -56
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "options": {
          "maxTokens": 1000,
          "temperature": 0.7
        },
        "messages": {
          "values": [
            {
              "content": "=You are an expert technical writer creating internal FAQs for a SaaS product team.\n\nConvert the following Stack Overflow question into a comprehensive internal FAQ entry:\n\n**Question Title:** {{ $json.title }}\n**Question URL:** {{ $json.link }}\n**Content:** {{ $json.summary }} \n**Topic Category:** {{ $json.message.content.topic_category }}\n\nGenerate a JSON response with the following structure:\n{\n  \"faq_title\": \"Clear, concise question title\",\n  \"summary\": \"2-3 sentence summary of the problem and context\",\n  \"answer_insights\": \"Key technical insights and solutions from the discussion\",\n  \"product_guidance\": \"How this relates to our product, best practices, and internal documentation links (use placeholders like [ProductName] or [Internal Docs Link])\",\n  \"tags\": [\"relevant\", \"tags\", \"for\", \"categorization\"]\n}\n\nFocus on actionable insights and make it relevant for internal engineering and support teams."
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "b7c22c01-a01c-4328-95c3-1c89af58c82a",
      "name": "Filter Questions",
      "type": "n8n-nodes-base.if",
      "position": [
        -896,
        -56
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "902e691f-7ea4-48f4-ad5d-7196787ee099",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.title }}",
              "rightValue": "JavaScript"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "77daf4ad-9696-4981-8097-2d73c53ee7a4",
      "name": "RSS Feed - Stack Overflow Monitor",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "notes": "Monitors Stack Overflow RSS feed for new questions tagged with specified keywords (python, javascript, devops). Triggers every 30 minutes.",
      "position": [
        -1120,
        -56
      ],
      "parameters": {
        "feedUrl": "https://stackoverflow.com/feeds/tag?tagnames=javascript&sort=active",
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "147082e7-ac15-4983-81b1-8883e51bd080",
      "name": "Format  AI Response",
      "type": "n8n-nodes-base.set",
      "position": [
        48,
        -240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "84e7581a-9256-4075-bc2e-b4583cea72fc",
              "name": "FAQ Title",
              "type": "string",
              "value": "={{ $json.message.content.faq_title }}"
            },
            {
              "id": "52b3c12b-a7ce-40c1-87d2-b2370cd02a73",
              "name": "Summary",
              "type": "string",
              "value": "={{ $json.message.content.summary }}"
            },
            {
              "id": "4e61cf52-d96c-4253-b0b6-71a72c8bff45",
              "name": "Answer Insights",
              "type": "string",
              "value": "={{ $json.message.content.answer_insights }}"
            },
            {
              "id": "2e78b58f-80f3-4bd1-8cd8-27a945da1e1e",
              "name": "Product Guidance",
              "type": "string",
              "value": "={{ $json.message.content.product_guidance }}"
            },
            {
              "id": "2e21c42a-6d8b-4f1c-977d-526edcdd2225",
              "name": "Tags",
              "type": "array",
              "value": "={{ $json.message.content.tags }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "636bc723-1f21-48c8-a27f-575685d4da6a",
      "name": "Notion - Create FAQ Entry",
      "type": "n8n-nodes-base.notion",
      "notes": "Creates a new page in Notion Knowledge Base database with all FAQ fields populated",
      "position": [
        384,
        -32
      ],
      "parameters": {
        "title": "={{ $json[\"FAQ Title\"] }}",
        "pageId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "blockUi": {
          "blockValues": [
            {
              "textContent": "={{ $json.Summary }}"
            },
            {
              "textContent": "={{ $json[\"Answer Insights\"] }}"
            }
          ]
        },
        "options": {}
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "488cdd31-38b6-4a91-85ab-2d897d3e44e6",
      "name": "Merge Data",
      "type": "n8n-nodes-base.merge",
      "notes": "Combines OpenAI output with Notion response for Slack notification",
      "position": [
        48,
        -64
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "mergeByPosition"
      },
      "typeVersion": 2.1
    },
    {
      "id": "4b83b70c-c7ba-4a07-8143-e87930135d25",
      "name": "Slack - Notify Team",
      "type": "n8n-nodes-base.slack",
      "notes": "Sends formatted notification to #product-faqs channel with FAQ summary, category, and links",
      "position": [
        704,
        40
      ],
      "parameters": {
        "text": "=\ud83c\udd95 *New FAQ Entry Added to Knowledge Base*\n\n*Question:* {{ $json.message.content.faq_title }}\n\n*Summary:* {{ $json.message.content.summary }}\n\n\ud83e\udde9 *Category:* {{ $('OpenAI - Topic Classifier').item.json.message.content.topic_category }}\n\n*Tags:* {{ $json.message.content.tags }}\n\n\ud83d\udcc4 *Read Full Entry:* {{ $('Notion - Create FAQ Entry').item.json.url }} \n\n\ud83d\udd17 *Original Source:* {{ $('RSS Feed - Stack Overflow Monitor').item.json.link }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ad8eb9b3-6e61-419e-8d48-4f96d7ac3d14",
      "name": "FAQ Logging to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        384,
        -240
      ],
      "parameters": {
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "="
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f5f82442-f2f5-49d7-abb5-8dede57c51b9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        304
      ],
      "parameters": {
        "color": 2,
        "width": 496,
        "height": 352,
        "content": "## \ud83d\udea8 Error Monitoring  \n\n\nCatches errors from key nodes (AI, Notion, Sheets) and sends a Slack alert with details for quick debugging.  \nHelps ensure the automation runs reliably.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "039a7397-7761-4eb2-bd9b-cfd56b46957b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -848
      ],
      "parameters": {
        "width": 352,
        "height": 368,
        "content": "## \ud83d\udd10 Credentials & Security  \n\n\nUse OAuth2 for Slack and Google Sheets, API keys for OpenAI and Notion.  \nAvoid using personal credentials in public templates.  \nUse environment variables for all IDs or tokens.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "12161045-8a06-4a55-bcf8-e553b8577b33",
  "connections": {
    "Merge Data": {
      "main": [
        [
          {
            "node": "Slack - Notify Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Slack - Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Questions": {
      "main": [
        [
          {
            "node": "OpenAI - Topic Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format  AI Response": {
      "main": [
        [
          {
            "node": "Notion - Create FAQ Entry",
            "type": "main",
            "index": 0
          },
          {
            "node": "FAQ Logging to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - FAQ Generator": {
      "main": [
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Format  AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion - Create FAQ Entry": {
      "main": [
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "OpenAI - Topic Classifier": {
      "main": [
        [
          {
            "node": "OpenAI - FAQ Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS Feed - Stack Overflow Monitor": {
      "main": [
        [
          {
            "node": "Filter Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}