Workflow using process.exit

Good morning,My (workflow) script fetches data in a loop, and when a certain condition is met, the script needs to stop completely. I want to use process.exit for this. Is this a problem?As an more clear example see below:let x = 1;while (x > 0) {    console.log(x);    x++;    if (x > 10) {        console.log(‘Exiting…’);        process.exit();    }}Any problems in this?KR Henk

As far as I know, process.exit() is not supported by our runtime.

I would recommend doing this via Run JavaScript and “return”:

export default async function ({ executionId }) {
  let x = 1;

  while (x > 0) {
    console.log(x);
    x++;

    if (x > 10) {
      console.log('Exiting...');
      return;  
    }
  }}

Hi Christian,

Clear, so if you are in a subroutine  you can only do a return out of that routine to prevent spaghetti (-;

KR Henk