Log errors and audit events with n8n Data Tables
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.
What this workflow does
This workflow has 12 nodes and runs when another workflow fails (error workflow) (plus 2 other triggers). It uses only n8n's built-in nodes.
How it runs
Trigger: When another workflow fails (error workflow) (plus 2 other triggers).
- Normalize Error Event (Code): runs custom JavaScript code
- Normalize Audit Event (Code): runs custom JavaScript code
- Build Purge Config (Code): runs custom JavaScript code
- Insert ErrorLog (Data table): uses Data table
- Insert AuditLog (Data table): uses Data table
- Delete old ErrorLog rows (Data table): delete rows
- Delete old AuditLog rows (Data table): delete rows
- Build Purge Audit Event (Code): runs custom JavaScript code
- Insert Purge AuditLog (Data table): uses Data table
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.
Check at runtime on n8n 3.0
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (5)
- Error Trigger
n8n-nodes-base.errorTrigger - Code
n8n-nodes-base.code - Data table
n8n-nodes-base.dataTable - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
How it works This workflow provides a reusable error handling, audit logging, and observability pattern for n8n workflows using two n8n custom Data Tables: AuditLog and ErrorLog. It is designed to be used across multiple workflows as a central logging…