Use Terminate Workflow to stop the current workflow, mark its instance as Terminated, and record why it was terminated.
Step Library: Workflow > Completion
When to use this step
Use this step when you want to:
- stop the current workflow without running its remaining steps;
- mark the instance as Terminated rather than successfully completed; or
- terminate the workflow from inside a branch, loop, group, stage, or parallel path.
Common examples include:
- terminating a workflow after detecting invalid or inconsistent process data;
- stopping processing when a required business precondition is no longer satisfied; or
- ending all remaining workflow work when a child path detects a terminal condition.
Use End Workflow instead when the workflow should finish successfully with status Completed. Use a condition or branch when the workflow should skip selected work but continue with later steps.
Before you begin
This step does not require a connection or special permissions beyond the permissions needed to edit and run the workflow.
Create or identify any Text, Number, Boolean, or Date variables that you want to include in the termination reason.
Configure the step
- Add Terminate Workflow from Workflow > Completion.
- Select the step to open its configuration panel.
- Under General, enter the required Termination Reason.
- Optionally insert Text, Number, Boolean, or Date variables into the reason.
- Save or publish the workflow.
Settings
| Setting | Required | Accepted values | Visible when | Description |
|---|---|---|---|---|
| Termination Reason | Yes | Multiline text and embedded Text, Number, Boolean, or Date variables | Always | Reason shown on the terminated Terminate Workflow activity. The default is empty. The configured value must contain at least one non-whitespace text character or a variable. Flowifier resolves embedded variables when the step runs, removes whitespace and line breaks from the beginning and end of the complete reason, and then terminates the workflow. There is no step-specific character-count limit. |
The variable picker does not offer Object, File, or Collection variables. Select a compatible scalar property or convert the value to Text before using it in Termination Reason. There are no conditional settings.
Data and outputs
Workflow variable effects
This step does not modify workflow variables.
Variables embedded in Termination Reason are read when the step starts. Their values remain unchanged when the workflow is terminated.
Step outputs
This step does not expose step outputs.
The termination reason is activity information. It is not available as a previous-step output.
Runtime behavior
Execution and completion
When the step starts, Flowifier:
- resolves embedded variables from the current workflow execution context;
- converts the configured reason to plain text;
- removes whitespace and line breaks from the beginning and end of the complete reason;
- marks Terminate Workflow as Terminated and records the remaining reason on the activity; and
- marks the workflow instance as Terminated without running any later step.
Whitespace within the reason is preserved. If the resolved reason is empty or contains only whitespace, the step still terminates the workflow but the activity has no termination-reason text.
The step does not call an external provider and has no external side effects of its own.
Branches and child steps
This step does not have branches or child steps.
When it runs inside a branch, loop, group, or stage, the termination result propagates immediately through the enclosing containers. Later child steps, iterations, stages, and steps after the container do not run. The configured termination reason remains on the terminating child activity; enclosing container activities show generic guidance to review the terminated child.
When Terminate Workflow runs in one Run in Parallel path, all parallel paths have already started. Activities that finish before termination are retained, while sibling activities that are still running or suspended are recorded as Cancelled when the instance becomes Terminated. External effects already performed or started by sibling steps are not rolled back.
Failure, retry and resume behavior
This step does not suspend execution or perform automatic retries.
If the instance is cancelled, terminated, or fails before this step starts, the step does not run. If an enclosing step suspends before reaching Terminate Workflow, execution resumes at the suspended work; Terminate Workflow terminates the instance only when execution later reaches it. A terminated instance is not resumed, and starting a new instance evaluates the reason again from that new execution context.
Errors and limits
| Situation | Result | Resolution |
|---|---|---|
| Termination Reason is empty or contains only whitespace | The Designer marks the required setting as invalid, and the workflow cannot be published. | Enter at least one non-whitespace character or insert a supported variable. |
| A referenced variable was deleted or is no longer accessible | The Designer reports an invalid variable reference, and the workflow cannot be published. | Remove the invalid reference or select an accessible variable. |
| An Object, File, or Collection variable is required | The variable is not available for selection in Termination Reason. | Select a Text, Number, Boolean, or Date property, or convert the value to Text in an earlier step. |
| The complete reason resolves to empty or whitespace-only text | Terminate Workflow terminates the instance, but the activity has no termination-reason text. | Include fixed fallback text or ensure an embedded variable contains a non-whitespace value when a visible reason is required. |
| A referenced value is unexpectedly unavailable when the step runs | The step fails and the instance becomes Faulted instead of Terminated. | Correct the variable reference and start a new instance. |
| A parallel sibling has already started an external side effect | The instance terminates and any still-open sibling activity is recorded as Cancelled, but an external effect that already occurred is not rolled back. | Place the termination decision before parallel side effects, or make sibling operations safe to repeat and verify their provider results before restarting. |
This step has no additional limits beyond the general workflow limits.
Example
Terminate an invalid request
Goal: Stop processing a request after detecting data that cannot be processed safely.
Configuration:
-
Termination Reason:
Request [Request ID] contains invalid data.
Insert the Text variable Request ID between the fixed text.
Result: If Request ID contains REQ-1042, the Terminate Workflow activity records Request REQ-1042 contains invalid data., the instance becomes Terminated, and no later step runs. The variable remains unchanged, and the step exposes no output.
Related information
- End Workflow — stop later steps while completing the instance successfully instead of terminating it.
- Run If — terminate only when a configured condition is true.
- Run in Parallel — understand which parallel work can already have started when one path terminates the workflow.
Comments
0 comments
Please sign in to leave a comment.