I'd like to get the name or something like this from the previous node. This request is similar to this one.
I want create a subflow that logs all information of it's msg. This will be similar to a debug node, but 'my' node will dump the information into a file. It would be nice if the handling of my log node would be as comfortable as the debug node already is.
So my first approach was to add some information into the previous node (msg.source_name = node.name).
This works as expected, but I have to modify the source node and that's not so nice.
Second I tried the proposal of jbudd to use a link call node.
OK. This gives me the _linkSource. Not very comfortable to figure out the corresponding node, but this would be OK for me.
BUT.
It seems that the link call node does not work inside a Subflow, as it works outside.
Outside of a subflow I do get something like this:
{"_msgid":"1a57f632ed223fd2","payload":1728556169732,"topic":"","_linkSource":[{"id":"875785eb3099847eac1f8fb30c9a","node":"ab4c6a1084d87fc1"}]}
But inside I get this:
["_linkSource",[{"id":"8018b8e7ba9f780e9376b0646887","node":"59c051392d4f7fb9"}]]
It looks similar, but I'm not able to figure out which node belongs to node '59c051392d4f7fb9'.
I understand that things work a little different within a subflow because a subflow is a kind of a template for it's instances. There might be a lot of individual instances and at the end all instances are a 'copy' of the subflow. So this is different to a subroutine in c or python.
Does anybody have a smart idea? How can I dump node information into a file similar to the debug node in the side bar?