How to Create an asynccodeactivity

I am trying to create an activity using asynccodeactivity as I am trying to call Microsoft Vision API from the code. dll file has no errors and its working properly. But custom activity is not visible in Uipath Manage packages.

Is there any turorial on how to create ASYNCcodeactivity calls?

1 Like


That custom activity, have u pasted in package folder in which UI path studio installed

I have already created custom activities, now i am trying to create asynccustomactivity as i am calling an api and the result is available after completing the request. Have you created any async custom activities.

How to call an APi in custom activity and wait for resutl
@ovi @UiPath @UiPathMaster

I did. From packaging/deployment they don’t differ from normal ones.
Obviously you need to inherit from AsyncCodeActivity<T> (<T> being optional) and implement both BeginExecute and EndExecute.
But aside of that, they don’t differ much, framework takes good care of managing the async part.

What issues are you encountering? If you already deployed “standard” custom activities, treat it the same after compiling.

Do note that you won’t feel the async unless you use it in Parallel or similar scenarios.

can you please share a sample code that outputs a parameter
like this and returns result

public OutArgument Result { get; set; }

If noone responds till the weekend I’ll try to make something that I could share publicly then (not much time during the week).

In the meantime, can you double check if FIlter Activities is unchecked and that your package is in one of the source locations?

Or actually why reinvent the wheel:


finally, there is some has problem with me. I used codeactivity to connect my API. it’s working fine if I debug on console. but when I found deadlock when use uipath. I still don’t know why.

My last option is using asyncodeactivity.

Thank you to create this inquriy

I got this error

AsyncCodeActivity.BeginExecute must return an IAsyncResult where IAsyncResult.AsyncState is the state object provided by the runtime.

do you know why?

Did you manage to resolve deadlock? I have the same issue in UiPath but works in console

Yeah, I solved it.

Could you share the details. Is it resolved by converting to async activity?

Could you please share you example of using AsyncCodeActivity and how you solved a deadlock? Thanks