Log tamper-evident append-only audit trails with Supabase Postgres
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-10-19.
Nodes used (10)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Crypto
n8n-nodes-base.crypto - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - Schedule Trigger
n8n-nodes-base.scheduleTrigger - n8n Form Trigger
n8n-nodes-base.formTrigger - No Operation, do nothing
n8n-nodes-base.noOp
What it does
Quick overview This workflow logs append-only audit events to a Supabase Postgres table with database-enforced sequencing and hash chaining, then verifies the chain integrity on demand or on a schedule, with an optional test form that confirms UPDATE and DELETE operations are blocked. How it works 1. Runs either manually to generate demo events, on a schedule to verify integrity, or when called from another workflow via Execute Workflow to receive an audit event. 2. For the demo path, creates five fictional events, hashes each original payload with SHA-256, and prepares the audit fields (workflow and execution context, actor, reason, and details). 3. Validates incoming audit events, enforcing required fields and allowed values, normalizing optional fields, and deriving a correlation ID when one is not provided. 4. Inserts the validated event into the Supabase Postgres auditlog table and returns the assigned sequence number, timestamp, and record hash. 5. For demo runs, queries Supabase to recompute and verify the full hash chain and reports whether the chain is intact or identifies the first broken sequence. 6. For optional functional tests, accepts a confirmation form submission and attempts an UPDATE and DELETE in Supabase, reporting PASS when the database rejects both operations. Setup 1. Create a Supabase project and run the provided SQL in the Supabase SQL Editor to create the auditlog table plus triggers and verification functions. 2. Create a Postgres credential in n8n using your Supabase connection details (use the Session Pooler string if needed) and select it in the nodes that write, verify, and run the optional UPDATE/DELETE tests. 3. If you use this as a shared logger, call it from your other workflows with an Execute Workflow node and pass action, status, and the source workflow/execution fields (and any optional actor, reason, details, correlationid, or payloadhash). 4. Set the integrity-check schedule interval to your needs and, before production use, remove the optional functional test section since it intentionally tries to update and delete audit records.