cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to distribute work to multiple robots

ChrisRider
Level 4

Hello - I am working on a project that is going to require multiple robots to be used simultaneously and I am trying to figure out the best way to have Blue Prism get the job done.  The application I am automating has 100 entities - each entity can be used exclusively by a single login.

Let's say we have entities E1, E2, E3, E4, E5, EX (I have about 100 entities to process).  Let's also assume we have 3 Blue Prism instances:  BP1, BP2, BP3.

Right now, I am reading in data to a Blue Prism queue.  BP1 can work on E1.  BP2 can work on E2.  BP3 can work on E3.  If BP2 finishes with its current entity, it could move on to E4.

What is the best practice of implementing a "first come, first serve" to keep the BP instances busy?  Any articles I can read to learn how to set this up?  

We have not utilized multiple BP instances yet.  All of our current automations have been ran on a single BP instance and have been easy to schedule.  Just trying to make sure I am on the right track for using BP at a bigger scale.



------------------------------
Chris Rider
lead application analyst
E. W. Scripps
cincinnati OH
------------------------------
1 BEST ANSWER

Best Answers

John__Carter
Staff
Staff

Hi Chris a BP queue is by default 'first come first served', and it contains logic to ensure that a queue item cannot be locked by multiple instances of a process. So if your design requirement is 'all instances should work whichever item is next until there are no more items', then you don't need to do anything. Just use Get Next Item followed by a Decision to test if an item was received or not (ie [Item ID]<>"").

You may have a project where the requirement is to work items in a particular order, and you can achieve that by applying tags when adding items to the queue and then using the Tag Filter input parameter in Get Next Item. That way you do things like 'work all items tagged as Joint Account first, the do all Loan Accounts, then Savings Accounts, then Credit Card Accounts.

Another option is to assign a Priority number when adding items, eg Joint=1, Loan=2, Savings=3, Card=4. Then Get Next Item will automatically give you all the P1s first, then all the P2s etc.

When considering how an automation will run in parallel, think whether there are any steps that you don't want to be replicated across all machines. Typically this will be when filling the queue, because you don't want every instance loading the same input data and creating duplicate queue items. This is where Environment Locks come in. Think of an EL as a permission token, where all instances compete for a single token, and the winner of the token is the one allowed to perform the 'special action' (eg load the queue) and the losers have to take a different direction (eg wait until the queue is loaded). For example:

  • 10 instances of the process start at the same time
  • All compete for the environment lock
  • 1 instance wins and 9 lose out
  • The winner 'goes right' and loads the queue, the losers 'go left' and enter a waiting loop
  • After loading the queue, the winner releases the lock and proceeds to Get Next Item
  • The losers detect that the lock is available and proceed to Get Next item
  • All 10 instances work in parallel until the queue is depleted



------------------------------
John Carter
Blue Prism
------------------------------

View answer in original post

6 REPLIES 6

John__Carter
Staff
Staff

Hi Chris a BP queue is by default 'first come first served', and it contains logic to ensure that a queue item cannot be locked by multiple instances of a process. So if your design requirement is 'all instances should work whichever item is next until there are no more items', then you don't need to do anything. Just use Get Next Item followed by a Decision to test if an item was received or not (ie [Item ID]<>"").

You may have a project where the requirement is to work items in a particular order, and you can achieve that by applying tags when adding items to the queue and then using the Tag Filter input parameter in Get Next Item. That way you do things like 'work all items tagged as Joint Account first, the do all Loan Accounts, then Savings Accounts, then Credit Card Accounts.

Another option is to assign a Priority number when adding items, eg Joint=1, Loan=2, Savings=3, Card=4. Then Get Next Item will automatically give you all the P1s first, then all the P2s etc.

When considering how an automation will run in parallel, think whether there are any steps that you don't want to be replicated across all machines. Typically this will be when filling the queue, because you don't want every instance loading the same input data and creating duplicate queue items. This is where Environment Locks come in. Think of an EL as a permission token, where all instances compete for a single token, and the winner of the token is the one allowed to perform the 'special action' (eg load the queue) and the losers have to take a different direction (eg wait until the queue is loaded). For example:

  • 10 instances of the process start at the same time
  • All compete for the environment lock
  • 1 instance wins and 9 lose out
  • The winner 'goes right' and loads the queue, the losers 'go left' and enter a waiting loop
  • After loading the queue, the winner releases the lock and proceeds to Get Next Item
  • The losers detect that the lock is available and proceed to Get Next item
  • All 10 instances work in parallel until the queue is depleted



------------------------------
John Carter
Blue Prism
------------------------------

Thanks John - very good information.  I think I am on the correct trajectory based on what I'm reading in your reply.

I need to implement the environmental lock on my load queue process - I had been manually assigning it to a specific system.



------------------------------
Chris Rider
lead application analyst
E. W. Scripps
cincinnati OH
------------------------------

Very good Chris. If you import the release of 'process examples' you'll find a page that shows how to do it in combination with exception handling.



------------------------------
John Carter
Blue Prism
------------------------------

Hi Chris,

Just a fair warning. Environment Locks are notorious and can stall your process for a long time if you are not paying attention.
I would recommend you to use its full potential, ie, all the properties that are available to create a stale lock check logic. 

This prevents a bot going on warning while environment locked from stalling the whole process for hours.

Do tell me if you need help around the stale lock thingy. I use it all the time 🙂

Hope this helps!



------------------------------
WeitghtRPAMatey
------------------------------
WeitghtRPAMatey

Walter.Koller
Level 11

When you write '3 Blue Prism instances' you mean '3 digital workers / runtime resources'? Because a Blue Prism instances sounds more like BP server instances. 

The term 'entity' is used for work items? (ie an work item is one entry in the work queue)

With 'entity' (work item) be used exclusively by a single login' you mean a 'digital worker logged in a runtime resource' and not necessarily to different Windows logins?

Just for clarification and maybe it helps you to know the commonly used terminology for further searches and queries. eg when searching for 'Advanced Work Queues' in BP University (the online training portal)



------------------------------
Walter Koller
Solution Manager
Erste Digital / Erste Group Bank
Europe/Vienna
------------------------------