Work queues

Work queues allow you to manage, queue, and report on work items in a Blue Prism environment.

Work Queues - Click for a larger image

Items

An item in a work queue can have one of five possible workflow states. When an item is first added to a queue, it will default to a workflow state of Pending. Once the process gets the item to be worked, it will become Locked. The process can then set the workflow state to either Complete, Exception, or Deferred, based on the results of processing. These workflow states are explained below:

  • Pending – Indicates that the item is in the queue and waiting to be worked on by a digital worker.
  • Locked – Indicates that the item has been selected to be processed by a digital worker. In this state, other digital workers and processes cannot access or alter the item's contents.
  • Complete – Indicates that the item has been processed successfully.
  • Exception – Indicates that the item has failed in some way while an attempt was made to process it.
  • Deferred – Indicates that the processing of the item has been deferred until a later date.

A work item contains a text key value to identify it amongst other items in the queue, a numeric priority, a text Status value which can give some indication of the current state of the item, a set of text tags which can give more fine-grained information about the nature of the item, and arbitrary data in the form of a collection.

An item contains various metadata which can be modified while it is being processed. The Status is a text field that can be modified to indicate a simple status of the item. Tags can be added to or removed from an item, allowing for categorization of work items within a queue. Note that the key value cannot be changed once the item has been created.

Tags

Tags can be used to group or sort items in a work queue. Tags can be set and removed using the Tag Item and Untag Item actions from the Internal - Work Queues business object. The Get Next Item action allows you to filter the items retrieved based on the tag filter input parameter. Item tags can also be viewed and filtered in Control Room. For more information, see Queue management.

Tags can also be used to give more details about how an item has been processed, such as what type of exception was encountered, or any output values.

Queues

A queue contains any number of work items which are passed out to consuming processes in order of priority, then in the order that they were added to the queue.

The queue which contains the work items is configured in System Manager – Workflow. The key field for the queue indicates which field in a new item's data collection should be co-opted to use as the key value for the item. This can be left blank to indicate that no items should have key values in this queue.

A queue can be configured to automatically retry items which were marked with an exception a specified number of times. By default, items are not set to retry at all – an exception is considered to be the end of processing for that item.

A queue can be configured to automatically encrypt its contents using a predefined encryption scheme.

Item Priority

Items in a queue have an associated priority. You should consider whether your process will have different item types that need to be worked on or worked in a certain order. Work queues have their own in-built priority functionality which can help you with this.

Work items selected by the Get Next Item action are pulled with a default order of First In First Out (FIFO), meaning they are processed in the same order they are added to the queue. When adding items to a queue with Add to Queue, there is an optional Priority parameter where work items can be assigned a numerical value. This parameter defaults to 0 if empty. When work items are selected from the queue with Get Next Item, before applying the FIFO principle, the item priority is checked first, with lower numbers given higher priority (for example, an item with priority 2 will always be worked before an item with priority 5, regardless of which was added to the queue first). Item priority can also be set or changed using the Set Priority action.

It is important to ensure that work items that are given a lower priority are eventually worked on. If your process is configured to prioritize work in an order other than the FIFO default, there is a risk that lower priority tasks may never be worked on. There are ways of minimizing this risk, such as ensuring you have an appropriate number of digital workers to process the given workload, or by adding additional processing logic to your solution to ensure that items are worked.

This video demonstrates how to set and use priorities with work queues.

Using queues within processes

A work item can be added to the queue within a process by calling the Add to Queue action on the Internal – Work Queues business object.

Only one process or visual business object within a session can work a queue item at any given time – that item is locked for use by that process or VBO within its session by calling the Get Next action on the Internal – Work Queues business object. Only a process or VBO with such a lock can update the workflow state of the item. Items will be marked as Completed or Exception once they are worked in a queue. This information, along with any relevant tags, will be visible in the Blue Prism Performance Report.

There are multiple ways of using work queues for a process. For simple linear processes, the work items will be added to a single queue, worked in order, and then marked as Complete or Exception. More complex processes may need to use multiple work queues to handle different behaviors, nested or linked items, or a multiple-part process where different cases need to be worked at different times. Blue Prism provides different solutions to each of these scenarios, such as by deferring work items or adjusting your process logic.

As well as filtering the items in a work queue by tag, you can also filter the items through the Get Next Item action by key. For more information about filtering, see Filters .

Full documentation for the work queues business object actions can be found by clicking on the information icon in the action properties dialog in Studio.

Monitoring work queues

The queues and their items can be monitored and altered using the Queue Management tab of Control Room. This tab also shows the priority of work items in the queue.