Question

Skip automation trigger if one of the workspaces is still in progress

  • 30 August 2023
  • 7 replies
  • 39 views

I have an automation that runs every 15 minutes on a single engine with a ‘repeat on interval’ schedule trigger. Usually, it takes less than 10 minutes but sometimes it can take more than 15 minutes and once a week on mode overwrite it takes about 25 minutes. If one of the workspaces of the automation is still in progress, is there a way to skip the trigger for the next automation?automation


7 replies

Userlevel 4
Badge +26

I'm not aware of an 'out-of-the-box' solution for this (there might still be one) but there might is at least one way to handle this:

 

Have a workspace at the start of the automation after the Schedule trigger which first runs a check on the currently running jobs using the FME Server REST api and looks for any in the your list of workspace. If it finds any then don't process any more of the automation.

 

It's not a great solution but it should be fairly robust.

Userlevel 4
Badge +26

I'm not aware of an 'out-of-the-box' solution for this (there might still be one) but there might is at least one way to handle this:

 

Have a workspace at the start of the automation after the Schedule trigger which first runs a check on the currently running jobs using the FME Server REST api and looks for any in the your list of workspace. If it finds any then don't process any more of the automation.

 

It's not a great solution but it should be fairly robust.

Note, a 'normal' Schedule has the option to "Skip if Job in progress": https://docs.safe.com/fme/html/FME-Flow/WebUI/schedules.htm

 

I guess it's a little harder for FME Server to know what is part of an automation.

Userlevel 4

In Flow 2023 there is an option in the "Run a workspace" action for this, under Advanced:

image

Userlevel 4
Badge +26

In Flow 2023 there is an option in the "Run a workspace" action for this, under Advanced:

image

Oh nice! How does a skipped job get reflected in the automation I wonder. Is there an output for skipped? I guess I should read the doc huh...

Userlevel 4
Badge +26

Oh nice! How does a skipped job get reflected in the automation I wonder. Is there an output for skipped? I guess I should read the doc huh...

  • "Skip if Job In Progress: If checked, a triggered job does not run if the status of the previously triggered job is still Running or Queued. If a job is skipped, the following InvalidMessage error message is output through the failure port: Job is already in progress; the triggered job was skipped.

 

https://docs.safe.com/fme/html/FME-Flow/WebUI/Automations-Actions/Action-Run-Workspace.htm

Thank you for your answers. I tried the ‘Skip if Job in Progress’ option but it only skipped if the current workspace in running, not if another workspace in the automation is still running. Moreover, at the next trigger event the 1st workspace of the automation usually ended up running multiple consecutive times.

I will also look into the FME Server REST api solution.

Since we are working with a PostgreSQL database, we also thought of adding a table and querying it to log if the automation is still in progress at the beginning and at the end of the automation, but I was wondering if there was a better solution.

Userlevel 3
Badge +18

struggling with this issue too…

as i couldn’t find it as an idea yet, I submitted one myself, feel free to upvote!

 

Reply