Skip to content
FlowHubFluxonLab
A
AI Automationfree

Split Test Different Agent Prompts with Supabase and OpenAI

by Chris Carradapted from n8n official workflow galleryUpdated Aug 2026
RequiresAAI AgentOpenAI Chat ModelOpenAI Chat ModelPostgres Chat MemoryPostgres Chat MemorySupabaseSupabase
Share Post Share
ChWhen chat message receivedWhen chat messa…AgAI AgentCheck If Session ExistsCheck If Sessio…IfIf Session Does ExistIf Session Does…Assign Path To SessionAssign Path To …SeDefine Path ValuesDefine Path Val…OpenAI Chat ModelOpenAI Chat Mod…MPPostgres Chat MemoryPostgres Chat M…SeGet Correct PromptGet Correct Pro…123456789
1/5
STEPS · 9
Starts from a chat message

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.

Tags

n8nreference-onlyagentlm-chat-open-aimemory-postgres-chatsupabase
Connects
AAI AgentopenaichatmodelOpenAI Chat ModelpostgreschatmemoryPostgres Chat MemorysupabaseSupabase
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes9
AddedFeb 24, 2025

Related workflows

See all AI Automation
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
AopenaichatmodelserpapigooglesearchS
free

Slack chatbot powered by AI

This workflow offers an effective way to handle a chatbot's functionality, making use of multiple tools for information retrieval, conversation context storage, and message sending. It's a setup tailored for a Slack environment, aiming to offer an interactive, AI-driven chatbot experience. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
Agmailopenaichatmodeltextclassifier
free

Suggest meeting slots using AI

The purpose of this n8n workflow is to automate the process of identifying incoming Gmail emails that are requesting an appointment, evaluating their content, checking calendar availability, and then composing and sending a response email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team