Centralized Structured Logging System with Supabase - n8n Workflow

Set up enterprise-grade centralized logging for all your automation projects using this reusable n8n workflow template. Store structured logs (DEBUG, INFO, FATAL) in Supabase.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Automation developers needing a persistent, searchable audit trail for their processes.
Teams requiring robust error handling and monitoring across their n8n instance.
Users looking for a scalable alternative to local logging within the n8n environment.
Engineers wanting to implement Log4j2-style log levels (TRACE, DEBUG, INFO, WARN, ERROR, FATAL) within an n8n workflow structure.

Overview

Debugging and auditing complex automations often requires more than simple console output. This powerful n8n workflow provides a universal logging endpoint, allowing any other n8n workflow to send structured log data—complete with log level, execution ID, n8n node name, and custom metadata—directly to a dedicated Supabase table.

The system is designed around the concept of a reusable sub-workflow, meaning once imported, any parent n8n workflow can trigger it using the Execute Workflow n8n node, simplifying deployment and ensuring consistency. By leveraging Supabase, you gain a high-performance, queryable database solution, perfect for building real-time dashboards or performing deep forensic analysis on your automation run data. This approach elevates the capabilities of standard n8n templates for production systems.

How it Works

This logging solution functions as a callable sub-workflow, triggered by the Execute Workflow n8n node in your main projects.


  1. Trigger Initiation: The When Log Traced n8n trigger node initiates the sub-workflow upon being called. It is configured to explicitly expect crucial data points from the calling parent n8n workflow: workflowname, nodename, executionid, loglevel, message, and optional metadata.

  2. Data Preparation (External): A parent n8n workflow uses a Code n8n node (or similar logic) to assemble the log payload, dynamically setting the appropriate log_level (e.g., INFO, DEBUG, FATAL) and capturing execution context variables. The provided n8n templates include examples demonstrating how to format an INFO message or capture error details for a FATAL message.

  3. Logging Action: The structured data payload is passed directly to the Create Log n8n node, which integrates with Supabase.

  4. Supabase Insertion: The Supabase n8n node is configured to automatically insert the mapped input data into the pre-configured logs table, thereby persisting the structured log record. This process ensures consistent, centralized logging across your entire n8n workflow ecosystem.

Installation Guide

To use this advanced n8n workflow template, follow these steps:


  1. Import: Import this n8n workflow JSON into your n8n instance.

  2. Supabase Setup (Prerequisite): Before setting up credentials, you must configure your Supabase database structure exactly as defined in the sticky note:

Create an Enumerated Type named logleveltype with values: TRACE, DEBUG, INFO, WARN, ERROR, FATAL.
Create a table named logs with the following non-nullable columns: workflowname (text), nodename (text), executionid (text), loglevel (logleveltype), message (text), and an optional metadata (jsonb) column.

  1. Credentials: Set up your Supabase API n8n credentials (referencing the required API key and connection details) and link them to the Create Log n8n node.

  2. Usage: To log data from another project, use the Execute Workflow n8n node, targeting this template's ID, and map your prepared data payload to the expected inputs (workflowname, loglevel, etc.).

Node Details

This foundational n8n workflow relies on two primary nodes for its functionality:

When Log Traced (Execute Workflow Trigger n8n node):
Function: This node acts as the centralized API endpoint for the sub-workflow. It starts the execution when called by an Execute Workflow n8n node from another project, making this a highly reusable n8n workflow component.
Key Configuration: It explicitly defines the expected inputs: workflowname, nodename, executionid, loglevel, message, and metadata.
Create Log (Supabase n8n node):
Function: Handles the secure connection and data insertion into the PostgreSQL database hosted by Supabase.
Key Configuration: The operation is set to "Create". The target table is logs. It uses the autoMapInputData feature to automatically align the incoming trigger data with the corresponding database columns, ensuring seamless structured data storage.

Note on Example Nodes: The n8n template includes disabled Code and Error Trigger n8n nodes (Log Info, Log Fatal, Error Trigger) which serve purely as examples demonstrating how a main n8n workflow would structure the input data (e.g., extracting error information) before calling this reusable n8n workflow.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Web designer & AI automation creator. I build clean, conversion-ready sites and n8n workflows that take your content from idea to publish, on autopilot, in your voice. Grab my templates or message me for a custom build.

Featured*