Built an Event Discovery AI Agent using No-Code under 15 mins

Built an Event Discovery AI Agent using No-Code under 15 mins

This comprehensive guide will walk you through creating an intelligent events discovery agent (an agent that discovers public events happening in the US) using n8n (an open-source workflow automation platform) and rigorously testing it with Maxim (an agent testing platform).

What We'll Build

We’re going to create an AI agent that:

  • Discovers public event information from a Google Sheets database
  • Responds to user queries about events in the USA
  • Maintains conversation history for seamless multi-turn interactions
  • Provides detailed event information based on user preferences

Prerequisites

Before we start, ensure you have:

  • Access to the n8n platform
  • A Google account with API credentials
  • A Maxim account for testing
  • A basic understanding of API endpoints and JSON

If you’d like to follow along with a video tutorial, refer to this link:


Part 1: Building the Agent in n8n

Step 1: Understanding n8n Architecture

In n8n, workflows are constructed using components (called nodes) that flow from left to right. The key components we'll use include:

  • AI Agent Node – The core intelligence
  • Google Gemini Chat Model – The language model
  • Memory/Session Management – For conversation continuity
  • Google Sheets – Our data source
  • Webhook – The API endpoint for client access

Step 2: Setting Up the Data Source

Create a Google Sheet with your event data, using the following columns:

  • Event Name
  • Date
  • Location
  • Description
  • Registration Link
  • Category (e.g., Tech, Product Management, etc.)

Step 3: Configuring the AI Agent Node

  1. Add the AI Agent Node
    • Search for "AI Agent" in n8n
    • Add it to your workflow
  2. Configure the System Prompt
You are a helpful assistant that helps users find relevant information about events, specifically public events. Respond to users in a cordial and welcoming manner.

Set Up the User Message Template

Based on the user input: [USER_INPUT]

Respond to the user cordially and helpfully. If the user needs help regarding events, use information available in the Google Sheet with details of events in 2025.

Important guidelines:
- Don't mention the tool, prompt, or database to the user
- Always check the Google Sheets database before responding about events
- Provide accurate and relevant event information

Step 4: Adding the Intelligence Layer

  1. Add the Google Gemini Chat Model
    • Search for "Google Gemini"
    • Add and configure with your API credentials
    • Choose the Gemini Pro model (or Gemini Flash for image-based tasks)
  2. Alternative LLM Options
    • You can also use OpenAI by searching for "OpenAI" and configuring it accordingly

Step 5: Implementing Session Management

  1. Add the Memory Component
    • Maintains conversation history per user
    • Use sessionId from the request body to identify users
    • Enables smooth multi-turn conversations

Step 6: Connecting Google Sheets

  1. Add the Google Sheets Node
    • Search and add the node
    • Connect using your Google credentials
    • Link to your events spreadsheet
    • This acts as a "tool call" for the AI Agent

Step 7: Setting Up the Webhook Endpoint

  1. Configure the Webhook
    • Add a webhook node
    • Set the method to POST
    • This will serve as your API endpoint
  2. Set Up Authentication
    • Use basic authentication
    • Add a header key: X-agent-token
    • Generate a secure token (static or rotating)
  3. Parse the Request Body
    • Extract query from JSON.body.query
    • Extract sessionId from JSON.body.sessionId
  4. Configure the Response
    • Map JSON.output to the response body
    • Format the response before returning

Step 8: Testing the Agent

  1. Deploy the Workflow
    • n8n will generate test and production URLs
    • Note your endpoint URL and token
  1. Test the API Call
POST [YOUR_ENDPOINT_URL]
Headers: {
"X-agent-token": "your-token-here"
}
Body: {
"query": "Hey, how are you doing?",
"sessionId": "10"
}

Part 2: Testing with Maxim

Step 9: Setting Up the Maxim Workflow

  1. Access the Maxim Dashboard
    • Navigate to "Workflows"
  2. Create a New Workflow
    • Name: Event Fetching Agent
    • Add your n8n endpoint URL
    • Add headers with your authentication token
  3. Using Maxim Vault (Recommended)
    • Store tokens securely
    • Create a secret named n8n_token
    • Reference it as vault.n8n_token in your workflow
    • Configure the Request Body
{
  "query": "",
  "sessionId": "10"
}

Step 10: Creating a Test Dataset

  1. Go to Datasets
    • Create: Event Agent Simulation Dataset
    • Include different test scenarios
  2. Sample Test Scenarios
Scenario 1
Input: "Find product management events in October 2025"
Expected Steps:
Search for product management-related events
Filter for October 2025
Return event name, location, date, and registration link

Scenario 2
Input: "Show me tech events in New York between June and October 2025"
Expected Steps:
Filter for US-based events
Search for tech events
Filter by date range: June–October 2025
Filter by location: New York
Return event details with links

Step 11: Running Simulations

  1. Configure Test Parameters
    • Use your dataset
    • Persona: User lives in San Francisco, travels frequently
    • Set response field to "response"
  2. Select Evaluators
    • Agent Trajectory – Checks the logical flow of replies
    • Step Completion – Verifies that required steps are completed
    • Task Success – Measures end-to-end task completion
    • Bias – Evaluates fairness and neutrality
  3. Execute the Test Run
    • Launch the simulation
    • Review results once complete

Step 12: Analyzing Results

  1. Review Pass Rates
    • Trajectory
    • Bias
    • Step Completion
    • Task Success
  2. Understand Failures
    • Maxim provides detailed explanations
    • Common issues may include:
      • Incorrect context retention
      • Incomplete responses
      • Inaccurate event info
    • Sample Failure Example
Issue: Agent returned Austin events when asked for New York
Root Cause: Context maintenance failure
Solution: Refine system prompt to better maintain location context
Analysing Simulation Report

Troubleshooting Common Issues

Agent Not Responding

  • Check the webhook configuration
  • Verify the authentication token
  • Confirm Google Sheets access permissions

Context Loss in Conversations

  • Ensure session management is active
  • Check session ID flow
  • Validate memory component setup

Poor Test Results

  • Refine the system and user prompts
  • Improve the data source quality
  • Introduce specific constraints or validations
  • Enhance error handling logic

Conclusion

Building and testing AI agents requires a systematic approach, combining powerful tools like n8n for visual workflow automation and Maxim for rigorous testing. With this workflow, you can:

  • Rapidly prototype and deploy AI agents
  • Rigorously evaluate performance across scenarios
  • Identify and resolve issues pre-production
  • Continuously iterate and improve agent quality

The synergy between n8n and Maxim equips you to create production-grade, reliable AI systems with confidence.