Pin node data inside sub-workflows

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 .

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.

3 Likes