I have a coded workflow that uses async/await calls. To do this properly, I need to make the method tagged [Workflow] asynchronous. Does UiPath and Studio support this functionality?
Hi @edevries ,
No, UiPath Studio workflows ([Workflow] methods) do not support being truly asynchronous with async/await in the same way as standard .NET applications.
You can try with these solutions:
If your code uses async/await, consider these options:
- Convert async code to synchronous code before exposing it to the workflow.
- Wait for the async task inside the coded workflow using
.GetAwaiter().GetResult()or.Result, and return the final result to UiPath. - For long-running operations, run them as separate processes/jobs and let UiPath wait for completion.
Thanks
Hi @edevries
Yes, Coded Workflows can work with asynchronous code, but the [Workflow] entry method itself is expected to follow the supported Coded Workflow signature.
If your workflow needs async/await, you can typically call an asynchronous method from the [Workflow] method and handle the returned Task. However, directly declaring the [Workflow] method as async Task may not be supported depending on the Studio/runtime version.
For example:
[Workflow]
public void Execute()
{
RunAsync().GetAwaiter().GetResult();
}
private async Task RunAsync()
{
await SomeAsyncOperation();
}
I would also recommend checking the Coded Workflows documentation for the exact method signature supported by your Studio version.
Hi @edevries
Yes, UiPath supports async/await in Coded Workflows. You can make the [Workflow] entry method return Task, for example public async Task Execute() and use await inside it.
Also make sure you’re using a recent Studio version, as there have been fixes related to async Coded Workflows.
Hello @edevries,
As @Monali_Vekariya has mentioned, indeed, coded workflows support asynchronous methods.
Below, I include the source code of a very basic example (similarly, the screenshot using it from UiPath Studio 2026.0.200 STS Community License):
using System.Threading.Tasks;
using UiPath.CodedWorkflows;
namespace AsyncDemo
{
public class AsyncCodedWorkflow : CodedWorkflow
{
[Workflow]
public async Task ExecuteAsync()
{
// Call the async method and wait for its result.
int result = await AddAsync(2, 3);
Log($"Result: {result}");
}
// Simulates work (e.g., a DB or network call) instead
// of blocking the thread.
private static async Task<int> AddAsync(int a, int b)
{
await Task.Delay(500);
return a + b;
}
}
}
NOTES:
- As you can see, the signature of the synchronous method
public void Execute()is converted to asynchronous by changingvoidtoTaskand, optionally, adding the suffixAsync(this is for naming convention, but if you don’t add it, it executes the same), resulting inpublic async Task ExecuteAsync(). - I have been using asynchronous methods in coded workflows since version 2024.10.x of UiPath Studio onwards, without issues.
- I should also mention that the method
ExecuteAsync()can receive parameters and return values.
