Detect Error-Rate Spikes and Page On-Call Before Users Complain
An n8n workflow that samples your app's error count on a short interval, compares it to a rolling baseline, and pages on-call the moment errors spike abnormally — catching an incident in its first minutes instead of after a flood of user reports.
- 1
Sample frequently
A
Schedule Triggerevery few minutes runs anHTTP Requestquerying your logging tool for the recent error count. - 2
Compare to baseline
A
Codenode keeps a rolling average of recent samples and flags when the current count exceeds a multiple of it. - 3
Page on spike
An
IFon the spike condition posts atriggerevent to PagerDuty's Events API with the current vs baseline numbers and a dedup key. - 4
Add context in Slack
A
Slacknode posts the spike details and a link to the dashboard so responders start with context, not a cold page.
Frequently asked questions
Where does the error count come from?
Your logging/APM stack — a Sentry, Datadog, Grafana Loki, or CloudWatch query that returns error count in the last few minutes. The workflow just needs a number per run; the source is a single HTTP query you customize.
How does it avoid false alarms?
It compares the current rate to a rolling average of recent windows, not a fixed threshold, and only pages when the spike exceeds a multiple of baseline. This adapts to your normal traffic so a busy period doesn't page, but a genuine anomaly does.