Comprehensive API Design using Webhooks and Supabase - n8n Workflow

Learn to build secure, full CRUD APIs with Supabase using this detailed n8n workflow. Understand various HTTP methods, authentication, and custom responses with the n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • API Developers: Individuals learning how to expose backend services (like Supabase) via robust RESTful APIs using n8n.

  • Automation Engineers: Users looking to master the advanced features of the n8n Webhook trigger node, including security settings and response modes.

  • Technical Educators: Those seeking ready-made n8n templates to teach concepts like CRUD operations, idempotent requests (PUT), and partial updates (PATCH).

  • Supabase Users: Developers who need an easy way to automate database interactions without writing extensive server-side code, utilizing this specialized n8n workflow.

Overview

This extensive n8n workflow serves as both a practical template and a comprehensive educational tool for building robust, secure APIs. By utilizing multiple n8n trigger Webhook nodes, it maps out the standard CRUD operations (Create, Read, Update, Delete) directly to a Supabase database.

Every major HTTP method (GET, POST, PATCH, DELETE) is demonstrated, showing how to correctly process incoming data and interact with a backend service. Detailed sticky notes within the n8n workflow explain critical concepts such as Basic Auth, Header Auth, JWT security options, IP whitelisting, and the different response modes available on the n8n node. This particular n8n workflow ensures developers understand how to secure their endpoints while providing immediate or deferred responses.

How it Works

This single n8n workflow is comprised of multiple independent branches, each triggered by a specific HTTP method routed to the same webhook path.


  1. Read (GET Trigger): The initial n8n trigger listens for a GET request. It extracts an email query parameter from the incoming request. This data is passed to the Supabase n8n node (Get a row), which retrieves matching contact information. The data is then immediately returned to the caller via a dedicated 'Respond to Webhook' n8n node.

  2. Create (POST Trigger): A POST request n8n trigger receives a JSON payload. An intermediate Set n8n node extracts the request body and prepares it. The Supabase n8n node (Create a row) then inserts this new record into the demo_contacts table. Finally, the success status is returned using a 'Respond to Webhook' n8n node.

  3. Update (PATCH Trigger): This branch is activated by a PATCH request, typically used for partial updates. After the Webhook n8n trigger, a Set n8n node processes the body. The Supabase n8n node (Update a row) uses the provided id to modify only the fields included in the request payload.

  4. Delete (DELETE Trigger): The DELETE n8n trigger listens for requests meant to remove resources. It captures an id query parameter, which the Supabase n8n node (Delete a row) uses to permanently remove the corresponding entry from the database. The comprehensive design of this n8n workflow ensures proper handling of all typical API interactions.

Installation Guide

To use this powerful n8n templates workflow, follow these steps:


  1. Import: Copy the entire JSON code provided and paste it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. Credentials Setup: Locate the Supabase n8n nodes (Get a row, Create a row, etc.). You must configure the Supabase API credentials. This requires your Supabase Project URL and your Service Role Key (API Key).

  3. Database Configuration: Ensure you have a table named demo_contacts set up in your Supabase project that aligns with the data structure you intend to send/receive.

  4. Activation: Once credentials are set and the database table is confirmed, activate the n8n workflow by setting it to 'Active' (Production mode) in the top-right corner. The Webhook n8n trigger URLs will then be ready for external use.

Node Details

This n8n workflow utilizes several key n8n node types to achieve its goal:

Webhook (n8n trigger): Multiple instances are configured for different HTTP methods (GET, POST, PATCH, DELETE, PUT, HEAD). They all share the same path (07aaa04d-6c73-416f-82e2-1e6ededeacc4). The GET and POST nodes are set to return a response via a later Respond to Webhook n8n node.
Set (Edit Fields): Used after the POST and PATCH n8n trigger nodes to reorganize or extract the input data, often mapping the raw $json.body to the structure needed for the Supabase n8n node.
Supabase (CRUD Operations): Four instances of the Supabase n8n node handle database interaction:
Get a row: Uses a filter based on email query parameter ($json.query.email).
Create a row: Maps incoming data automatically (autoMapInputData).
Update a row: Filters by id to ensure only the specified row is updated.
Delete a row: Filters by id query parameter for deletion.
Respond to Webhook (n8n node): Ensures a clean and controlled response is sent back to the external system that initiated the n8n workflow, confirming the database operation succeeded or returning the requested data.

Related n8n Workflows

Free

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

I’m Wayne, an AI, automation & low-code consultant, passionate about helping businesses unlock their potential through smart, practical solutions. Contact me at https://www.nocodecreative.io

Featured*