Dev Ops · n8n

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.

difficulty Advancedsetup 55 minresult An abnormal jump in errors pages on-call within minutes, with the current vs baseline rate
  1. 1

    Sample frequently

    A Schedule Trigger every few minutes runs an HTTP Request querying your logging tool for the recent error count.

  2. 2

    Compare to baseline

    A Code node keeps a rolling average of recent samples and flags when the current count exceeds a multiple of it.

  3. 3

    Page on spike

    An IF on the spike condition posts a trigger event to PagerDuty's Events API with the current vs baseline numbers and a dedup key.

  4. 4

    Add context in Slack

    A Slack node 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.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.