Terminate Workflow if Same Process is alteady running on another Bot

Hi Guys,

I have 6 Workflows which I schedule with time trigger in orchestrator. I have two bots available. The workflows should run dynamically.

Each workflow looks in a different mailbox.
If one Workflow lasts longer than expected the second bot will get to the same process and execute it again.

But in order to prevent problems with the automation i want each workflow to run just one instance of it at same time.

How can i do this?

Maybe i can ask the orchestrator before the main part of a process if one instance of this process is already running and if so terminate the process?

Hello @Julian3 - If you are using REFramework, what you can do is the following:

  1. In the Initialization State, detect the presence of a text file (this works like a lock file in an ACCDB file), the location of this text file is one you decide and must be accessible by both bots.

image

  1. If the text file is found, throw a System Exception to send the process to the End Process State. This will stop the process from running.
    image

image

  1. Back in the Initialization State, if the text file is not found, create the text file (filename depends on you, I suggest just the temp.text, the contents just the name of the target mailbox and the timestamp of when it is created).

image

  1. Once the process finishes running, delete the temp.txt file.

Hope this helps!

@Julian3

If the robot’s are working in separate machines, @argin.lerit’s solution could be changed to checking an Orchestrator asset value. You could write eg. “WORKING” to an asset value when a bot is working on the process, and clearing the value when the work is completed.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.