So what @ralphwetzel is sating, it will give you flow_id
followed by a /
followed by the node_id
So you can split that down further
const [flow_id, node_id] = node.path.split('/')
msg.payload = { node_id, flow_id }
return msg
or long hand if it helps
const path = node.path.split('/')
const flow_id = path[0]
const node_id = path[1]
msg.payload = {}
msg.payload.flow_id = flow_id
msg.payload.node_id = node_id
return msg
[{"id":"2a920c7a7ebdae7d","type":"inject","z":"6e46a349d744ceaa","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2220,"y":400,"wires":[["f35955cb00abb022"]]},{"id":"f35955cb00abb022","type":"function","z":"6e46a349d744ceaa","name":"long version","func":"// long hand\nconst path = node.path.split('/')\nconst flow_id = path[0]\nconst node_id = path[1]\nmsg.payload = {} \nmsg.payload.flow_id = flow_id\nmsg.payload.node_id = node_id\nreturn msg\n\n\n","outputs":1,"timeout":30,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2260,"y":440,"wires":[["bff1bb750c152bee"]]},{"id":"bff1bb750c152bee","type":"debug","z":"6e46a349d744ceaa","name":"debug 316","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2310,"y":480,"wires":[]},{"id":"d8334fc65d995f1c","type":"inject","z":"6e46a349d744ceaa","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2220,"y":560,"wires":[["ee1c5158c66e0dc4"]]},{"id":"ee1c5158c66e0dc4","type":"function","z":"6e46a349d744ceaa","name":"short version","func":"const [flow_id, node_id] = node.path.split('/')\nmsg.payload = { flow_id, node_id }\nreturn msg","outputs":1,"timeout":30,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2260,"y":600,"wires":[["7c3f71ea112df2af"]]},{"id":"7c3f71ea112df2af","type":"debug","z":"6e46a349d744ceaa","name":"debug 317","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2290,"y":640,"wires":[]}]