I am running a script from an EXEC Node that sometimes failes (once a day).
In these cases I have to find out the ID of this script (using ps -ef | grep python) manually and stop it with a KILL command and simply restart the Script via EXEC Node.
Now I would like to automatize this Auto-Kill and Auto-Restart
I have the ID already in this payload field, now the question is to get exactly this value into a variable
You don't need the ID. If you send a message into the exec node with msg.kill set to true then it will kill the current process. For more information see the help text for the node.
If you have several instances running at once from the same exec then I guess you will have to provide the PID in msg.pid. Are you running several instances in parallel? You will also have trouble picking up the PID from the status in that case. How will you know which one is the one giving the problem?