# Running a job inside Orchestrator

> * Create a process in Orchestrator.
* Run the CLI `exe` (for Windows) or `dll` (for Linux) file.
* Add the required Orchestrator [API access application scopes](https://docs.uipath.com/cicd-integrations/standalone/2023.10/user-guide/executing-uipath-cli-tasks).

## Prerequisites

* Create a process in Orchestrator.
* Run the CLI `exe` (for Windows) or `dll` (for Linux) file.
* Add the required Orchestrator [API access application scopes](https://docs.uipath.com/cicd-integrations/standalone/2023.10/user-guide/executing-uipath-cli-tasks).

To run a job inside Orchestrator, take the following steps:

1. Run the `job` task, using `uipcli job`. Now you can see a list of the available the sub-tasks.
2. Specify the required parameters and run the `run` sub-task.See the list of parameters below.

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
    Parameter 
    Description 
  
 
 
  
    <code>-i</code> , or <code>--input_path</code> ( Required only if the entry point of the workflow has input parameters) 
    The full path to the JSON input file corresponding to the process that you want to run. See Input Parameters JSON Format for details on the file structure. 
  
  
    <code>-P</code> , or <code>--priority</code> 
    The priority that you want to run the job with:- Low.- Normal (default).- High. 
  
  
    <code>-r</code> , or <code>--robots</code> 
    A list of specific robot names, separated by commas. 
  
  
    <code>-j</code> , or <code>--jobscount</code> 
    The number of times that you want to run the process. The default number of times that the process runs is one. 
  
  
    <code>-U</code> , or <code>--user</code> 
    The name of the user. This should be a machine user, not an Orchestrator user. For local users, the format is MachineName\\UserName . 
  
  
    <code>-M</code> , or <code>--machine</code> 
    The name of the machine that you want to run the process on. 
  
  
    <code>-R</code> , or <code>--result_path</code> 
    The full path to a JSON file, or to a folder, where you want to store the results of the job. The results return as JSON files. 
  
  
    <code>-W</code> , or <code>--timeout</code> 
    The timeout for job executions (seconds). The default is 1800 seconds. 
  
  
    <code>-f</code> , or <code>--fail_when_job_fails</code> 
    The command fails when one job fails, The default for this is True . 
  
  
    <code>-w</code> , or <code>--wait</code> 
    The command waits for the job to finish. The default for this is True . 
  
  
    <code>-b</code> , or <code>--job_type</code> (for modern folders only) 
    The type of runtime for the job. The default value is <code>Unattended</code>.
      Values supported for this command: <code>Unattended</code>, <code>NonProduction</code>
   
  
  
    <code>-u</code> , or <code>--username</code> ( Required if you use Basic Authentication , through a username and a password) 
    The username used for authenticating to Orchestrator. You must pair it with the corresponding password. 
  
  
    <code>-p</code> , or <code>--password</code> ( Required if you use Basic Authentication , through a username and a password) 
    The password used for authenticating to Orchestrator. You must pair it with the corresponding username. 
  
  
    <code>-t</code> , or <code>--token</code> ( Required if you use  token-based authentication  ) 
    The OAuth2 refresh token used for authenticating to Orchestrator. You must pair it with the Account Name and Client ID . 
  
  
    <code>-a</code> , or <code>--accountName</code> ( Required if you use  token-based authentication  ) 
    The Orchestrator CloudRPA account name. You must pair it with the OAuth2 refresh token and Client ID . 
  
  
    <code>-A</code> , or <code>--accountForApp</code> 
    The Orchestrator CloudRPA account name (organization name). You must pair it with the Application ID , Application Secret , and Application scope for external application. 
  
  
    <code>-I</code> , or <code>--applicationId</code> ( Required if you use  external application authentication  ) 
    The external Application ID. You must pair it with the Application Account , Application Secret , and Application scope . 
  
  
    <code>-S</code> , or <code>--applicationSecret</code> ( Required if you use  external application authentication  ) 
    The external Application Secret. You must pair it with the Application Account , Application ID , and Application scope . 
  
  
    <code>--applicationScope</code> ( Required if you use  external application authentication  ) 
    The list of application scopes, separated by single spaces. You must pair it with the Application Account , Application ID , and Application Secret for external application. 
  
  
    <code>-o</code> , or <code>--organizationUnit</code> 
    The name of the Orchestrator folder (organization unit). <style> .css-17xdpgx\{word-break:break-word;\}.css-17xdpgx div\{padding-left:10px;\}.css-17xdpgx code\{font-size:16px;\}.css-17xdpgx img\{margin-bottom:-5px;\} </style> To input subfolders make sure to input both the parent folder name and the name of the subfolder. For instance, use <code>AccountingTeam\TeamJohn</code> . 
  
  
    <code>-l</code> , <code>--language</code> 
     The Orchestrator language.  
  
  
    <code>-y</code> , <code>--disableTelemetry</code> 
    Disable telemetry data. 
  
  
    <code>--traceLevel</code> 
    Display the trace of the events. 
  
  
    <code>--identityUrl</code> ( Required for PaaS or MSI deployments) 
     The URL of your identity server.  
  
  
    <code>--help</code> 
     Displays the parameters and examples for this command.  
  
  
    <code>--version</code> 
     Display version information.  
  
  
    <code>Process Name (pos.0)</code> ( Required ) 
    The name of the process that you want to run. 
  
  
    <code>Orchestrator URL (pos.1)</code> ( Required ) 
    The URL of the Orchestrator instance. 
  
  
    <code>Orchestrator Tenant (pos.2)</code> ( Required ) for SaaP deployments.  ( Optional ) for PaaS deployments.  
    The tenant of the Orchestrator instance, where you want to run processes. 
  
 

## Usage

```
job run <process_name> <orchestrator_url> <orchestrator_tenant> [-i <input_path>] [-j <jobscount>] [-R <result_path>] [-P <priority>] [-r <robots>] [-f <do_not_fail_when_job_fails>] [-W <timeout>] [-w <do_not_wait>] [-u <orchestrator_user> -p <orchestrator_pass>] [-t <auth_token> -a <account_name>] [-A <account_for_app> -I <application_id> -S <application_secret> --applicationScope] [-o <folder_organization_unit>] [-l <language>] [-b <RuntimeType>]
```

## Examples

* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -u admin -p 123456`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -u admin -p 123456 -P Low`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -u admin -p 123456 -P Normal -o MyFolder`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -u admin -p 123456 -P High -o MyFolder`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -t a7da29a2c93a717110a82 -a myAccount -f false -W 0`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -t a7da29a2c93a717110a82 -a myAccount -P High -j 3 -w
  false`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -t a7da29a2c93a717110a82 -a myAccount -P Low -r robotName
  -R C:\Temp`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -t a7da29a2c93a717110a82 -a myAccount -r robotName -R
  C:\Temp\status.json`
* `job run ProcessName "https://uipath-orchestrator.myorg.com" default -A accountForExternalApp -I myExternalAppId -S myExternalAppSecret
  --applicationScope "OR.Folders.Read OR.Settings.Read" -r robotName -R C:\Temp\status.json`
