Skip to main content
Question

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


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

virtualcitymatt
Celebrity
Forum|alt.badge.img+34

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.


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
virtualcitymatt wrote:

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.


david_r
Evangelist
  • August 31, 2023

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

image


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
david_r wrote:

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...


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
virtualcitymatt wrote:

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


  • Author
  • August 31, 2023

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.


becchr
Influencer
Forum|alt.badge.img+23
  • Influencer
  • March 28, 2024

struggling with this issue too…

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

https://community.safe.com/ideas/skip-automation-trigger-if-it-is-already-running-32846

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings