Testing AI Workflows: Evaluations Before Customer Deployment
How to test AI agents with n8n evaluations before customer deployment: test datasets, metrics, and LLM-as-a-Judge for reliable workflows.
Pin Data, Mock Data, and Debug Mode in n8n: how to test workflows with fixed test data instead of live against production systems.
Anyone working on an n8n workflow that sends an email, triggers a payment, or writes a record to a CRM does not want to send a real message or create a real customer record every time they test. For exactly this purpose, n8n offers two interlocking features: Pin Data freezes the output of a node, Mock Data generates test data without contacting an external source at all. This is complemented by the Debug Mode, which lets you reproduce failed production executions directly in the editor.
For you as a team building production automations, this is more than a convenience feature. Without fixed test data, every click on "Execute workflow" tests against real systems, consumes API quotas, and risks a test accidentally triggering a real action. With Pin Data, Mock Data, and Debug Mode, you keep control over which data flows through your workflow and when, and you can reliably check the same logic multiple times with the same inputs.
A typical problem when building workflows: the first node fetches data from an external source, such as a webhook, a table, or an API. Every time you run the workflow to test it, this request runs again, costs time, may consume a quota, and is not guaranteed to return the same values as the last run. This is exactly where Pin Data and Mock Data come in: according to n8n, both features are meant as tools for testing during development, "to save time and resources during development, work with consistent datasets, and protect live systems from repeated test calls". Instead of firing against a real system on every test run, you work with a fixed, repeatable dataset and immediately see whether a change to your logic produces the desired result.
Data pinning stores the output data of a node and uses this stored data on future executions instead of fetching fresh data again. Here is how you do it:
This is especially useful for workflows triggered by an external system such as a webhook: once the starting data is pinned, you do not need to trigger the initiating system again for every test, but instead work directly with the fixed dataset. You can also reuse data from an earlier execution for this: in the Executions tab, open a past execution, open the desired node with a double click, switch to the JSON view, copy the data, and paste and save it in the target view of a node.
Data mocking means creating or simulating test data without connecting to a real data source at all. This is helpful whenever you do not yet have access to the real system, need to test an edge case that the real data does not currently provide, or want to develop independently of the availability and permissions of an external source. n8n names two main ways to do this:
In practice, you often combine both features: you first generate Mock Data for a specific test scenario, adjust the values as needed, and then pin them so that you find exactly the same situation again on every further test run.
Both features are explicitly intended for the development phase, not for ongoing operation. According to the official n8n documentation on Pin Data and Mock Data, the following applies:
These restrictions are not a coincidence: they prevent fixed test data from accidentally leaking into production runs and delivering outdated or incorrect values there. When you release a workflow for production use, you should therefore specifically check again before activation whether pinned test data is still present anywhere.
Debug Mode picks up exactly where Pin Data and Mock Data leave off: at an execution that has already run in production but failed. According to the n8n documentation on debugging executions, this feature loads the data of a past execution into your current workflow, which is especially valuable for retracing failed production runs. Here is how you do it:
This lets you work on exactly the data that triggered the error, test your fix directly against this case, and only go live again afterward. According to n8n, the feature is available on n8n Cloud as well as for registered community instances; which executions actually appear in the list also depends on your workflow's retention settings.
If you run n8n workflows in production and do not want to start from scratch with every error, a fixed routine is worthwhile: pin test data before working on the logic, reproduce real error cases via Debug Mode, and only go live again after a clean test run without pinned data. In automation with n8n, we build such test routines into our clients' workflows from the start, so changes do not run against production systems on a hunch.
Yes. Especially when a workflow is started by an external system such as a webhook call, Pin Data helps you avoid contacting the triggering system again for every test. You pin the starting data you received once and then work directly with this fixed dataset.
No. If a node's output contains binary data, this output cannot be pinned according to the n8n documentation. In such cases, all that remains is to actually contact the binary source live once during testing or to work with a simplified substitute dataset without a binary component.
Nothing problematic, as long as you have worked cleanly: data pinning has no effect on production executions, so an activated workflow automatically fetches real data again. Still, it is worth deliberately checking before going live whether pinned test data remains in individual nodes, to avoid confusion the next time you edit it.
Mock Data creates a test dataset from scratch, for example via the Edit Fields or Code node, without any real data source at all. Pin Data, on the other hand, freezes the actual output of a node, regardless of whether that output comes from a real system call or was itself previously generated as Mock Data. In practice, both features are often combined.
According to the n8n documentation, the debug feature is available on n8n Cloud as well as for registered community instances. Which specific executions appear in the history and how long they are kept also depends on the workflow's execution data retention settings.
Founder of NordFlux. Spent four years automating processes at enterprise scale at Dräger, and now brings that depth to the mid-market — pragmatic and with full data sovereignty.
Certifications
How to test AI agents with n8n evaluations before customer deployment: test datasets, metrics, and LLM-as-a-Judge for reliable workflows.
Binary data in memory or in the database slows n8n down. Filesystem and S3 mode solve the problem, with the right variables.
npm, Docker or desktop app: how to test n8n locally, what differs in persistence and effort, and why the desktop app no longer exists.
Pin Data, Mock Data, and Debug mode prevent test runs from accidentally changing real customer or accounting data. NordFlux sets up reliable testing processes for your n8n workflows and can take over ongoing quality assurance. In an initial conversation we look at your current testing approach.