Back to Integrations
integrationPostgres Chat Memory node
integrationSupabase node

Postgres Chat Memory and Supabase integration

Save yourself the work of writing custom integrations for Postgres Chat Memory and Supabase and use n8n instead. Build adaptable and scalable AI, Langchain, and Data & Storage workflows that work with your technology stack. All within a building experience you will love.

How to connect Postgres Chat Memory and Supabase

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Postgres Chat Memory and Supabase integration: Create a new workflow and add the first step

Step 2: Add and configure Postgres Chat Memory and Supabase nodes

You can find Postgres Chat Memory and Supabase in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure Postgres Chat Memory and Supabase nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Postgres Chat Memory and Supabase integration: Add and configure Postgres Chat Memory and Supabase nodes

Step 3: Connect Postgres Chat Memory and Supabase

A connection establishes a link between Postgres Chat Memory and Supabase (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

Postgres Chat Memory and Supabase integration: Connect Postgres Chat Memory and Supabase

Step 4: Customize and extend your Postgres Chat Memory and Supabase integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect Postgres Chat Memory and Supabase with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Postgres Chat Memory and Supabase integration: Customize and extend your Postgres Chat Memory and Supabase integration

Step 5: Test and activate your Postgres Chat Memory and Supabase workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Postgres Chat Memory to Supabase or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

Postgres Chat Memory and Supabase integration: Test and activate your Postgres Chat Memory and Supabase workflow

Allow Users to Send a Sequence of Messages to an AI Agent in Telegram

Use Case
When creating chatbots that interface through applications such as Telegram and WhatsApp, users can often sends multiple shorter messages in quick succession, in place of a single, longer message. This workflow accounts for this behaviour.
What it Does
This workflow allows users to send several messages in quick succession, treating them as one coherent conversation instead of separate messages requiring individual responses.
How it Works
When messages arrive, they are stored in a Supabase PostgreSQL table
The system waits briefly to see if additional messages arrive
If no new messages arrive within the waiting period, all queued messages are:
Combined and processed as a single conversation
Responded to with one unified reply
Deleted from the queue
Setup
Create a table in Supabase called message_queue. It needs to have the following columns: user_id (uint8), message (text), and message_id (uint8)
Add your Telegram, Supabase, OpenAI, and PostgreSQL credentials
Activate the workflow and test by sending multiple messages the Telegram bot in one go
Wait ten seconds after which you will receive a single reply to all of your messages
How to Modify it to Your Needs
Change the value of Wait Amount in the Wait 10 Seconds node in order to to modify the buffering window
Add a System Message to the AI Agent to tailor it to your specific use case
Replace the OpenAI sub-node to use a different language model

Nodes used in this workflow

Popular Postgres Chat Memory and Supabase workflows

Allow Users to Send a Sequence of Messages to an AI Agent in Telegram

Use Case When creating chatbots that interface through applications such as Telegram and WhatsApp, users can often sends multiple shorter messages in quick succession, in place of a single, longer message. This workflow accounts for this behaviour. What it Does This workflow allows users to send several messages in quick succession, treating them as one coherent conversation instead of separate messages requiring individual responses. How it Works When messages arrive, they are stored in a Supabase PostgreSQL table The system waits briefly to see if additional messages arrive If no new messages arrive within the waiting period, all queued messages are: Combined and processed as a single conversation Responded to with one unified reply Deleted from the queue Setup Create a table in Supabase called message_queue. It needs to have the following columns: user_id (uint8), message (text), and message_id (uint8) Add your Telegram, Supabase, OpenAI, and PostgreSQL credentials Activate the workflow and test by sending multiple messages the Telegram bot in one go Wait ten seconds after which you will receive a single reply to all of your messages How to Modify it to Your Needs Change the value of Wait Amount in the Wait 10 Seconds node in order to to modify the buffering window Add a System Message to the AI Agent to tailor it to your specific use case Replace the OpenAI sub-node to use a different language model
+16

🤖 AI-Powered WhatsApp Assistant for Restaurants & Delivery Automation

AI-Powered WhatsApp Assistant for Restaurant & Delivery – Automate Orders, Calculate Delivery Fees & Enhance Customer Service with n8n 📌 Optimize your restaurant's delivery process with AI-powered automation! This n8n workflow enables an intelligent WhatsApp assistant for restaurants, burger joints, and delivery businesses. The AI chatbot efficiently handles orders, calculates delivery fees based on distance, manages customer interactions, and seamlessly integrates with your CRM and database for streamlined operations. ⚠️ Important Notice: This template is only compatible with self-hosted n8n instances as it uses community nodes. Ensure secure credential management when configuring APIs. 🔹 Key Features ✅ AI-Powered Order Processing – Automatically receive and confirm orders via WhatsApp. ✅ Real-Time Distance Calculation – Determines the delivery distance and calculates the fee dynamically. ✅ Automated Customer Interaction – Engages customers with intelligent conversation and order updates. ✅ WhatsApp Integration – Processes messages, saves customer details, and retrieves past interactions. ✅ Secure Customer Data Storage – Saves order history, customer preferences, and location details in a database. ✅ Seamless CRM & POS System Integration – Sync orders and customer data with your existing platforms. 📌 How It Works 1️⃣ A customer sends a message via WhatsApp to start an order. 2️⃣ The AI assistant guides them through the menu, recommends items, and confirms their choices. 3️⃣ The system retrieves and saves customer details (name, phone number, and address). 4️⃣ The AI calculates the delivery distance and applies the appropriate delivery fee. 5️⃣ The order details are saved and forwarded to the restaurant’s system for preparation. 6️⃣ The assistant keeps the customer updated about the order status. ⚙️ Setup & Customization 🔧 Webhook for WhatsApp – Capture and process customer messages automatically. 🔧 OpenAI-Powered AI Assistant – Configure conversation flows for natural and engaging interactions. 🔧 Delivery Fee Calculation – Set your delivery price per kilometer and adjust base rates. 🔧 Database & CRM Integration – Store customer details, order history, and location data. 🔧 Customizable Order Flow – Adapt the workflow for different restaurant models. 🔧 Secure Credential Management – Store API keys safely to prevent unauthorized access. 💡 Requirements: This template is recommended for users with basic knowledge of n8n. If you need custom development or setup assistance, contact us via WhatsApp: +55 17 99155-7874. 🚀 Automate order processing, reduce manual tasks, and improve customer satisfaction with AI-powered WhatsApp automation! Assistente de WhatsApp com IA para Restaurantes & Delivery – Automatize Pedidos, Calcule Taxas de Entrega e Melhore o Atendimento ao Cliente com n8n 📌 Otimize o processo de entrega do seu restaurante com automação baseada em IA! Este fluxo para n8n permite criar um atendente virtual inteligente no WhatsApp, ideal para hamburguerias, restaurantes e serviços de delivery. O chatbot baseado em IA recebe pedidos, calcula a taxa de entrega com base na distância, interage com os clientes e integra-se ao seu CRM para operações mais eficientes. ⚠️ Aviso Importante: Este template é compatível apenas com instâncias auto-hospedadas do n8n, pois utiliza nós da comunidade. Certifique-se de gerenciar credenciais de forma segura ao configurar APIs. 🔹 Principais Funcionalidades ✅ Processamento Inteligente de Pedidos – Recebe e confirma pedidos automaticamente via WhatsApp. ✅ Cálculo Dinâmico da Taxa de Entrega – Mede a distância e aplica a taxa correta automaticamente. ✅ Atendimento Automatizado ao Cliente – Interage com clientes de forma natural e profissional. ✅ Integração com WhatsApp – Captura mensagens, armazena dados e recupera histórico de pedidos. ✅ Armazenamento Seguro de Dados do Cliente – Salva pedidos, preferências e endereços de entrega. ✅ Sincronização com CRM e Sistema de PDV – Conecta-se ao seu sistema de gestão para um fluxo contínuo. 📌 Como Funciona 1️⃣ O cliente envia uma mensagem via WhatsApp para iniciar um pedido. 2️⃣ O assistente de IA apresenta o menu, sugere itens e confirma a escolha do cliente. 3️⃣ O sistema captura e salva os dados do cliente (nome, telefone e endereço). 4️⃣ A IA calcula a distância de entrega e aplica a taxa de acordo com a localização. 5️⃣ Os detalhes do pedido são registrados e enviados para a cozinha. 6️⃣ O assistente atualiza o cliente sobre o status do pedido. ⚙️ Configuração e Personalização 🔧 Webhook para WhatsApp – Configuração para capturar e processar pedidos automaticamente. 🔧 Assistente de IA com OpenAI – Configuração de fluxos conversacionais naturais e envolventes. 🔧 Cálculo de Taxa de Entrega – Definição de valores por quilômetro e ajustes de tarifas base. 🔧 Banco de Dados & CRM – Armazena dados de clientes, histórico de pedidos e localização. 🔧 Fluxo de Pedidos Personalizável – Adapte para diferentes tipos de restaurantes e serviços de delivery. 🔧 Gerenciamento Seguro de Credenciais – Proteja suas chaves de API contra acessos não autorizados. 💡 Requisitos: Este template é recomendado para usuários que já possuem conhecimentos básicos em n8n. Se precisar de personalização ou suporte para instalação, entre em contato pelo WhatsApp: +55 17 99155-7874. 🚀 Automatize o processamento de pedidos, reduza tarefas manuais e melhore a satisfação dos clientes com um WhatsApp automatizado e inteligente!
+17

🐶 AI Agent for PetShop Appointments (Agente de IA para agendamentos de PetShop)

🐶🤖 AI Agent for Pet Shops – Automate Customer Service & Bookings! 🐾💡 Transform Your Pet Shop with AI-Powered Automation! 🚀 Enhance customer experience and optimize operations with this n8n AI Agent designed for pet shops. 📲🐾 Automate client interactions, appointment scheduling, and service recommendations—saving time and increasing revenue! 🔹 Key Features: ✅ Instant WhatsApp responses – AI-powered chatbot handles customer inquiries. 💬 ✅ Automated appointment scheduling – Clients can book services hassle-free. 📅✂️ ✅ Personalized reminders – Reduce no-shows with automated notifications. 📢🐾 ✅ Customer data & service history management – Track interactions effortlessly. 📊📁 ✅ Product & service recommendations – Improve sales with smart suggestions. 🎁🐶 📌 How It Works 1️⃣ The workflow captures customer inquiries via WhatsApp. 2️⃣ AI processes requests, provides information, and offers booking options. 3️⃣ Clients can schedule grooming, vet visits, or other services in seconds. 4️⃣ Automated reminders ensure appointments are remembered. 5️⃣ Customer data is stored for better service personalization. ⚙️ Setup & Customization 🔧 Connect your WhatsApp API (evolution) for instant messaging. 🔧 Integrate with Google Calendar for appointment booking. 🔧 Customize reminders, services, and pricing rules to fit your business. 💡 Reduce manual work, improve customer satisfaction, and scale your pet shop with AI automation! 🐶🤖 [PT-BR] Agente de IA para Pet Shops – Atendimento e Agendamentos Automatizados! 🐾💡 Transforme Seu Pet Shop com Automação Inteligente! 🚀 Otimize o atendimento ao cliente e agilize processos com este Agente de IA para n8n. 📲🐾 Automatize interações, agendamentos e recomendações de serviços—economizando tempo e aumentando as vendas! 🔹 Principais Funcionalidades: ✅ Atendimento automático no WhatsApp – IA responde clientes instantaneamente. 💬 ✅ Agendamento de serviços automatizado – Clientes marcam banho, tosa ou consultas facilmente. 📅✂️ ✅ Lembretes personalizados – Reduza faltas com notificações automáticas. 📢🐾 ✅ Gestão de clientes e histórico de serviços – Controle dados de forma eficiente. 📊📁 ✅ Sugestão de produtos e serviços – Venda mais com recomendações inteligentes. 🎁🐶 📌 Como Funciona 1️⃣ O fluxo recebe perguntas dos clientes via WhatsApp. 2️⃣ A IA processa os pedidos e fornece opções de agendamento. 3️⃣ O cliente escolhe o serviço desejado e agenda em segundos. 4️⃣ Lembretes automáticos garantem que os clientes não esqueçam os horários. 5️⃣ O histórico do cliente é salvo para oferecer um atendimento mais personalizado. ⚙️ Configuração e Personalização 🔧 Conecte sua API do WhatsApp (evolution) para interação automática. 🔧 Integre ao Google Calendar para gerenciar agendamentos. 🔧 Personalize valores, serviços e regras de envio de lembretes conforme sua necessidade. 💡 Automatize processos, melhore a experiência do cliente e escale seu pet shop com IA! 🚀

Split Test Different Agent Prompts with Supabase and OpenAI

Split Test Agent Prompts with Supabase and OpenAI Use Case Oftentimes, it's useful to test different settings for a large language model in production against various metrics. Split testing is a good method for doing this. What it Does This workflow randomly assigns chat sessions to one of two prompts, the baseline and the alternative. The agent will use the same prompt for all interactions in that chat session. How it Works When messages arrive, a table containing information regarding session ID and which prompt to use is checked to see if the chat already exists If it does not, the session ID is added to the table and a prompt is randomly assigned These values are then used to generate a response Setup Create a table in Supabase called split_test_sessions. It needs to have the following columns: session_id (text) and show_alternative (bool) Add your Supabase, OpenAI, and PostgreSQL credentials Modify the Define Path Values node to set the baseline and alternative prompt values. Activate the workflow and test by sending messages through n8n's inbuilt chat Experiment with different chat sessions to test see both prompts in action Next Steps Modify the workflow to test different LLM settings such as temperature Add a method to measure the efficacy of the two alternative prompts
+6

WordPress - AI Chatbot to enhance user experience - with Supabase and OpenAI

This is the first version of a template for a RAG/GenAI App using WordPress content. As creating, sharing, and improving templates brings me joy 😄, feel free to reach out on LinkedIn if you have any ideas to enhance this template! How It Works This template includes three workflows: Workflow 1**: Generate embeddings for your WordPress posts and pages, then store them in the Supabase vector store. Workflow 2**: Handle upserts for WordPress content when edits are made. Workflow 3**: Enable chat functionality by performing Retrieval-Augmented Generation (RAG) on the embedded documents. Why use this template? This template can be applied to various use cases: Build a GenAI application that requires embedded documents from your website's content. Embed or create a chatbot page on your website to enhance user experience as visitors search for information. Gain insights into the types of questions visitors are asking on your website. Simplify content management by asking the AI for related content ideas or checking if similar content already exists. Useful for internal linking. Prerequisites Access to Supabase for storing embeddings. Basic knowledge of Postgres and pgvector. A WordPress website with content to be embedded. An OpenAI API key Ensure that your n8n workflow, Supabase instance, and WordPress website are set to the same timezone (or use GMT) for consistency. Workflow 1 : Initial Embedding This workflow retrieves your WordPress pages and posts, generates embeddings from the content, and stores them in Supabase using pgvector. Step 0 : Create Supabase tables Nodes : Postgres - Create Documents Table: This table is structured to support OpenAI embedding models with 1536 dimensions Postgres - Create Workflow Execution History Table These two nodes create tables in Supabase: The documents table, which stores embeddings of your website content. The n8n_website_embedding_histories table, which logs workflow executions for efficient management of upserts. This table tracks the workflow execution ID and execution timestamp. Step 1 : Retrieve and Merge WordPress Pages and Posts Nodes : WordPress - Get All Posts WordPress - Get All Pages Merge WordPress Posts and Pages These three nodes retrieve all content and metadata from your posts and pages and merge them. Important: * *Apply filters to avoid generating embeddings for all site content. Step 2 : Set Fields, Apply Filter, and Transform HTML to Markdown Nodes : Set Fields Filter - Only Published & Unprotected Content HTML to Markdown These three nodes prepare the content for embedding by: Setting up the necessary fields for content embeddings and document metadata. Filtering to include only published and unprotected content (protected=false), ensuring private or unpublished content is excluded from your GenAI application. Converting HTML to Markdown, which enhances performance and relevance in Retrieval-Augmented Generation (RAG) by optimizing document embeddings. Step 3: Generate Embeddings, Store Documents in Supabase, and Log Workflow Execution Nodes: Supabase Vector Store Sub-nodes: Embeddings OpenAI Default Data Loader Token Splitter Aggregate Supabase - Store Workflow Execution This step involves generating embeddings for the content and storing it in Supabase, followed by logging the workflow execution details. Generate Embeddings: The Embeddings OpenAI node generates vector embeddings for the content. Load Data: The Default Data Loader prepares the content for embedding storage. The metadata stored includes the content title, publication date, modification date, URL, and ID, which is essential for managing upserts. ⚠️ Important Note : Be cautious not to store any sensitive information in metadata fields, as this information will be accessible to the AI and may appear in user-facing answers. Token Management: The Token Splitter ensures that content is segmented into manageable sizes to comply with token limits. Aggregate: Ensure the last node is run only for 1 item. Store Execution Details: The Supabase - Store Workflow Execution node saves the workflow execution ID and timestamp, enabling tracking of when each content update was processed. This setup ensures that content embeddings are stored in Supabase for use in downstream applications, while workflow execution details are logged for consistency and version tracking. This workflow should be executed only once for the initial embedding. Workflow 2, described below, will handle all future upserts, ensuring that new or updated content is embedded as needed. Workflow 2: Handle document upserts Content on a website follows a lifecycle—it may be updated, new content might be added, or, at times, content may be deleted. In this first version of the template, the upsert workflow manages: Newly added content** Updated content** Step 1: Retrieve WordPress Content with Regular CRON Nodes: CRON - Every 30 Seconds Postgres - Get Last Workflow Execution WordPress - Get Posts Modified After Last Workflow Execution WordPress - Get Pages Modified After Last Workflow Execution Merge Retrieved WordPress Posts and Pages A CRON job (set to run every 30 seconds in this template, but you can adjust it as needed) initiates the workflow. A Postgres SQL query on the n8n_website_embedding_histories table retrieves the timestamp of the latest workflow execution. Next, the HTTP nodes use the WordPress API (update the example URL in the template with your own website’s URL and add your WordPress credentials) to request all posts and pages modified after the last workflow execution date. This process captures both newly added and recently updated content. The retrieved content is then merged for further processing. Step 2 : Set fields, use filter Nodes : Set fields2 Filter - Only published and unprotected content The same that Step 2 in Workflow 1, except that HTML To Makrdown is used in further Step. Step 3: Loop Over Items to Identify and Route Updated vs. Newly Added Content Here, I initially aimed to use 'update documents' instead of the delete + insert approach, but encountered challenges, especially with updating both content and metadata columns together. Any help or suggestions are welcome! :) Nodes: Loop Over Items Postgres - Filter on Existing Documents Switch Route existing_documents (if documents with matching IDs are found in metadata): Supabase - Delete Row if Document Exists: Removes any existing entry for the document, preparing for an update. Aggregate2: Used to aggregate documents on Supabase with ID to ensure that Set Fields3 is executed only once for each WordPress content to avoid duplicate execution. Set Fields3: Sets fields required for embedding updates. Route new_documents (if no matching documents are found with IDs in metadata): Set Fields4: Configures fields for embedding newly added content. In this step, a loop processes each item, directing it based on whether the document already exists. The Aggregate2 node acts as a control to ensure Set Fields3 runs only once per WordPress content, effectively avoiding duplicate execution and optimizing the update process. Step 4 : HTML to Markdown, Supabase Vector Store, Update Workflow Execution Table The HTML to Markdown node mirrors Workflow 1 - Step 2. Refer to that section for a detailed explanation on how HTML content is converted to Markdown for improved embedding performance and relevance. Following this, the content is stored in the Supabase vector store to manage embeddings efficiently. Lastly, the workflow execution table is updated. These nodes mirros the **Workflow 1 - Step 3 nodes. Workflow 3 : An example of GenAI App with Wordpress Content : Chatbot to be embed on your website Step 1: Retrieve Supabase Documents, Aggregate, and Set Fields After a Chat Input Nodes: When Chat Message Received Supabase - Retrieve Documents from Chat Input Embeddings OpenAI1 Aggregate Documents Set Fields When a user sends a message to the chat, the prompt (user question) is sent to the Supabase vector store retriever. The RPC function match_documents (created in Workflow 1 - Step 0) retrieves documents relevant to the user’s question, enabling a more accurate and relevant response. In this step: The Supabase vector store retriever fetches documents that match the user’s question, including metadata. The Aggregate Documents node consolidates the retrieved data. Finally, Set Fields organizes the data to create a more readable input for the AI agent. Directly using the AI agent without these nodes would prevent metadata from being sent to the language model (LLM), but metadata is essential for enhancing the context and accuracy of the AI’s response. By including metadata, the AI’s answers can reference relevant document details, making the interaction more informative. Step 2: Call AI Agent, Respond to User, and Store Chat Conversation History Nodes: AI Agent** Sub-nodes: OpenAI Chat Model Postgres Chat Memories Respond to Webhook** This step involves calling the AI agent to generate an answer, responding to the user, and storing the conversation history. The model used is gpt4-o-mini, chosen for its cost-efficiency.

Build your own Postgres Chat Memory and Supabase integration

Create custom Postgres Chat Memory and Supabase workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

Supabase supported actions

Create
Create a new row
Delete
Delete a row
Get
Get a row
Get Many
Get many rows
Update
Update a row

FAQs

  • Can Postgres Chat Memory connect with Supabase?

  • Can I use Postgres Chat Memory’s API with n8n?

  • Can I use Supabase’s API with n8n?

  • Is n8n secure for integrating Postgres Chat Memory and Supabase?

  • How to get started with Postgres Chat Memory and Supabase integration in n8n.io?

Looking to integrate Postgres Chat Memory and Supabase in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Postgres Chat Memory with Supabase

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon