Reframework - Correct way to work with credentials

Interesting question

The correct/intended way to work with credentials stored in Orchestrator is to get them in the Initialization process and pass them to the processes and subprocesses as arguments. This way, the credentials are only stored in memory for as long as necessary, and they can be reused by multiple processes and subprocesses without having to call Orchestrator multiple times.

Here is an example of how to do this:

`// In the Initialization process:

// Get the credentials from Orchestrator.
var credentials = GetCredentials(“C_Example”);

// Pass the credentials to the processes and subprocesses as arguments.
StartProcess(“ProcessOne”, credentials);
StartProcess(“ProcessTwo”, credentials); // In the ProcessOne process:

// Use the credentials that were passed as arguments.
// … // In the ProcessTwo process:

// Use the credentials that were passed as arguments.
// …`

This approach is more efficient and scalable than calling Orchestrator in the middle of a subprocess to get the credential. It also avoids the problem of having to call Orchestrator multiple times per item if the credential is used more than once per execution.

In the case of your automation, where you have around 2000 items per performer execution and at least 1000 of the items require you to call Orchestrator for a credential, this approach could save a significant amount of time.

It is important to note that you should only store credentials in Orchestrator that are needed by your UiPath robots. If possible, you should avoid storing sensitive credentials in Orchestrator, such as passwords or API keys. Instead, you should use a secure secrets management solution to store these credentials.

Hope this helps
Cheers @Pelayo_Celaya_Fernandez

1 Like