NR_NODE_NAME in 2.2.0 does not appear to be set


thanks I am loving the new capability in 2.2.0 (we are currently pinned to 2.1.3 for our prod instances and need to upgrade) to get the node and flow details from the env object

have a function

msg.nrNodeId = env.get("NR_NODE_ID");
msg.nrNodeName = env.get("NR_NODE_NAME");
msg.nrNodePath = env.get("NR_NODE_PATH");
msg.nrGroupId = env.get("NR_GROUP_ID");
msg.nrGroupName = env.get("NR_GROUP_NAME");
msg.nrFlowId = env.get("NR_FLOW_ID");
msg.nrFlowName = env.get("NR_FLOW_NAME");

msg.payload = `I was sent by Function ${msg.nrNodeName}, on Flow '${msg.nrFlowName}`
msg.env = env
return msg;

it is returning

{"_msgid":"eb2947b81078e8f7","payload":"I was sent by Function , on Flow 'Flow 1","topic":"","nrNodeId":"ab7b26a8695984e6","nrNodeName":"","nrNodePath":"c6102b2d.d908e8/ab7b26a8695984e6","nrFlowId":"c6102b2d.d908e8","nrFlowName":"Flow 1","env":{}}

I don't appear to be getting the NR_NODE_NAME variable. Is this a bug or am I doing something silly?

Its working for me (running on the beta version of NR) ..
silly question .. do you have a name for your Function ? :face_with_monocle:


you can also try msg.nrNodeName =
it should give you the same thing

No silly questions only embarrassed posters - That was exactly the problem - :man_facepalming:


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.