Passing argument to start a job

Hi. I am starting a job in orchestrator via the uipath activity. I need to pass through an argument to this job. How would I do that?

Thanks

1 Like

Hi @Vicky_Fegan1,

If you want to start a job considering arguments, you should do it through API

You can use a Orchestrator HTTP Request or HTTP Request activity. For this last, you should install the package UIPath.WebAPI.Activities

Then, you just need to inform your JSON in the JSONPayload (if you use Orchestrator HTTP Request) or Body (if you use HTTP Request)

Check the Swagger to see all details, here is how you access it:

This is the route you should use:

HI @Vicky_Fegan1

Check these links once to learn about arguments

Regards
Gokul

You don’t use the API. You create arguments in your project and then they become Process parameters in Orchestrator.

Set the argument in the Process parameters in Orchestrator.

Sorry guys!

I did not pay attention to this detail.

I thought that Vicky was trying to start another Job through Studio, using Start Job activity

He’s starting a Job (I assume with the Start Job activity) from a separate automation. So automation A starts a Job for automation B.

Assuming the parameter isn’t dynamic, it can be done via Process parameters in Orchestrator. If the parameter can be different for each Job, then it shouldn’t be an argument/parameter it should be stored in an Asset. Automation A updates the value of the Asset then starts the Job of Automation B which reads the Asset.

For context Process A is reading in an array of filepaths. For each filepath Process B needs to start. How would I do this as there could be any number of filepaths in the array?

Create an Asset. As you loop through the array, update the Asset with the current filepath that B needs to process, then create the B Job. B should read from the Asset.

Would timing not be an issue here?

That depends. What timing issues would you expect, based on your process?

By the time the job starts and reads in the asset, is there a potential for the asset to have changed onto the next value?

Potentially, yes. You could have a second Asset that you increment in B. So A gets the value of the secondary Asset, updates the primary Asset, kicks off B, B reads the first Asset and then increments the secondary Asset, and a Do While in A keeps it from continuing until it sees that the secondary Asset value has changed from what it initially read.

HI.

So I’ve found out there’s an activity called UiPath.Persistence.Activities where you can pass arguments through. :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.