Detect and explain KPI anomalies with Postgres, Slack, GitHub, Gmail and Claude
Ready for 3.0What this workflow does
This AI workflow has 58 nodes and runs manually, when you click “Execute workflow” (plus 4 other triggers). Along the way it connects Postgres, Slack, OpenRouter Chat Model and GitHub and 1 more.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 4 other triggers).
- Load Metric Registry (Postgres): run a query
- Detection Settings (Edit Fields (Set)): sets 6 fields: critical_channel, warning_channel, oncall_email…
- Validate Feedback (Code): runs custom JavaScript code
- Report Settings (Edit Fields (Set)): sets 4 fields: report_email, report_channel, window_days…
- Run Metric Query (Postgres): run a query
- Fetch Latest Vs Baseline (Postgres): run a query
- Feedback Valid (If): checks a condition and branches into true / false
- Query Alert Precision (Postgres): run a query
- Build Observation (Code): runs custom JavaScript code
- Score Anomalies (Code): runs custom JavaScript code
…plus 35 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (20)
- Manual Trigger
n8n-nodes-base.manualTrigger - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - Filter
n8n-nodes-base.filter - Slack
n8n-nodes-base.slack - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Postgres Tool
n8n-nodes-base.postgresTool - Github Tool
n8n-nodes-base.githubTool - Code Tool
@n8n/n8n-nodes-langchain.toolCode - AI Agent
@n8n/n8n-nodes-langchain.agent - Merge
n8n-nodes-base.merge - Switch
n8n-nodes-base.switch - GitHub
n8n-nodes-base.github - Gmail
n8n-nodes-base.gmail - Webhook
n8n-nodes-base.webhook - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Quick overview This workflow collects daily KPI values in Postgres, builds robust baselines, detects anomalies, and routes alerts to Slack, GitHub, and Gmail with an OpenRouter (Claude) investigation summary, plus a feedback webhook and a weekly precision…