Author: Cole Medin
This is a sample n8n workflow that demonstrates the minimal required components to build an agent for the Live Agent Studio. It serves as a template and reference implementation for creating new agents.
This repository includes two n8n workflow implementations:
-
Base Sample Agent (
Base_Sample_Agent.json
)- The primary workflow that demonstrates how to manage input, output, and conversation history for the Live Agent Studio
- Recommended for most use cases
- Provides complete control over conversation history management
- Uses Supabase for message storage
-
Agent Node Sample (
Agent_Node_Sample_Agent.json
)- A variation that utilizes n8n's built-in "Agent" node
- Simplified implementation where conversation history is managed by the Agent node
- Fully compatible with the Live Agent Studio
- Ideal for simpler agent use cases
-
Webhook Endpoint
- Accepts POST requests with authentication
- Processes incoming queries with user and session information
- Provides secure communication via header authentication
-
Input Processing
- Extracts key fields from incoming requests:
- query: The user's question or command
- user_id: Unique identifier for the user
- request_id: Request tracking ID
- session_id: Current session identifier
- Extracts key fields from incoming requests:
-
Database Integration
- Uses Supabase for message storage (Agent Node variation is any Postgres database)
- Records both user messages and AI responses
- Maintains conversation history with metadata
-
Response Handling
- Structured response format for consistency
- Includes success/failure status
- Returns formatted responses via webhook
-
Webhook Node
- Entry point for all requests
- Validates authentication headers (optional, we can add once we host for you on the Studio)
- Routes incoming POST requests
-
Prep Input Fields Node
- Extracts and formats input data
- Validates required fields
- Prepares data for processing
-
Database Nodes
- "Add User Message to DB": Records incoming user queries
- "Add AI Message to DB": Stores AI responses
- For the Agent Node variation, this is handled by the "Agent" node
-
Output Preparation
- Sets success status
- Formats response data
- Ensures consistent output structure
-
Header Auth
- Used for webhook authentication
- Ensures secure communication
-
Supabase API
- Required for database operations
- Stores conversation history
These credentials will be swapped over to our own once we host the agent for you!
- Import this workflow as a template for new agents
- Configure the required credentials:
- Set up header authentication (optional, we can add once we host for you on the Studio)
- Configure Supabase connection
- Customize the workflow by adding:
- Additional processing nodes
- Specialized AI model integrations
- Custom business logic
{
"query": "User's question or command",
"user_id": "unique-user-identifier",
"request_id": "request-tracking-id",
"session_id": "conversation-session-id"
}
{
"success": true,
"output": "AI response content",
"data": "Additional response data"
}
This agent is part of the oTTomator agents collection. For contributions or issues, please refer to the main repository guidelines.