How to stop the workflow if the condition is true

Hello community!

I just wanted to stop my UiPath process once the condition is true in IF activity
the problem iam getting is when my condition is true after all process get executed in then part it is moving to another activity iam getting error that no ui element found,I want to stop the workflow in then part only at last i want to execute stop that worflow.

hi @Priyesh_Shetty1

use terminate workflow activity

1 Like


It sounds like you want to halt your UiPath workflow as soon as a certain condition is met, without continuing to execute subsequent activities in the workflow. To achieve this, you can use the “Terminate Workflow” activity within the “Then” part of your “If” activity.

@Shiva_Nikhil I have used but it is not stoping

try using ‘Throw’ activity
then set a new BRE on what exception message you want to see

or just a new Exception

use if condition

in the then part use throw activity
and provide the workflow with try catch
and in the catch you can place terminate work flow




Please follow below steps:

  1. Flow Decision Activity:
  • Drag and drop a “Flow Decision” activity onto your workflow.
  • In the properties of the “Flow Decision” activity, set up the condition you want to check. For instance, you can use variables or expressions to evaluate the condition.
  1. Terminate Workflow Activity:
  • From the “Flow Decision” activity, create two possible outcomes: one for when the condition is true and one for when the condition is false.
  • In the path that corresponds to the true condition, add a “Terminate Workflow” activity to end the workflow.
  1. Configure Terminate Workflow Activity:
  • In the “Terminate Workflow” activity’s properties, you can provide an optional reason for terminating the workflow. This can be useful for documentation purposes.
  1. Save and Run:
  • Save your workflow.
  • Run the project to test the workflow’s behavior.

H! @Priyesh_Shetty1

Instead of using all this you can try with this simple way !