A/B Split Testing
Configured with Agent, Chat Trigger, OpenAI Chat Model, Memory Postgres Chat, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- AI & models
- Data store
- Routing
- Transform
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When chat message received | Trigger | Chat Trigger | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Check If Session Exists | Data store | Supabase | get |
| If Session Does Exist | Routing | If | See node parameters |
| Assign Path To Session | Data store | Supabase | See node parameters |
| Define Path Values | Transform | Edit Fields | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Postgres Chat Memory | Data store | Memory Postgres Chat | See node parameters |
| Get Correct Prompt | Transform | Edit Fields | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApipostgressupabaseApi
Workflow notes
Modification
Modification
Set the values of the baseline and alternative prompts
Modification
Modification
Replace this sub-node to use a different language model
Setup
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
Split Test Different Agent Prompts with Supabase and OpenAI
Split Test Different 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
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
A/B Split Testing
A/B Split Testing
Purpose and structure
This folder contains the A/B Split Testing workflow. Its executable nodes use agent, chatTrigger, if, lmChatOpenAi, memoryPostgresChat, set, supabase. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When chat message received
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Supabase/1680_Supabase_Stickynote_Automation_Triggered.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- 1. Receive Message
- 2. Determine Prompt for LLM
- 3. AI Agent