Secure File Upload and Categorization using Supabase Storage - n8n Workflow

Deploy a robust n8n workflow to categorize files by MIME type, upload them to Supabase Storage, and instantly generate a secure, expiring signed URL for access. This n8n templates solution utilizes core n8n node functions.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Developers and engineers integrating file uploads into microservices.

  • Automation specialists needing scalable cloud storage solutions.

  • Users building custom APIs or action workflows in n8n.

  • Anyone looking for robust n8n templates for handling binary data and secure access control.

Overview

Managing file uploads securely and efficiently is a critical requirement for modern applications. This robust n8n workflow provides a reusable structure for receiving file data (encoded in Base64), automatically routing it to the correct Supabase Storage bucket based on MIME type, and ensuring that access is secure via a generated signed URL.

Designed as an 'Action Workflow,' this powerful n8n workflow is intended to be called by a primary n8n trigger or another parent workflow, centralizing your file handling logic. It leverages the flexibility of the n8n node ecosystem, specifically the HTTP Request node, to interact directly with the Supabase API, solving the problem of requiring specific Supabase credentials across multiple services by providing a temporary, secure link.

How it Works

This n8n workflow starts with a specialized n8n trigger: When Executed by Another Workflow. It expects key input data: mimetype, originalfilename, and the file's binarydatabase64 string.


  1. Preparation and Categorization: The Prepare Upload Data n8n node dynamically determines the target bucket (image-files, audio-files, video-files, or document-files) based on the input mime_type.

  2. Conversion: The Convert to File n8n node reverses the encoding, turning the Base64 string back into a storable binary file object, a necessary step before upload.

  3. Upload: The Upload to Supabase Storage n8n node (an HTTP Request) posts the binary file to the determined bucket path in Supabase. This crucial n8n node includes robust error handling to manage upload failures.

  4. Signing: Upon successful upload, the Generate Signed Url n8n node sends a secondary HTTP Request to the Supabase signing endpoint, requesting a URL that expires in 30 days (2,592,000 seconds).

  5. Finalization: The add domain n8n node ensures the relative signed URL is prefixed with the full domain path.

  6. Response: The workflow concludes by providing a clean Success Response containing the full, secure signed URL, ready for use by the calling n8n workflow.

Installation Guide

To utilize this n8n templates component, follow these steps:


  1. Import: Import the provided n8n workflow JSON into your n8n instance.

  2. Supabase Credentials: You must configure a new Supabase API credential within n8n.

You will need your Supabase Project URL (API URL).
The API Key (preferably a Service Role Key or an appropriate anon key, depending on your RLS settings).

  1. Configure HTTP Nodes: The Upload to Supabase Storage and Generate Signed Url n8n node instances contain placeholders for the Supabase domain (e.g., https://api-sb.janwillemaltink.com). You must replace this URL with your actual Supabase project domain URL.

  2. Bucket Setup: Ensure you have the necessary storage buckets created in your Supabase instance: image-files, audio-files, video-files, and document-files (or modify the Prepare Upload Data n8n node logic to match your desired structure).

  3. Testing: Use the included temp form to test workflow n8n trigger for initial checks, but remember to disable or remove this temporary n8n node before deployment, relying only on the When Executed by Another Workflow n8n trigger for production use.

Node Details

When Executed by Another Workflow (n8n Trigger):
Function: Acts as the primary entry point, allowing this workflow to be called synchronously by other n8n workflow instances. It defines the required input schema (mimetype, originalfilename, binarydatabase64).
Key Configuration: Input fields are explicitly defined for structured data transfer.
Prepare Upload Data (Set n8n node):
Function: Contains custom JavaScript logic to evaluate the input mimetype and assign the appropriate bucketname. This is vital for organized cloud storage.
Key Configuration: Creates the bucketname value based on MIME type prefix matching (e.g., image/ goes to image-files).
Convert to File (Convert To File n8n node):
Function: Converts the large Base64 text string back into a binary file format, which the following HTTP Request n8n node can correctly send.
Key Configuration: Operation: toBinary. Source property is mapped to binarydata_base64.
Upload to Supabase Storage (HTTP Request n8n node):
Function: Executes the file upload using a POST request to the Supabase Storage endpoint. It uses the Supabase API credential for authorization.
Key Configuration: Method: POST. Content Type: binaryData. URL uses dynamic expressions for bucket and file name.
Generate Signed Url (HTTP Request n8n node):
Function: Requests a secure, time-limited URL for the newly uploaded object path (Key) from the Supabase API.
* Key Configuration: JSON Body defines expiresIn: 2592000 (30 days). Uses the same Supabase API credential.

Related n8n Workflows

Free

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

Featured*