Data pinning in n8n lets you freeze a node's output data so it stays the same across test runs without re-executing the node. Click the pin icon on any node's output panel to pin the current data. Pinned data replaces live execution results, saving time and API calls during workflow development.
How to Use Data Pinning in n8n
Data pinning is a testing feature that lets you save a snapshot of a node's output and reuse it in subsequent test executions. Instead of making a live API call or querying a database every time you test, the pinned data is used automatically. This speeds up development, avoids rate limits, prevents unnecessary API charges, and gives you consistent data to work with while building downstream nodes.
Prerequisites
- A running n8n instance with the workflow editor open
- At least one workflow with nodes that have been executed at least once
- Basic familiarity with the n8n editor and node output panel
Step-by-step guide
Execute a node to generate output data
Execute a node to generate output data
Before you can pin data, the node needs to have output data. Run your workflow or execute the individual node by clicking the Execute Node button at the top of the node settings panel. The output panel on the right side shows the data returned by the node. This is the data you will pin for future test runs.
Expected result: The node output panel displays the execution result with the data in table or JSON format.
Pin the node output data
Pin the node output data
In the node output panel, look for the pin icon (a thumbtack icon) in the top-right area of the output section. Click the pin icon to freeze the current output data. The pin icon fills in or changes color to indicate the data is pinned. A small pin indicator also appears on the node in the workflow canvas, so you can see at a glance which nodes have pinned data.
Expected result: The pin icon is active and the node shows a pin indicator on the canvas. The output data is now frozen and will be used in subsequent test runs.
Test downstream nodes with pinned data
Test downstream nodes with pinned data
With data pinned on a node, execute the workflow from that node onward. n8n skips the actual execution of the pinned node and uses the saved data instead. All downstream nodes receive the pinned data as their input. This lets you rapidly iterate on the logic of downstream nodes without waiting for slow API calls or consuming API credits.
Expected result: Downstream nodes execute using the pinned data as input. The pinned node itself is not re-executed, saving time and API calls.
Edit pinned data to test different scenarios
Edit pinned data to test different scenarios
Click on a node with pinned data and switch to the JSON view in the output panel. You can directly edit the JSON to simulate different responses. For example, change a status field from success to error, modify amounts, or add extra fields to test how downstream nodes handle edge cases. The edited data is saved automatically when you click away.
1// Example: Edit pinned data to simulate an error response2// Original pinned data:3[4 {5 "json": {6 "status": "success",7 "data": { "id": 123, "name": "Test Order" }8 }9 }10]1112// Modified pinned data to test error handling:13[14 {15 "json": {16 "status": "error",17 "message": "Order not found",18 "code": 40419 }20 }21]Expected result: The pinned data now reflects your edits. Running downstream nodes uses this modified data, letting you test different scenarios without making real API calls.
Unpin data when ready for production
Unpin data when ready for production
Before activating your workflow for production use, unpin all test data. Click on each node with a pin indicator and click the pin icon again to toggle it off. Unpinning restores normal execution behavior where the node runs live and produces real output. Pinned data only affects manual test executions, not automated production runs, but removing pins keeps your workflow clean.
Expected result: The pin indicator disappears from the node. The next manual execution runs the node normally and produces live data.
Complete working example
1{2 "name": "Data Pinning Demo — API Caching",3 "nodes": [4 {5 "parameters": {},6 "name": "Manual Trigger",7 "type": "n8n-nodes-base.manualTrigger",8 "typeVersion": 1,9 "position": [250, 300]10 },11 {12 "parameters": {13 "url": "https://api.example.com/orders",14 "method": "GET",15 "authentication": "genericCredentialType",16 "genericAuthType": "httpHeaderAuth"17 },18 "name": "Fetch Orders (Pin This)",19 "type": "n8n-nodes-base.httpRequest",20 "typeVersion": 4,21 "position": [450, 300]22 },23 {24 "parameters": {25 "conditions": {26 "conditions": [27 {28 "leftValue": "={{ $json.status }}",29 "rightValue": "completed",30 "operator": {31 "type": "string",32 "operation": "equals"33 }34 }35 ]36 }37 },38 "name": "IF Completed",39 "type": "n8n-nodes-base.if",40 "typeVersion": 2,41 "position": [650, 300]42 },43 {44 "parameters": {45 "jsCode": "const items = $input.all();\nreturn items.map(item => ({\n json: {\n orderId: item.json.id,\n customer: item.json.customer,\n total: item.json.amount,\n processedAt: new Date().toISOString(),\n source: 'workflow-automation'\n }\n}));"46 },47 "name": "Format for Report",48 "type": "n8n-nodes-base.code",49 "typeVersion": 2,50 "position": [850, 200]51 }52 ],53 "connections": {54 "Manual Trigger": {55 "main": [[{ "node": "Fetch Orders (Pin This)", "type": "main", "index": 0 }]]56 },57 "Fetch Orders (Pin This)": {58 "main": [[{ "node": "IF Completed", "type": "main", "index": 0 }]]59 },60 "IF Completed": {61 "main": [62 [{ "node": "Format for Report", "type": "main", "index": 0 }],63 []64 ]65 }66 }67}Common mistakes when using Data Pinning in n8n for Faster Testing
Why it's a problem: Forgetting that pinned data is still in place and testing with stale data
How to avoid: Check the workflow canvas for pin indicators on nodes before running tests. Unpin and re-execute nodes periodically to refresh the data.
Why it's a problem: Thinking pinned data affects production workflow executions
How to avoid: Pinned data only applies to manual test executions in the editor. Automated executions triggered by webhooks, schedules, or other triggers always run nodes live.
Why it's a problem: Editing pinned JSON data with invalid syntax
How to avoid: Ensure your edited pinned data is valid JSON. Each item must have a json property. Use the format: [{ "json": { "key": "value" } }].
Best practices
- Pin data on API nodes during development to avoid unnecessary API calls and rate limit issues
- Always unpin data before activating a workflow for production, even though pinning only affects manual executions
- Use edited pinned data to test edge cases such as empty responses, error codes, and missing fields
- Pin data at the earliest node in your workflow to maximize the number of downstream nodes you can test without live execution
- Document what your pinned data represents so teammates understand the test scenario
- Combine data pinning with the execution preview to step through your workflow node by node
- Re-pin data periodically to refresh it with current API responses, especially if API schemas change
- Use pinned data to create reproducible test cases when reporting bugs in community nodes
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I am developing an n8n workflow that calls an external API. How can I use data pinning to avoid making repeated API calls during testing while still being able to test different response scenarios?
Pin the output of the HTTP Request node with sample order data so I can test the downstream processing nodes without hitting the live API. Include three sample orders with different statuses.
Frequently asked questions
Does pinned data persist after closing the browser?
Yes. Pinned data is saved with the workflow and persists across browser sessions. It remains pinned until you explicitly unpin it.
Can I pin data on trigger nodes like webhooks?
Yes. You can pin data on trigger nodes to simulate incoming webhook payloads or other trigger events without actually sending a request.
Does pinned data affect production workflow executions?
No. Pinned data only applies to manual test executions in the editor. Production executions triggered by webhooks, schedules, or other automated triggers always run nodes live with real data.
Can I pin data on multiple nodes in the same workflow?
Yes. You can pin data on any number of nodes in a workflow. Each pinned node uses its saved data during test executions.
How do I create pinned data for a node that has never been executed?
Switch the node output panel to JSON view and manually type or paste the data you want in the correct format. Then click the pin icon to pin your manually entered data. Each item needs a json property wrapper.
Is there a size limit for pinned data?
There is no strict size limit, but pinning very large datasets can slow down the editor. Keep pinned data to a reasonable size that represents your test scenario — usually a few items are sufficient for testing.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation