Graceful timeouts on node and kill and move on to the next item

I have a function node that triggers a shell script. The script either runs successfully or just crashes with an error by design.

I want to create a timeout on such a node, kill that node’s execution and just move on to the next item in the queue.

Is there a way to implement this in n8n? I could handle it perhaps but just wondering if there is a quick and dirty to just kill the execution at that point and move on.

Something like that is currently not possible by default in n8n.

Anyway because you require it in a Function-Node you should be able to implement such a logic yourself in it the code with a timeout. Function-Nodes support promises as return value. So you can keep that returned promise unresolved while the script is running and then resolve it once that timer fires or it finishes successfully.