Skip to main content

MCP Supabase server for AI agent with RAG & multi-tenant CRUD

Workflow preview

Workflow preview
100%
MCP Supabase server for AI agent with RAG & multi-tenant CRUD preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Supabase AI Agent with RAG & Multi Tenant CRUD Version : 1.0.0 n8n Version : 1.88.0+ Author : Koresolucoes License : MIT Description A stateful AI agent workflow powered by Supabase and Retrieval A...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.mcptrigger, @n8n/n8n-nodes-langchain.vectorstoresupabase, @n8n/n8n-nodes-langchain.embeddingsopenai, n8n-nodes-base.stickynote, n8n-nodes-base.supabasetool

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Luciano Gutierrez.

Original n8n.io source

1.1 Workflow description

Title
MCP Supabase server for AI agent with RAG & multi-tenant CRUD
Workflow name
MCP Supabase server for AI agent with RAG & multi-tenant CRUD

Supabase AI Agent with RAG & Multi-Tenant CRUD

Version: 1.0.0
n8n Version: 1.88.0+
Author: Koresolucoes License: MIT


Description

A stateful AI agent workflow powered by Supabase and Retrieval-Augmented Generation (RAG). Enables persistent memory, dynamic CRUD operations, and multi-tenant data isolation for AI-driven applications like customer support, task orchestration, and knowledge management.

Key Features:

  • 🧠 RAG Integration: Leverages OpenAI embeddings and Supabase vector search for context-aware responses.
  • πŸ—ƒοΈ Full CRUD: Manage agent_messages, agent_tasks, agent_status, and agent_knowledge in real time.
  • πŸ“€ Multi-Tenant Ready: Supports per-user/organization data isolation via dynamic table names and webhooks.
  • πŸ”’ Secure: Role-based access control via Supabase Row Level Security (RLS).

Use Cases

  1. Customer Support Chatbots: Persist conversation history and resolve queries using institutional knowledge.
  2. Automated Task Management: Track and update task statuses dynamically.
  3. Knowledge Repositories: Store and retrieve domain-specific information for AI agents.

Instructions

1. Import Template

  • Go to n8n > Templates > Import from File and upload this workflow.

2. Configure Credentials

  • Add your Supabase and OpenAI API keys under Settings > Credentials.

3. Set Up Multi-Tenancy (Optional)

  • Dynamic Webhook Path:
    Replace the default webhook path with /mcp/tool/supabase/:userId to enable per-user routing.
  • Table Names:
    Use a Set Node to dynamically generate table names (e.g., agent_messages_{{userId}}).

4. Activate & Test

  • Enable the workflow and send test requests to the webhook URL.

Tags

AI Agent RAG Supabase CRUD Multi-Tenant OpenAI Automation


Screenshots


License

This template is licensed under the MIT License.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - MCP_SUPABASE

Type / Role
@n8n/n8n-nodes-langchain.mcpTrigger - mcpTrigger
Config choices
Version 1

Block 2 - RAG

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.1

Block 3 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 4 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - DELETE_ROW_INSCRICOES_CURSOS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 9 - GET_ROW_AGENT_MESSAGE

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 10 - CREATE_ROW_AGENT_MESSAGE

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 11 - DELETE_ROW_AGENT_MESSAGE

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 12 - UPDATE_ROW_AGENT_MESSAGE

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 13 - GET_MANY_ROW_AGENT_MESSAGE

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 14 - CREATE_ROW_AGENT_TASKS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 15 - GET_ROW_AGENT_TASKS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 16 - DELETE_ROW_AGENT_TASKS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 17 - UPDATE_ROW_AGENT_TASKS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 18 - GET_MANY_ROW_AGENT_TASKS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 19 - CREATE_ROW_AGENT_STATUS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 20 - GET_ROW_AGENT_STATUS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 21 - DELETE_ROW_AGENT_STATUS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 22 - UPDATE_ROW_AGENT_STATUS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 23 - GET_MANY_ROW_AGENT_STATUS

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 24 - CREATE_ROW_AGENT_KNOWLEDGE

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow MCP Supabase server for AI agent with RAG & multi-tenant CRUD
Complexity advanced
Nodes 27
Categories Support Chatbot, AI RAG
Author Luciano Gutierrez
Published 23 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3675/3675.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does MCP Supabase server for AI agent with RAG & multi-tenant CRUD do?

Supabase AI Agent with RAG & Multi Tenant CRUD Version : 1.0.0 n8n Version : 1.88.0+ Author : Koresolucoes License : MIT Description A stateful AI agent workflow powered by Supabase and Retrieval A...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI RAG use case.