# Pin node data inside sub-workflows

**URL:** <https://community.n8n.io/t/pin-node-data-inside-sub-workflows/308007>\
**Category:** Feature Requests\
**Tags:** core, data-pinning\
**Created:** [17 أغسطس 2026، 11:59ص UTC](https://community.n8n.io/t/pin-node-data-inside-sub-workflows/308007 "2026-08-17T11:59:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![christophherb](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/christophherb/32/186162_2.png) [@christophherb](https://community.n8n.io/u/christophherb)\
**Post date:** [17 أغسطس 2026، 11:59ص UTC](https://community.n8n.io/t/pin-node-data-inside-sub-workflows/308007/1 "2026-08-17T11:59:05Z")

</div>

## The idea is:

Let pin data address nodes inside sub-workflows, using a scoped key format: `<workflowId>:<nodeName>`. Each execution resolves the scoped key first and falls back to the bare node name if the key is not scoped. Each execution forwards the whole pin data when calling a sub-workflow, which then applies the same scoped-first/bare-fallback rule against its own workflow ID.  
Resolution is recursive and uniform such that it composes naturally for nested sub-workflows.

## My use case:

Automated workflow testing. The test\_workflow MCP tool (and the AI/agent workflow tools) accept pinData to mock node outputs only for the top-level workflow. Currently, all sub-workflows are executed for real. That makes automated tests slow, flaky, or impossible. With scoped keys, a test run can pin a node inside any sub-workflow with no changes to the sub-workflow itself.

## I think it would be beneficial to add this because:

Without something like this, the only options for mocking sub-workflow nodes are wrapping external calls in toggle-able branches or editing the sub-workflow to add mock injection. Both pollute production workflows with test scaffolding.

## Any resources to support this?

Users have been working around untestable sub-workflows for years with manual input injection, e.g. [Test sub-workflow with data from trigger workflow](https://community.n8n.io/t/test-sub-workflow-with-data-from-trigger-workflow/9509) .

## Are you willing to work on this?

Yes! I have a working fully backward compatible branch implementing exactly this, with tests covering engine resolution (scoped-first, bare fallback, cross-workflow isolation), pin data forwarding into sub-workflow execution, and test\_workflow MCP tool support. Since it touches packages/core, I’d love a nod on the approach from the team before polishing it into a PR.
