Start Job throwing error

I have to call a process from another process, for that i am using ‘Start Job’ activity.
The Robot has the edit create rights on jobs and process, also the process name I am passing is in the "packageName_environmentName’ format but I’m still getting the error => Start Job: An invalid result was encountered for parameter Process Name

Screenshot attached :

Any help will be appreciated :slight_smile:

@loginerror @Pablito : Guys, any suggestions?

Hi @shubhiyadav

Could you double check this permission?

1 Like

I have done it, though it got resolved now by passing the process name instead of “packageName_EnvName”, but is it right? @loginerror

Not according to our documentation:

I’ll check if something shouldn’t be updated :slight_smile:

Yes @loginerror exactly, till the time i was following the format mentioned in document it was throwing error in Process parameter, but when i wrote just the process name it worked fine.

This may create confusion for many in future, so thought to inform you.

1 Like

Using throw will change the job object’s State property to “Failed”. The key is to use the job object returned from Start-Job or Get-Job and check the State property. You can then access the exception message from the job object itself.

Per your request I updated the example to also include concurrency.

$createZip = {
    Param ( [String] $source, [String] $zipfile )

    if ($source -eq "b") {
        throw "Failed to create $zipfile"
    } else {
        return "Successfully created $zipfile"
    }
}

$jobs = @()
$sources = "a", "b", "c"

foreach ($source in $sources) {
    $jobs += Start-Job -ScriptBlock $createZip -ArgumentList $source, "${source}.zip"
}

Wait-Job -Job $jobs | Out-Null

foreach ($job in $jobs) {
    if ($job.State -eq 'Failed') {
        Write-Host ($job.ChildJobs[0].JobStateInfo.Reason.Message) -ForegroundColor Red
    } else {
        Write-Host (Receive-Job $job) -ForegroundColor Green 
    }
}

I am receiving this same error, but I am unable to resolve the issue. I have tried all permutations of the package/process name with and without the Environment name added on. Also, all permissions are set exactly as needed.

Here is the message of the error: Exception Message: An invalid result was encountered for parameter Process Name
Here is the stack trace for the error: at UiPath.Core.Activities.TaskExtensions.ThrowIfNeeded(Task task, Boolean suppresThrowException)\r\n at UiPath.Core.Activities.Orchestrator.BaseOrchestratorClientActivity.ThrowIfNeeded(AsyncCodeActivityContext ctx, Task task, Boolean suppresThrowException)\r\n at UiPath.Core.Activities.Orchestrator.BaseOrchestratorClientActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Here is the Process Information:

Here is the Asset where I am storing the process name (note, I have tried all permutations of the Process name, including with or without the version number at the end):

Here is the activity with the properties filled out (note, Process name is the asset retrieved as shown above):
image

And just to confirm the proper permissions are set for the Robot User Role: