Pass Parameters to Execute Workflow

Hi,Jan,I use the express {{$node[“Start”].data[“propertyName”]}}, and it is work.But If my Execute Workflow Node has Corn Node as trigger, I use {{$node[“Cron”].data[“propertyName”]}},it doesn’t work.

Hello,
I am new with n8n (i am using the cloud version), so maybe that’s a dummy trick. However, in the idea of passing data to a sub-workflow, it sounds like I can’t reproduce what was proposed earlier in this thread.

I am having a Set node after my Start node. I want to set a value as
= {{$node["Start"].data["test"]}}
but for some reason the n8n platform refuses it once i try to validate. In the “Expression field”, only remains the = as you can see in the screenshots.

Any guess ?


Hi @guillim, welcome to the community!

Sub-workflows can be a little awkward at build time. The Start node in your sub-workflow won’t have any data you can reference while building your workflow. So you would (temporarily) need to put a node in front of your Set node that returns some test data you can use to build your workflow. You’ll then be able to simply click your way through the expression editor to access the data you need.

Here’s a quick example. Let’s assume my parent workflow will later pass on a field called myValue to my sub-workflow. In my sub-workflow I’d then do something like this:

Here I have added a Set node (called “Mock data”) that mimics the data I expect to receive and allows me to build my workflow. I can now simply reference this data in my subsequent nodes in this workflow by clicking my way through the expression editor:

Once I am done building my sub-workflow, I can then simply delete (or pause) the “Mock data” node and the workflow will use the production data passed on by the parent workflow. I hope this makes sense and helps!

1 Like

Thanks, works fine now ! I will keep a mocking Set for when I need to debug.

1 Like

Glad to hear this works for you, thanks so much for confirming!