Can I Make An Activity ASynchronous?

Hi everyone,

Are there any documents which could help me work out whether I can run activities asynchronously? I’m making API requests from a workflow, but the API takes a while to respond and the workflow blocks while it’s waiting.

I’m nowhere remotely close to the API rate limits and being able to make a few requests at the same time could speed this process up dramatically. I can handle exceptions in one go at the end.

Thanks for any help

@rpa_jay

UiPath didn’t natively support asynchronous activities in the way you might be familiar with in other programming languages or frameworks. UiPath workflows are typically designed to be executed sequentially, with each activity completing before the next one starts. However, UiPath does provide some mechanisms for parallel processing and concurrency to help you achieve similar outcomes.

You can try with parallel activity
Check this out for more discussion

@rpa_jay

Hi @rpa_jay

Asynchronous processing of activities in UiPath can help improve the efficiency of your workflows when dealing with operations like making API requests that have potential latency. However, not all activities in UiPath are natively asynchronous, and the ability to run activities asynchronously might depend on the specific activity or API you’re using.

Here are some steps and considerations to determine whether you can run activities asynchronously in your workflow:

  1. Invoke Workflow and Parallel:

    • UiPath provides the “Invoke Workflow” and “Parallel” activities, which allow you to run activities in parallel. You can split your workflow into multiple branches, each handling a separate API request, and then use the “Parallel” activity to execute them concurrently.
  2. Custom Activities:

    • If the activities you are using do not support asynchronous operations natively, consider creating custom activities using UiPath Studio or .NET libraries that can perform asynchronous tasks. You can then use these custom activities in your workflow.

Thanks!!