{"product_id":"slack-app-mention-file-analyzer-with-e2b-gpt-4o-in-n8n","title":"Slack App Mention File Analyzer with E2B + GPT-4o in n8n","description":"\u003ch3\u003eInstantly analyze Slack file uploads from app mentions—using E2B sandbox + GPT-4o in n8n\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow listens for \u003cstrong\u003eSlack app_mention\u003c\/strong\u003e events, grabs the mentioned (or most recent) uploaded file, runs analysis inside an \u003cstrong\u003eE2B\u003c\/strong\u003e isolated environment with \u003cstrong\u003eGPT-4o\u003c\/strong\u003e, and posts back a concise explanation plus an AI-generated chart directly in the same Slack thread.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives Slack Events via Webhook:\u003c\/strong\u003e Accepts a POST from a Slack Bolt app containing an \u003ccode\u003eapp_mention\u003c\/code\u003e event and immediately returns \u003cstrong\u003e202 Accepted\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReacts and locates the file:\u003c\/strong\u003e Adds an 👀 reaction to the mentioned message. If no file is attached to the mention, it looks up the \u003cstrong\u003emost recent file upload\u003c\/strong\u003e in the same channel\/user context.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalizes the request:\u003c\/strong\u003e Extracts the user question, thread metadata, and the selected Slack file ID\/download URL.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDownloads and analyzes in E2B:\u003c\/strong\u003e Fetches Slack file metadata, downloads the attachment, creates an \u003cstrong\u003eE2B code-interpreter sandbox\u003c\/strong\u003e, and uploads the file into the sandbox.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns GPT-4o + Python analysis:\u003c\/strong\u003e Uses \u003cstrong\u003eOpenAI (GPT-4o)\u003c\/strong\u003e to execute \u003cstrong\u003epandas\/matplotlib\u003c\/strong\u003e analysis and produce a Slack-ready written summary plus \u003ccode\u003e\/home\/user\/analysis.png\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUploads chart back to Slack:\u003c\/strong\u003e Verifies the PNG exists; if missing, generates a deterministic fallback chart, then uploads the chart to Slack with the AI’s explanation as the thread comment.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCleanup:\u003c\/strong\u003e Terminates the E2B sandbox to clean up resources.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eTurn “Hey, analyze this file” Slack mentions into automated insights for ops and support teams.\u003c\/li\u003e\n  \u003cli\u003eFor SaaS operators: quickly summarize uploaded CSVs\/XLSX files and return a visual in-thread.\u003c\/li\u003e\n  \u003cli\u003eFor automation engineers: a ready-to-use pattern combining \u003cstrong\u003eSlack\u003c\/strong\u003e + \u003cstrong\u003eE2B\u003c\/strong\u003e + \u003cstrong\u003eGPT-4o\u003c\/strong\u003e with safe sandbox execution.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes:\u003c\/strong\u003e code node, Slack node, Webhook, E2B (e2bn8n-nodes-e2be2b) nodes\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e Slack (Bolt app + Events API payload forwarded with \u003ccode\u003eX-Bolt-Secret\u003c\/code\u003e), \u003cstrong\u003eE2B code interpreter sandbox\u003c\/strong\u003e, \u003cstrong\u003eOpenAI GPT-4o\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCore output:\u003c\/strong\u003e thread comment with concise explanation + chart image upload (analysis.png)\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45741426049203,"sku":"N8N-17581","price":31.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/sgbZynjeozW0KEVHIEYYO_88ekvefb.png?v=1785316656","url":"https:\/\/buyflowscripts.com\/products\/slack-app-mention-file-analyzer-with-e2b-gpt-4o-in-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}