Passing data between WFs, why can't my example work?

calling-WF : webhook (post-data) + execute-WF
called-WF : http-request

This woks, but i can’t get the post-data in the http-request, how can i do ?

calling-WF

called-WF

It looks like in the called-WF you did not connect the Start-Node with the HTTP Request one.

Excuse me jan i did too, but same result, even if i set “always output data” in the start node
At execution, I see my post data in the start node but the http-request node remains empty

 "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },

What do you mean with it remains empty? Do you mean in the Editor-UI? If so you will never see any sub-workflow execution there, they always run in the background.

Here are the 2 nodes in the execution dashboard, no data for the second
For example, how to pass “counter” in post data of http-request ?
pic pic1

It looks like the call does not return any data. You can see that it says “Results: 1” so the call got made but apparently the response is simply empty.

Argh misunderstanding … yes, the http-request output is empty
But the i would like to pass “counter” into post-data of this node, as i can see that post data is empty in webhook.site … how can i do ?

You would have to pass then the counter-data into the Execute Workflow-Node. You can find information about how to get data in and out of sub-workflows here:

:yum: already read jan … very concise, too maybe
yes the Start node receives the data from the calling-WF, but do I need a Function node to feed the Http-request node input ? i would have prefer to start this called-WF with this node but the Start node seems mandatory here

Not sure if I understand you correctly but I do my best.

The called workflow always starts from the Start-Node. As each workflow has one that is the best entry point.
Not sure what you mean with the Function-Node. Is it to provide kind of default data for development? If so then yes you could use a Function or Set-Node for that.

Argh jan sorry to not be clear enough
Let’s do short : how would you pass the “counter” property and its value (coming form the calling-WF) into the post-data (of the Http-request in the called-WF) sent to webhook.site ?
Since i can’t use any Start-node’s output in expressions (in Set for ex)
Can i be clearer ? :blush:

Yes you can still use it in an expression, you can just not select it manually via the Expression-Editor. So if you write:

{{$node["Start"].json["counter"]}}

You will not see a result, as there is currently no data, but if the workflow then executes it will resolve correctly.

What you could also do is something like this (workflow at the end):

For development, you set the init-date (example-data) on the “Set Init-Data” node. If you have to set expressions you reference them always from the “Input Data” node. Once you then want to run the workflow in production you disable the “Set Init-Data” node and it will still work perfectly.

Thanks jan, sorry but my primary case can’t work yet, no post data in webhook.site when i use
{{$node[“Start”].json[“counter”]}} in body parameter name

Because the counter data is not on the top level, it is underneath “body”. So the expression would have to be adjusted to account for that:

{{$node["Start"].json["body"]["counter"]}

Yes i saw that, and fixed it, but result is not ok yet :
In the execution journal, we find the value :
image
and in webhook.site :
image

Result looks correct, at least it does exactly what you told it to do. You set the “Name” to 467 and the “Value” empty. I guess what you want is to set “Name” to a static value (like “counter”) and “Value” to the expression.

You guess well jan :slight_smile: how ?

I must be a genius :wink:

In every joke there is always an element of truth … :wink:

Ok jan, I see the principle, and I didnt’ know than I could use the ‘Start’ in expression to use its $json (miss in doc!)

Thanks a lot !

Glad to hear that it works now at least.

What exactly do you mean is missing? The documentation for $node can be found here:
https://docs.n8n.io/nodes/expressions.html#variable-node