Automic Workload Automation

 View Only

 Plan 2 workflows with 2 SAP R3_GET_EVENT jobs where only one is triggered daily?

Ewald Eicher's profile image
Ewald Eicher posted Jul 03, 2025 03:44 PM

Hello everyone,

I have a task that I don't yet know how to implement in Automic, so I'm asking here in the forum.

The initial situation is as follows: I have 2 workflows which contain different jobs. Workflow 1 is to be started after an SAP Event 1 has been triggered. Workflow 2 is to be started after an SAP event 2 has been triggered. For each workflow I have an JOBS:SAP - R3_GET_EVENT which works.

The problem is now. That only one of these 2 events is triggered daily and only one of these workflows may be executed. .

So today Event1 following Workflow 1 - tomorrow Event 2 following Workflow 2

But I can never say in advance which one will be triggered, i.e. I have to schedule both at the same time every day, BUT then one runs on ENDED_OK because the workflow was triggered and the 2nd always runs into a timeout and timeout means ENDED_NOT_OK and that's not nice

How can I solve this cleanly?

Automic Web Interface - 21.0.8-hotfix-21.0.8+hf.3

Daryl Brown's profile image
Daryl Brown

Just off the top...

  • Have both workflows contain code on the workflow's process tab to update a variable object indicating the workflow is being run on the given day.  Before doing that update, though, check to see if that variable object already reflects the current date -- if so, then do a ":stop nomsg" to quit the workflow.  (With this approach, you can keep both events running normally, and if both of them fire on the same day, you can ignore the latter.)
  • Similar to the first one -- apply a sync object to both workflows (e.g., statuses of LOCKED or AVAILABLE).  If the sync object is AVAILABLE, then the workflow should update it to LOCKED and then continue.  (No end action would be specified here, although you'd have to decide if you want an abend action.)  If the sync object is already LOCKED, then skip the workflow.  You would then need to schedule another object (script/workflow/whatever) at the start of each morning to reset the sync object back to AVAILABLE.  Again in this case, you could keep both SAP events running throughout the day.
  • Can your SAP events be combined into a single master workflow?  (I'm not familiar with SAP myself, so this may not fully apply.)  I'm envisioning a combined workflow consisting of both events, and lines connecting both events to both workflow 1 and 2.  As soon as one event activates, use code in the event_process tab to do a cancel_uc_object on the opposing event using a ENDED_TIMEOUT extension.  The dependencies of workflow 1 should be for event 1 to be ENDED_OK and event 2 as ENDED_TIMEOUT, else skip; workflow 2's dependencies would be the reverse.  In this scenario, rather than scheduling the events, you would just schedule the master workflow.