My task is to schedule the UiPath workflow that takes list credentials for portal login bu the backend api. Another case is, my external appication sends the specific users credentials to the UiPath workflows input argument when the user attemt to trigger the worflow manually from the external website.In this case, my workflow should process the credentials received in input arguments. And the user the list of credentials sent from the backend api for the scheduled runs. Note, there is two apis one is seperate backend, another one is a seperate website.
You can handle both scenarios with a single UiPath workflow. The idea is to let the workflow decide which credentials to use based on what information it receives.
Your workflow will get two possible inputs:
A list of credentials
A single user’s credential
create two input arguments in your workflow:
One argument for the list
One argument for the single user credential
Inside the workflow, add a simple condition that checks which argument has data. For example:
1.If the single user credential is not empty, then the workflow will run only for that user.
2.If the list of credentials has values, then the workflow will loop through the list and process each user.
3.If both are empty, you can throw an error saying no credentials were provided.
This approach lets you keep everything in one workflow, and it works for both scheduled job triggers and manual triggers from the website. The API that calls the workflow just needs to send the right input depending on the scenario.
If you want, I can also help you write the input argument structure or show a simple workflow outline.
like this in input. The UiPath workflow needs to take this credetials and process. this is my goal. I created the input argument and named credentialsList in arguments panel with list<dictinory<String,Object>> datatype.
Your website sends the credentials as JSON, but UiPath does not automatically convert that JSON into a List<Dictionary<String,Object>>, which is why your condition credentialsList IsNot Nothing ANDAlso credentialsList.Count > 0 always fails. The data actually arrives as a JSON object (JArray or JObject), not as the typed list you created. Because of this mismatch, UiPath cannot read the list and the workflow goes to the fallback API call.
To fix this, change the UiPath input argument type to JArray instead of List<Dictionary>. Then use Deserialize JSON Array activity inside the workflow with credentialsList.ToString and store the output in a JArray variable like credArray. After that, you can loop through each item and extract fields like userName, passWord, portalName, and others using item("userName").ToString.
Your new condition should be:
credArray IsNot Nothing AND credArray.Count > 0
This correctly identifies when credentials are sent from the external website. If the array contains values, use those credentials. If it’s empty or null, treat it as a scheduled run and fetch the credentials from your backend API.
This approach cleanly handles both scenarios—manual trigger from the website and scheduled trigger from backend—without breaking the workflow.