Testing Workflows: Pin Data, Mock Data, Debug Mode

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.

Why fix test data instead of testing live against production systems

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.

Pin Data: freezing node output

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:

  • Run the node in question once so that data appears in the OUTPUT view.
  • Click the pin icon in the OUTPUT view. A banner confirms that the data is now pinned.
  • Using the Unpin link in the same banner, you can release the pin again; after that, the node fetches fresh data again on the next run.
  • Pinned data can also be edited afterward: switch to the JSON view in the OUTPUT view, select Edit, adjust the values, and save with Save.

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.

Mock Data: generating test data without any real source

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:

  • Edit Fields node or Code node: For small, manageable test cases, the Edit Fields node is suitable, letting you set individual fields and values by hand. For more complex data structures or targeted edge cases, the Code node gives you full control over the structure and content of the test data.
  • Customer Datastore node: This node provides a ready-made sample dataset when you do not have your own test data at hand and still want to continue working with realistic-looking datasets.

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.

Limits of Pin Data and Mock Data

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:

  • Data pinning is not available for production workflow executions. As soon as a workflow is running activated, n8n ignores pinned data and fetches real data.
  • You cannot pin data if the output contains binary data.
  • Data pinning only works for nodes with exactly one single main output.

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: reworking with real error data

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:

  • Open the Executions tab in the workflow to see the execution history.
  • Select the execution you want to examine.
  • For failed executions, click Debug in editor, for successful ones click Copy to editor.
  • n8n automatically transfers the execution data into your workflow editor and pins the data at the first node of the workflow.

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.

Frequently asked questions

Can I use Pin Data with a webhook trigger too?

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.

Does Pin Data also work with binary data such as files or images?

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.

What happens to pinned test data when I activate the workflow?

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.

What exactly is the difference between Pin Data and Mock Data?

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.

Is Debug Mode also available on a self-hosted n8n instance?

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.

About NordFlux

NordFlux UG (haftungsbeschränkt)

NordFlux builds digital employees for organisations: automations and AI agents that take over repetitive work. You stay in control.

More about us
Free initial analysis

Concrete questions about automation or AI?

In a free initial analysis we discuss your case directly. No strings attached.

n8n Workflow Testing: Pin Data, Mock Data, Debug