{"product_id":"sentry-incident-investigation-workflow-with-gemini-slack-postgres","title":"Sentry Incident Investigation Workflow with Gemini, Slack \u0026 Postgres","description":"\u003ch3\u003eTurn Sentry alerts into structured incident investigations—automatically\u003c\/h3\u003e\n\u003cp\u003eThis \u003cstrong\u003eSentry Incident Investigation Workflow with Gemini, Slack \u0026amp; Postgres\u003c\/strong\u003e listens for Sentry issue alert webhooks, enriches each incident with Sentry + GitHub context, uses \u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e to generate a \u003cstrong\u003eJSON investigation report\u003c\/strong\u003e, saves everything to \u003cstrong\u003ePostgres\u003c\/strong\u003e, and posts a clear summary to \u003cstrong\u003eSlack\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives Sentry issue alerts\u003c\/strong\u003e: Accepts a POST webhook from Sentry and normalizes the payload into a consistent incident context (including \u003cem\u003eissue ID\u003c\/em\u003e, \u003cem\u003etitle\u003c\/em\u003e, \u003cem\u003eenvironment\u003c\/em\u003e, and relevant links).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePrevents duplicate investigations\u003c\/strong\u003e: Checks \u003cstrong\u003ePostgres\u003c\/strong\u003e for an existing record using the same \u003cem\u003eSentry issue ID\u003c\/em\u003e, proceeding only if it’s new.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEnriches incident evidence\u003c\/strong\u003e: Fetches the latest issue details from \u003cstrong\u003eSentry\u003c\/strong\u003e and pulls recent commits from the configured \u003cstrong\u003eGitHub\u003c\/strong\u003e repository.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFinds related history\u003c\/strong\u003e: Searches \u003cstrong\u003ePostgres\u003c\/strong\u003e for up to \u003cstrong\u003e10 similar historical incidents\u003c\/strong\u003e based on the issue title and prior incident reports.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerates a structured investigation\u003c\/strong\u003e: Bundles Sentry data, GitHub commit context, and historical incidents, then sends the evidence to \u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e to produce a \u003cstrong\u003eJSON\u003c\/strong\u003e report with \u003cem\u003eseverity\u003c\/em\u003e, \u003cem\u003ehypotheses\u003c\/em\u003e, and \u003cem\u003erecommended actions\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates, scores, and stores results\u003c\/strong\u003e: Validates and scores the AI output, then \u003cstrong\u003eupserts\u003c\/strong\u003e the investigation (evidence + report) into \u003cstrong\u003ePostgres\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCommunicates to Slack\u003c\/strong\u003e: Posts an incident summary to a \u003cstrong\u003eSlack\u003c\/strong\u003e channel including \u003cem\u003eseverity\u003c\/em\u003e, \u003cem\u003econfidence\u003c\/em\u003e, and a link back to the Sentry issue.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eReduce time-to-triage by auto-drafting investigation reports for every new Sentry issue.\u003c\/li\u003e\n  \u003cli\u003eEnable faster incident response with consistent summaries posted directly to Slack.\u003c\/li\u003e\n  \u003cli\u003eLeverage historical incident patterns stored in Postgres to inform Gemini’s hypotheses.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWebhook\u003c\/strong\u003e: Sentry issue alert webhook ingestion\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eif\u003c\/strong\u003e \/ \u003cstrong\u003eCode\u003c\/strong\u003e: Normalize payload and control “already processed” logic\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSentry\u003c\/strong\u003e integration: Fetch latest issue details\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGitHub\u003c\/strong\u003e integration: Retrieve recent commits\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePostgres\u003c\/strong\u003e: Check duplicates, search similar incidents, upsert evidence + investigation report\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e: Generate a structured JSON investigation report\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSlack\u003c\/strong\u003e: Post severity\/confidence summary with a Sentry link\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46289262477491,"sku":"N8N-21535","price":50.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/lmZnKcPstcmgr-b31seqV_TYdF6nkb.png?v=1793006753","url":"https:\/\/buyflowscripts.com\/products\/sentry-incident-investigation-workflow-with-gemini-slack-postgres","provider":"N8N Commerce","version":"1.0","type":"link"}