How To Get Completed process Response

I make a process and execute it using Orchestrator API. Also, It works Completely without any error how can I get that executed process status when its complete execution. Thanks In Advanced

@parshv Can you elaborate on this request?

How would you like to receive the status update?
Are you using a Queue?

Even if using a queue, the job that is processing the queue items would seem to be what he’s concerned about. I think he wants to be able to make an API call to check the status of the job that he executed. In this case I think there may be a unique Reference Key or something for the Job that he can reference to check the status.

@parshv I’m assuming you used the /odata/Jobs/UiPath.Server.Configuration.OData.StartJobs endpoint to launch the job on your specified robot… I’m fairly certain you’ll need to use the /odata/Jobs({Id}) endpoint with an Id provided by the StartJobs Response Class. On a successful launch from the StartJobs call, you should receive a Response formatted similar to the following:

{
  "@odata.context": "string",
  "value": [
    {
      "Key": "string",
      "StartTime": "2019-12-10T16:11:03.176Z",
      "EndTime": "2019-12-10T16:11:03.176Z",
      "State": "Pending",
      "Robot": {
        "LicenseKey": "string",
        "MachineName": "string",
        "MachineId": 0,
        "Name": "string",
        "Username": "string",
        "Description": "string",
        "Version": "string",
        "Type": "NonProduction",
        "HostingType": "Standard",
        "Password": "string",
        "CredentialType": "Default",
        "Environments": [
          {
            "Name": "string",
            "Description": "string",
            "Robots": [
              {}
            ],
            "Type": "Dev",
            "Id": 0
          }
        ],
        "RobotEnvironments": "string",
        "ExecutionSettings": {},
        "Id": 0
      },
      "Release": {
        "Key": "string",
        "ProcessKey": "string",
        "ProcessVersion": "string",
        "IsLatestVersion": true,
        "IsProcessDeleted": true,
        "Description": "string",
        "Name": "string",
        "EnvironmentId": 0,
        "EnvironmentName": "string",
        "Environment": {
          "Name": "string",
          "Description": "string",
          "Robots": [
            {
              "LicenseKey": "string",
              "MachineName": "string",
              "MachineId": 0,
              "Name": "string",
              "Username": "string",
              "Description": "string",
              "Version": "string",
              "Type": "NonProduction",
              "HostingType": "Standard",
              "Password": "string",
              "CredentialType": "Default",
              "Environments": [
                {}
              ],
              "RobotEnvironments": "string",
              "ExecutionSettings": {},
              "Id": 0
            }
          ],
          "Type": "Dev",
          "Id": 0
        },
        "InputArguments": "string",
        "CurrentVersion": {
          "ReleaseId": 0,
          "VersionNumber": "string",
          "CreationTime": "2019-12-10T16:11:03.177Z",
          "ReleaseName": "string",
          "Id": 0
        },
        "ReleaseVersions": [
          {
            "ReleaseId": 0,
            "VersionNumber": "string",
            "CreationTime": "2019-12-10T16:11:03.177Z",
            "ReleaseName": "string",
            "Id": 0
          }
        ],
        "Arguments": {
          "Input": "string",
          "Output": "string"
        },
        "ProcessSettings": {
          "ErrorRecordingEnabled": true,
          "Duration": 0,
          "Frequency": 0,
          "Quality": 0
        },
        "Id": 0
      },
      "Source": "string",
      "SourceType": "Manual",
      "BatchExecutionKey": "string",
      "Info": "string",
      "CreationTime": "2019-12-10T16:11:03.177Z",
      "StartingScheduleId": 0,
      "ReleaseName": "string",
      "Type": "Unattended",
      "InputArguments": "string",
      "OutputArguments": "string",
      "HostMachineName": "string",
      "HasMediaRecorded": true,
      "Id": 0
    }
  ]
}

I think you’ll just need the Id and key from the jobsDto Class. The Id should correspond to the generic Job Id, and the Key should correspond to the unique job identifier.

When you start a job using /odata/Jobs/UiPath.Server.Configuration.OData.StartJobs the response contains an Id Value. This value is then passed into /odata/Jobs({Id}).

So for example, my response from the Start Job was the following:

{
  "@odata.context": "https://orchestrator_hosted_site.net/odata/$metadata#Jobs",
  "value": [
    {
      "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "SourceType": "Manual",
      "BatchExecutionKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "Info": null,
      "CreationTime": "2019-12-10T18:02:42.0055196Z",
      "StartingScheduleId": null,
      "ReleaseName": "TestAddTransactionAPI",
      "Type": "Unattended",
      "InputArguments": null,
      "OutputArguments": null,
      "HostMachineName": null,
      "HasMediaRecorded": false,
      "Id": 449
    }
  ]
}

The Id parameter doesn’t track the Job generally, it tracks the specific Job execution, so you can then use the Id Value in /odata/Jobs({Id}) to retrieve the status of the job. I made a call to the endpoint /odata/Jobs(449) and received the following which notes that it was successful in the State Value:

{
  "@odata.context": "https://orchestrator_hosted_site.net/odata/$metadata#Jobs/$entity",
  "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "StartTime": "2019-12-10T18:02:42.32Z",
  "EndTime": "2019-12-10T18:02:43.87Z",
  "State": "Successful",
  "Source": "Manual",
  "SourceType": "Manual",
  "BatchExecutionKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "Info": "Job completed",
  "CreationTime": "2019-12-10T18:02:42.007Z",
  "StartingScheduleId": null,
  "ReleaseName": "TestAddTransactionAPI",
  "Type": "Unattended",
  "InputArguments": null,
  "OutputArguments": "{}",
  "HostMachineName": "xxxxxxxxxxxx",
  "HasMediaRecorded": false,
  "Id": 449
}

If you aren’t able to track the Job ID at runtime, then you’ll have to make a call to retrieve all the jobs launched with some given parameters (within the last day or last 4 hours maybe? Not sure what is applicable) and then based on the response, find the Job you’re looking for and then use it’s Id to then check the status, unless the status is already provided which is likely the case.

Hope this helps.