workflows.fit
Back to n8n workflows
n8n templateFreeBy Davi Saranszky Mesquita

Error handling system with PostgreSQL logging and rate-limited notifications

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 su...

CommunicationHITLCore NodesDevelopmentData & StorageError TriggerPostgresSticky Note
Loading interactive preview...

Template notes

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 all errors but limit alerts to a maximum of one notification every 5 minutes.

What this workflow does

This workflow can be configured to receive error events, or you can integrate it before your own error-handling logic.

If used as the primary error handler, note that this flow will only add a database log entry and take no further action. You’ll need to add your own alerts (e.g., email or push notifications). Below is an example of a notification setup I prefer to use.

At the end, there’s an error cleanup option. This feature is particularly useful in development environments.