Keep Unattended RPA bots listening for new WorkItems

Following the work item queue flow implementation provided in the doc:

When I execute the workflow in OpenRPA, if there are any WorkItem in the queue, it successfully process it, however if there any more WorkItems it stopped.

I would like to keep the bot running and listening for new WorkItems in the corresponding queue. To try to accomplish it I wrapped the main workflow with a DoWhile with True as the condition, but few seconds after run it I am getting the workflow execution stop and the logs look like:

[11:07:38.829][Output] Main Process Queue failed at 1.61 in 00:15.441
# Gave up on ad971515-24d9-48e7-bee9-5da6c4ee89ef popworkitem
[11:07:38.804][Error] WebSocketClient.SendMessage: Not connected/signed in to OpenFlow
[11:07:38.803][Error] Gave up on ad971515-24d9-48e7-bee9-5da6c4ee89ef popworkitem not connected
[11:07:38.802][Warning] Message ad971515-24d9-48e7-bee9-5da6c4ee89ef (popworkitem) timed out, retrying
[11:07:23.813][Error] Received unknown command 'error' with data: {}
[11:07:23.805][Output] No more Workitems to process
[11:07:23.788][Output] No more Workitems to process
[11:07:23.778][Output] No more Workitems to process
[11:07:23.762][Output] No more Workitems to process

Any idea how can we achieve it and make it work? Do we need to add a Delay activity to avoid the issue?

Thanks and regards

I avoided the issue adding a new Delay activity with 2s of delay.

There are any other best and different way to achieve it?

Thank you one more time Allan for this awesome framework. Continue exploring and testing in the prof of concept for the automation I am working on.


Do not create a loop.
The flow should be.

Robot is idle.
A workitem gets added to the queue
if item is new and runat allows it to be proccessed openflow sends a message to the robot to run the main flow
( it does that if you select a robot and the main workflow on the workitem queu )
The mainflow starts looping

  • pop a workitem
  • if one is found execute the proccessing workflow with the item as argument
  • if workflow fails, grab the error and tell openflow to retry it
  • else, mark as complete
  • repeat until no more workitems
  • then stop

This way multiple robots can work on the same queue, or just one.
This way the robot uses NO resources while the queue has no items
If an item fails, openflow decided when to resubmit or simply mark as failed.

I removed the loop as you recommended (I was getting performance issues), however when a new item is added to the queue it is not executed automatically, in order to do id I have to run the bot manually, the same happens with the original work queue example. I am sure I am forgetting something.

What do you means about “if item is new and runat allows it to be proccessed”, what is runat, that setting must be defined in OpenFlow side, in what part?

Thanks and regards.

You need to select a robot and the main workflow on the workitem queue

runat is something you can set when you push the workitem to the queue, or on the queue to automaticly add a delay before the items get processed.

1 Like

Hi Allan,
Yes, I did it how you said and everything is working smoothly. Continuing exploring this awesome framework.

Thank so much and regards.

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