Subscribe

UiPath Robot

The UiPath Robot Guide

Stopping a Process

A process can be stopped through Kill or Cancel commands. The command can be sent from Orchestrator, Assistant or Studio.

When the Robot receives the Cancel command, it cancels the execution of the current activity and starts executing the final steps. If this takes more than 3 seconds, the process is killed.

On the other hand, when the Robot receives the command to Kill a process, it first tries to Cancel the execution and if the execution is not finished in 3 seconds, the process is killed.

Try-Catch Scenario

During a Try-Catch workflow, when a process is stopped, the transaction status can show as successful when it actually did not complete.

Cancelling a Process

If the execution is in the Try or Catch block when the Cancel command is received by the Robot, it skips to the Finally block which checks for any errors. If no errors are found, then the Finally block thinks the execution completed successfully as there are no failure events (they are blank).

Killing a Process

If the execution is in the Try or Catch block when the Kill command is received by the Robot, it first tries to Cancel the process, skipping to the Finally block. If the logic inside the Finally block is not finished in 3 seconds since receiving the Cancel command, the whole execution is killed and the overall process is successful in the logs as no errors were recorded in the Catch block since it was skipped.

Avoiding False Positives

  • Setting the Process status to Successful should be done only inside the Try block, after the Business Logic is completed.
  • Setting the status to Failed should be done only inside the Catch block, after the error handling logic is completed.
  • In the Finally block, there should be only cleanup logic present, since it is executed no matter if the execution was successful or not.

The REFramework Process Scenario

In the REFramework scenario, when a process is stopped, the block containing the error logic is skipped and the final block is executed. This causes the values for the BusinessError and SystemError to stay null and the overall process status is considered successful. The behavior described is intended.

📘

Note:

If the block that contains the error logic is skipped, the values for BusinessError and SystemError stay null and the overall process status is considered successful, as no errors were recorded.

Updated 2 years ago


Stopping a Process


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.