How to trigger bots based on Queue items in to it

Hi all,

I need to configure a process based on Queue items.If the data is huge multiple bots should be triggered.If the transaction data is small or limited, then it should trigger only one bot.

For ex :

  1. If Queue holds 1000 items , then 3 bots should be triggered.

  2. If the Queue holds item < 300 then 1 bot should be triggered to achieve this process.

Thanks in Advance

To achieve the dynamic triggering of bots based on the number of items in a queue in UiPath, you can follow these steps:

  1. Create a Dispatcher Process:

    • Develop a dispatcher process that populates the queue with the required items. This process can be triggered on a schedule or manually.
  2. Create the Main Process:

    • Design the main process that retrieves and processes queue items.
    • This process will be executed by multiple bots if the queue has a large number of items.
  3. Determine Bot Count:

    • In your main process, before retrieving queue items, determine the number of bots that should be triggered based on the number of items in the queue.
    • For example, you can calculate the number of bots needed using a formula like: botCount = ceiling(queueItemCount / threshold), where threshold is the maximum number of items per bot.
  4. Dynamic Bot Triggering:

    • Based on the calculated botCount, use a loop or parallel execution mechanism to trigger the required number of bots concurrently.
  5. Bot Logic:

    • In each bot’s execution, retrieve a portion of queue items that the bot should process. This can be done using the Get Transaction Item activity or Get Transaction Data activity.
  6. Process Queue Items:

    • Process the retrieved queue items within each bot’s execution logic.
  7. Transaction Completion:

    • After processing each item, mark the transaction as completed or successful using the Set Transaction Status activity.
  8. Bot Termination:

    • After all items have been processed and the queue is empty, the bots can terminate gracefully.

By using this approach, you can dynamically adjust the number of bots based on the workload in the queue. If the queue has a large number of items, multiple bots will be triggered to process the workload concurrently. If the queue has a smaller number of items, only one bot will be triggered.

Keep in mind the following considerations:

  • Ensure that the bots are properly managed and orchestrated through UiPath Orchestrator to avoid conflicts and ensure efficient usage of resources.
  • Implement error handling and retries to handle any issues that might arise during processing.
  • Monitor the performance of your solution and adjust the thresholds and logic if needed to optimize the process.

This approach leverages the flexibility of UiPath Orchestrator to manage the execution of multiple bots based on the workload in the queue, providing an efficient and scalable solution.

If the processing involves UI automation, it’s not a good idea to run things in parallel on the same machine.

You can achieve this with a Queue trigger: Orchestrator - Triggers - https://docs.uipath.com/. Set Another job is triggered for each __ new item(s). according to your needs (eg. 300).

For this to work effectively, you need Dispatcher & Performer processes (setting the queue trigger to Performer). If you have went through the ReFramework trainings, you should be familiar with those.

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