Coded Workflow Services for UiPath Libraries

Hey Team!

Love the work with coded workflows so far! As I am thinking through best practices for coded automations/workflows, one thing I noticed was that it seems like its not really possible to reference Library-output type projects via coded workflows. What I mean specifically:

  1. I create a Library-output project in UiPath Studio, create some activities for it, and publish it.
  2. I import the above library in a Process-output project in UiPath Studio. It seems that I am unable to then reference the activities I created in my library within Coded Workflows.

I know that the way that the coded workflows work is through a public partial class ‘CodedWorkflow’, that you are able to inject services into via DI (like ‘system’, ‘testing’, etc.), but I’m not sure how to even reference, let alone execute, the activities generated from the library.

Not sure if there’s a workaround for this yet, but it would help make things consistent :slight_smile:

Thanks,
Yash

1 Like

Did you ever get this answered, I’d be happy to back and forth if you still need help.

1 Like

I believe this is resolved on the current stable version!

Might need to reload project or something after initially adding the library dependency but you should be able to access referenced UiPath Library activities via a service just like system or testing. I believe it gets added to the base CodedWorkflow class as a member/lazily initialized DI service through reflection/registration pattern.

Ie.
Library name: My Library
Coded Workflow Reference: my_Library/myLibrary or some other safe transformation. I was able to see it in the intellisense with ctrl + space in any CodedWorkflow derived class.

Note that I always create activity metadata for my libraries, and have not tested it in the scenario that activities in libraries are created without it.

1 Like