Hi Team,
Eg: I have a scheduled process model for every 1hr and let's say
Happy flow: PM got triggered at 15:00 EST and it took 15mins to complete. And next instance will start at 16:00 EST.
Exception flow: PM got triggered at 15:00 EST and it took 1hr 15mins to complete. And next instance will start at 16:00 EST but here the previous is still running. Can we restrict?
Can we build a flow where the PM should trigger every one hour and make sure no parallel execution of 2 or more instances at the same time.
Discussion posts and replies are publicly visible
You have options. You can run a process report to see how many instances of the process are running and if more than one you can then decide what to do (pause the current instance, terminate it, reschedule it for another time).
The easy way is to do a query on a process report. This should work while the instance is running. However this does not work well if you are bringing your instance backup after some downtime. Appian will launch all the instances that were supposed to start during that timeframe. In this case, the only thing that worked for me was using pessimistic locking.
Hello Purvraja, we can follow one of the approaches where we have a table where we will add an entry of the time when the process is triggered into the table and once the process is done, we can have a script task and add the completed on time in the table. So, if we don't have the completed time we can reschedule the process based on your requirement.
Can we automate this step?
Yes, you can invoke a process report in the process model using the "Execute Process Report" smart service.
Something similar could be done just saving a "status" of the process model in a table. If status is "in progress", not execute the new instance, if it is "done", then execute the new instance.