Error handling system with PostgreSQL logging and rate-limited notifications
Ready for 3.0What this workflow does
This workflow has 13 nodes and runs when another workflow calls it (plus 2 other triggers). Along the way it connects Postgres and Pushover.
How it runs
Trigger: When another workflow calls it (plus 2 other triggers).
- Insert Log (Postgres): uses Postgres
- Count for 5 minutes (Postgres): run a query
- Truncate Log Database (Postgres): delete table
- CleanUp execution. See below if you will prepend this workflow (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Call this Sample - Prepend to your error catcher (Execute Sub-workflow): calls another n8n workflow
- Principal E-Mail (Send Email): sends an email over SMTP
- Push mobile notification (Pushover): uses Pushover
- Fallback E-Mail (Send Email): sends an email over SMTP
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 (10)
- Error Trigger
n8n-nodes-base.errorTrigger - Postgres
n8n-nodes-base.postgres - Send Email
n8n-nodes-base.emailSend - Pushover
n8n-nodes-base.pushover - Manual Trigger
n8n-nodes-base.manualTrigger - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Log errors and avoid sending too many emails Use case Most of the time, it’s necessary to log all errors that occur. However, in some cases, a scheduled task or service consuming excessive resources might trigger a surge of errors. To address this, we can log…