Learn to build a robust n8n workflow for automated AI evaluation. Use the n8n Evaluation node, Google Gemini, and Google Sheets to test and score AI Agent performance automatically. Access powerful n8n templates.
Download this n8n workflow template and start using it instantly.
AI/ML Engineers needing to automate QA testing for their Large Language Model (LLM) prompts.
Data scientists who use Google Sheets to manage test datasets and ground truths.
n8n users interested in mastering advanced flow control and the specialized n8n Evaluation tool.
Developers looking for practical n8n templates integrating AI agents and data validation.
Testing the reliability and accuracy of AI Agents is crucial before deployment. This sophisticated n8n workflow provides a robust solution for automated AI quality assurance. It solves the problem of manual verification by connecting Google Sheets—where your test questions (inputs) and expected answers (ground truths) are stored—directly to an AI Agent powered by Google Gemini.
The core of this n8n automation leverages the specialized n8n Evaluation node, which operates in two distinct modes: fetching test data and setting metrics. The workflow automatically sends a prompt to the AI Agent, captures its response, writes the actual output back to the sheet, and finally uses a second LLM to assign a 'Correctness' score based on how closely the AI Agent's answer matches the expected answer. This n8n workflow offers reliable, hands-free quality testing for complex AI automations.
This n8n workflow is designed with two distinct paths: a structured evaluation path and a manual execution path.
When fetching a dataset row n8n trigger, which pulls one row (input text and expected output) from the designated Google Sheets evaluation dataset.AI Agent n8n node, which uses the Google Gemini Chat Model and the Calculator tool to process the query and generate a response.Evaluation? n8n node, which checks if the current execution is part of an evaluation run. In evaluation mode, the flow continues down the true path.Get output n8n node saves the AI Agent's response, and the Set output Evaluation n8n node writes this actual output back to the Google Sheet against the corresponding test case.Corectness Evaluation n8n node. This node uses the Google Gemini Chat Model1 to analyze the difference between the actual output and the expected output (ground truth), generating an objective 'Correctness' score (metric).Set correctness n8n node takes this calculated metric and writes the final score back to the Google Sheet, completing the automated test cycle. This efficient use of the n8n node system ensures comprehensive testing.For manual runs, the workflow is initiated by the When clicking ‘Execute workflow’ n8n trigger, uses a default test query, passes through the AI Agent, and exits via the Return chat response node.
To use this n8n workflow template, follow these steps:
Google Gemini Chat Model and Google Gemini Chat Model1 (required for both AI operations and evaluation scoring).When fetching a dataset row n8n trigger and select your cloned Google Sheet and the relevant tab (Foglio1 or equivalent).Set output Evaluation and Set correctness n8n nodes are also pointed to your specific Google Sheet and document ID. When fetching a dataset row (Evaluation Trigger n8n trigger): This special n8n trigger node initiates the evaluation process by connecting to Google Sheets, fetching one row of test data (input query and expected answer).
AI Agent (Langchain Agent n8n node): Serves as the primary system under test. It receives the input query, is configured with a helpful system message, and has access to the Calculator tool for numerical tasks.
Google Gemini Chat Model (Language Model n8n node): Provides the language model capabilities for the AI Agent to execute complex instructions and generate the initial output.
Evaluation? (Evaluation n8n node - Check Operation): Acts as a conditional switch, detecting whether the current execution run was started by the Evaluation Trigger or manually, allowing the n8n workflow to branch correctly.
Set output Evaluation (Evaluation n8n node - Set Output Operation): This n8n node is responsible for writing the actual response generated by the AI Agent back into the Google Sheet dataset under the actual_output column.
Corectness (Evaluation n8n node - Set Metric Operation): The core scoring component. It compares the actualAnswer against the expectedAnswer using the specified Google Gemini Chat Model1 to generate a metric score (Correctness), effectively using an LLM to grade another LLM's performance. This is a powerful application of the n8n node.
Implement a stateful Pomodoro technique tracker using an n8n workflow. Start, stop, and log 25-minute deep work cycles to Google Sheets via Telegram commands.

Use this powerful n8n workflow to automate your daily financial and operational briefing. Gathers data from Stripe, Shopify, Banking APIs, and Google Calendar, then summarizes it using OpenAI and sends a secure morning brief.

Automate monitoring of EU legislative procedures related to sustainability. This n8n workflow scrapes data, uses an OpenAI n8n node for classification, and saves actionable items to Google Sheets and Google Tasks.

Use this advanced n8n workflow template to implement the high-speed Fan-Out-Fan-In pattern, executing multiple independent AI tasks concurrently. Optimized for speed and state management.

Instantly convert voice notes uploaded to Google Drive into X (Twitter) posts using this powerful n8n workflow template powered by AssemblyAI transcription, saving hours on manual effort.

Use this dynamic n8n workflow to analyze YouTube videos, generate sophisticated transcripts, summaries, and social media clips using Google Gemini AI, optimized with audience metadata. Easily deploy this powerful n8n template.

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza







































