Error handling system with PostgreSQL logging and rate limited n
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...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
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.
If you already have an error-handling workflow, you can call this one as a **sub-workflow**. Its final steps include cleanup logic to reset the execution state and terminate the workflow.
Setup
**Verify all Postgres nodes and credentials when using the 'Error Handling Sample'**
How to adjust it to your needs
1) You can set this workflow as a sub-workflow within your existing error-handling setup.
2) Alternatively, you can add the "Error Handling Sample" at the end of this workflow, which sends email and push notifications.
Configuration Requirements:
⚠️ You must create a database table for this to work!
DDL of this sample:
create table p1gq6ljdsam3x1m."N8Err" ( id serial primary key, created_at timestamp, updated_at timestamp, created_by varchar, updated_by varchar, nc_order numeric, title text, "URL" text, "Stack" text, json json, "Message" text, "LastNode" text );
alter table p1gq6ljdsam3x1m."N8Err" owner to postgres;
create index "N8Err_order_idx" on p1gq6ljdsam3x1m."N8Err" (nc_order);
by Davi Saranszky Mesquita https://www.linkedin.com/in/mesquitadavi/
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Error_handling_system_with_PostgreSQL_logging_and_rate_limited_n.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related Social Media & Content Workflows
View All in Social Media & Content →AI Auto-Tagging for WordPress Posts
Production-ready n8n automation template for AI Auto-Tagging for WordPress Posts built by AhiXLight. Seamlessly connects Lm Chat Open Ai, Output Parser Autofixing, Output Parser Structured with 32 configured nodes.
AI Auto-Tagging for WordPress Posts
Production-ready n8n automation template for AI Auto-Tagging for WordPress Posts built by AhiXLight. Seamlessly connects Lm Chat Open Ai, Output Parser Autofixing, Output Parser Structured with 32 configured nodes.
AI Image Caption Generator Overlay
Production-ready n8n automation template for AI Image Caption Generator Overlay built by AhiXLight. Seamlessly connects Lm Chat Google Gemini, Output Parser Structured, Edit Image with 16 configured nodes.
AI Image Caption Generator with Overlay
Production-ready n8n automation template for AI Image Caption Generator with Overlay built by AhiXLight. Seamlessly connects Lm Chat Google Gemini, Output Parser Structured, Edit Image with 16 configured nodes.