πŸ”¬ Automate document approvals with multi-level workflows using Supabase & Gmail

⚑ 662 views Β· πŸ”¬ Document Extraction & Analysis

Description

Multi-Level Document Approval & Audit Workflow

This workflow automates a document approval process using Supabase and Gmail.


Who it’s for


How it works

  1. Form Trigger – A user submits a document via the form.
  2. Supabase Integration – The document is saved in the documents table.
  3. Supabase Storage – The document is saved in the bucket.
  4. Workflow Levels – Fetches the correct approval level from workflow_levels.
  5. Assign Approvers – Matches approvers by role from the users table.
  6. Approval Record – Creates an approvals record with a unique token and expiry.
  7. Email Notification – Sends an email with Approve / Reject links.
  8. Audit Logs – Records every approval request in audit_logs.
  9. Repeat - repeat the flow till all the aproval level is comepted

How to set up


Customization


Important steps

1. Form Submit

2. Webhook Entry Point


3. Approval Data Retrieval & Update


4. Decision Check


5. Workflow Level Progression

βœ… If Next Level Exists:

❌ If No Next Level (Last Level):


6. Audit Logging


πŸ“¨ Email Template

Approval request email includes decision links:

<p>Please review the document:</p>
<p>
  <a href="http://localhost:5678/webhook-test/doc-approval?token={{$json.token}}&decision=approved">βœ… Approve</a> |
  <a href="http://localhost:5678/webhook-test/doc-approval?token={{$json.token}}&decision=rejected">❌ Reject</a>
</p> 

Happy Automating! πŸš€

πŸ”— Nodes Used

HTTP Request, Webhook, Gmail, Supabase, n8n Form Trigger, n8n Form

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup