Using the TerminateWorkflow Activity to Stop a Workflow Job


To terminate a Workflow Job at a specific time and throw a specific exception, you can use the Terminate Workflow activity. The TerminateWorkflow activity immediately ends the Workflow Job with the specified exception and a Final Severity of "Error".

The TryCatch activity in the Workflow can be used to catch an exception created by another activity. For more control of the final output, use the TerminateWorkflow activity in the Catches section of the TryCatch block and provide a custom reason.

TerminateWorkflow Activity Properties

 Property Description

Enter the text that is displayed for the TerminateWorkflow activity within the Workflow Job.


Enter the exception to end the Workflow Job. The exception is displayed in the log file from the Monitor view.

  • new System.Exception("Failed Due to xyz")
  • new System.NotSupportedException()
  • new System.NotImplementedException()

NOTE: The exception must be fully qualified using the System namespace.

For additional information on common exception types and when to use them, see the Exception Class article.


Enter the text that will be displayed in the Description field in the Monitor view. It is also displayed as the final status in the log file from the Monitor view.

Adding a TerminateWorkflow Activity to a Workflow Job

  1. Click Definitions from the Shortcuts menu.
  2. Right-click the Workflow Job and select Properties.
  3. Click the Source tab.
  4. Under the Toolbox, expand the Runtime section.
  5. Drag and drop the TerminateWorkflow activity onto the Activity panel.
  6. In the Properties panel, enter values for the exception and reason.
  7. Click Save and Close.

Viewing the Terminated Workflow Job

After the Workflow Job runs, you can view the reason and the exception.

  1. Run the Workflow Job.
  2. Click Monitor from the Shortcuts menu.
  3. View the Reason in the Description field in the Monitor view.
  4. Double-click the Workflow Job.
  5. Click the Log File tab.
  6. View the reason and the exception values in the log.
  7. Close the window.


Have more questions? Submit a request