Link call flow embed another link call

Hi there,

I wonder if it's possible to have a flow used with link call node, which would also make use of a link call, like in this example :

If I remember correctly, link call feature makes use of a msg._linkSource property, and I suspect there might be some conflict, ie _linkSource from the first link In node would be replaced later in the flow, which would create trouble in the end.....

Maybe there is an easier way to handle that, don't know. Subflows might help, but it make things a bit more difficult to handle flow context variables....

Thanks !

The _linkSource property uses an array as call stack. So nested link calls should work. :thinking:

This simple example is working as expected. Note the debug output for the link _linkSource property.

image

[{"id":"9a44a5a0f02e8367","type":"link call","z":"b98b8381ac8cf03a","name":"","links":["6be9c8272325b570"],"linkType":"static","timeout":"5","x":540,"y":740,"wires":[["12485504424e94db"]]},{"id":"9b3c35829746608d","type":"inject","z":"b98b8381ac8cf03a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":740,"wires":[["9a44a5a0f02e8367"]]},{"id":"12485504424e94db","type":"debug","z":"b98b8381ac8cf03a","name":"outer result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":740,"wires":[]},{"id":"6be9c8272325b570","type":"link in","z":"b98b8381ac8cf03a","name":"link call: outer","links":[],"x":385,"y":820,"wires":[["dc7a660518b9c737","5a0dee3f55cc7f37"]]},{"id":"401cedd6c227245f","type":"link out","z":"b98b8381ac8cf03a","name":"link out 2","mode":"return","links":[],"x":715,"y":820,"wires":[]},{"id":"dc7a660518b9c737","type":"link call","z":"b98b8381ac8cf03a","name":"","links":["f0da196ec33d4d41"],"linkType":"static","timeout":"30","x":570,"y":820,"wires":[["401cedd6c227245f"]]},{"id":"5a0dee3f55cc7f37","type":"debug","z":"b98b8381ac8cf03a","name":"outer link call","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":860,"wires":[]},{"id":"f0da196ec33d4d41","type":"link in","z":"b98b8381ac8cf03a","name":"link call: nested 1","links":[],"x":385,"y":940,"wires":[["ce08e1e0eb50a8ba","4ed55527f2be36e9"]]},{"id":"4ed55527f2be36e9","type":"link out","z":"b98b8381ac8cf03a","name":"link out 3","mode":"return","links":[],"x":715,"y":940,"wires":[]},{"id":"ce08e1e0eb50a8ba","type":"debug","z":"b98b8381ac8cf03a","name":"nested link call 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":980,"wires":[]}]

Have you tried it?

Spoiler: It's possible, I've tried it! :slight_smile:

I even implemented it in the serverless version of Node-RED, the working example.

embedlinkedcalls

Great ! thank to you guys, I'll try that !

Cheers

You always need to top it! :rofl: :see_no_evil: