Description:
Note: This step is to be executed only when necessary.
The Remove Single WF Instance workflow step removes a specified workflow/process instance while the workflow is executing. The instance to be removed is identified through its instance ID.
The step supports:
- Specifying the ID of the workflow/process instance to remove.
- Using a Variable or Global variable to supply the instance ID.
- Dynamically determining the instance to be removed.
- Removing a single workflow instance as part of workflow processing.
- Routing subsequent workflow processing through True or False return paths.
Inputs
-
ID of the instance -- The
instanceIDproperty specifies the ID of the process/workflow instance that should be removed.
Returns
- True – The True return path can be connected to the next workflow activity when the removal operation produces the expected result.
- False – The False return path can be used for an alternative workflow path or handling when the expected result is not produced.
Usage:
The Remove Single WF Instance step is typically used when a workflow needs to remove a specific process instance identified by its instance ID.
The instance ID can be obtained from workflow data and supplied to the step at execution time.
A typical workflow pattern is:
Identify Instance → Remove Single WF Instance → Continue Process
The step can be useful when a workflow has determined that a particular process instance should no longer remain in the workflow environment.
Because the step operates on an instance ID, take care to ensure that the ID supplied to the step identifies the intended process instance.

Typical Workflow Suggestions:
Remove an Unwanted Workflow Instance
Use the step when workflow logic determines that a particular process instance should be removed.
Example:
Identify Instance → Remove Single WF Instance → Continue Process
The workflow obtains the target instance ID and passes it to the Remove Single WF Instance step.
Clean Up a Previously Created Instance
Use the step as part of a workflow that creates or manages other workflow instances and later determines that an instance is no longer required.
Example:
Create/Identify Instance → Evaluate Condition → Remove Single WF Instance
The instance ID can be stored in a Variable or Global variable and supplied to the removal step when cleanup is required.
Remove an Instance Based on a Workflow Condition
Use a condition or decision step before Remove Single WF Instance to determine whether the target instance should be removed.
Example:
Evaluate Request → Remove Instance → Continue Process
This allows the workflow to make the removal decision before supplying the target instance ID.
Use a Variable to Identify the Instance
The instanceID property accepts a string value, allowing the target instance ID to be supplied dynamically.
Example:
Get Instance ID → Remove Single WF Instance → Continue
This is useful when the instance to be removed is determined during workflow execution.
Use a Global Variable for the Instance ID
A Global variable can be used when the instance ID needs to be made available to workflow processing through a shared workflow value.
Example:
Retrieve Instance Information → Remove Single WF Instance → Continue Process
The Global variable can supply the instance ID to the required instanceID property.
Remove a Specific Instance Identified by Business Logic
Use preceding workflow activities to determine which instance should be removed.
Example:
Retrieve Request Information → Determine Instance → Remove Single WF Instance
The workflow can first identify the appropriate process instance and then pass its ID to the removal step.
Route Processing After the Removal Operation
Use the True and False return paths to control what happens after the step executes.
Example:
Remove Single WF Instance → Continue Process
The True path can continue the intended workflow path, while the False path can be connected to an appropriate alternate or handling path.
The step provides exactly these two return values in its XML definition.
Handle an Instance That Cannot Be Removed as Expected
Connect the alternate return path to a suitable handling activity.
Example:
Remove Single WF Instance
→ True: Continue Process
→ False: Handle Removal Result
This gives the workflow a defined path for the non-True result, rather than leaving it unhandled.
Use the Step as Part of Workflow Maintenance
The step can be incorporated into workflow maintenance or lifecycle processes where a workflow needs to remove a particular process instance.
Example:
Identify Obsolete Instance → Remove Single WF Instance → Record/Continue
The exact criteria for determining an obsolete instance should be implemented by the surrounding workflow logic.
Remove One Instance Rather Than Applying a Broad Operation
The step is explicitly defined to remove a process instance based on ID, and its display name is “Remove Single WF Instance.”
Example:
Find Target Instance → Remove Single WF Instance
This makes the step appropriate when the workflow has a specific instance ID to act upon.
Example:
Let’s build and execute the “removeWorkflowInstanceDef” example.
- Create a new definition called “removeWorkflowInstanceDef” and open the definition in designer mode.
- Drag a “removeWorkflowInstance” step to the canvas.
- Connect the dots between the “Start” and “removeWorkflowInstance” steps, as shown above.
- Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate”. Depending on the step’s purpose, additional configuration options are available.
- Navigate to the Process - Instance page. Select any process instance and take note of the instance ID.

- Click the "removeWorkflowInstance" step to configure its "Required" properties. Provide the step name and the workflow instance ID to be removed at runtime. Then click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

- Save the process definition, create a new instance, and execute it. Render the process instance and click the process step to view its properties. When the workflow reaches the Remove Single WF Instance step, FlowWright uses the supplied
instanceIDto identify the process instance targeted by the step. The step is defined specifically to “Remove process instance, based on ID.” The workflow can then follow the True-or-False return path defined for the step. Navigate to the Process—Instance page and search for the workflow instance ID to confirm it has been removed.

Tips:
- Verify that the
instanceIDcontains the intended process instance ID before the step executes. - Use a meaningful Variable or Global variable name when storing the target instance ID.
- Prefer dynamically supplied instance IDs when the target instance is determined during workflow execution.
- Test the workflow with a representative process instance before deploying it.
- Verify that the workflow is targeting the intended instance before enabling automated removal.
- Avoid hard-coding instance IDs when the target instance can change between workflow executions or environments.
- Make sure preceding workflow activities correctly identify the target instance.
- Consider connecting the True and False return paths to appropriate subsequent activities.
- Provide appropriate handling for a False result.
- Use Logging to document why the removal operation was performed when this information is important for workflow administration.
- Test the workflow when the supplied instance ID is missing or invalid.
- Test scenarios where the target instance is no longer available when the step executes.
- Be particularly careful when using dynamically generated instance IDs, as an incorrect ID could cause the operation to target an unintended workflow instance.
- Do not assume additional behavior, such as the cascading removal of related instances or records, unless confirmed by the FlowWright implementation.
- Do not assume that the False return path represents a particular error condition unless confirmed by the FlowWright implementation.
- Review workflows that use this step when instance lifecycle or retention requirements change.
Notes:
- The Remove Single WF Instance step is defined in the Engine category with the internal name
removeworkflowinstance, label “Remove process instance, based on ID”, namespaceFlowWright.Workflow.RemoveWorkflowInstance, and display name “Remove Single WF Instance.” - The step is implemented by
FlowWright.Workflow.RemoveWorkflowInstanceinFlowWright.Workflow.dlland is defined as a Process step with 2 incoming connections and 2 outgoing connections. - The step defines one required property:
-
instanceID– ID of the instance.
-
- The
instanceIDproperty uses the string data type, implemented byFlowWright.DataTypes.ClsTextBoxinFlowWright.DataTypes.dll. - The step provides two return values:
- False
- True
Definition Sample:
You may download a sample definition for the Remove Single WF Instance step and later import it into your FlowWright Process Definition XML page.
Note: Verify and complete any missing configuration after importing the sample, including:
- Instance ID.
- Variable or Global variable references.
- Workflow Variable references.
- Environment-specific settings.
- Target process instance.
- Downstream True and False workflow paths.
- Logging configuration.
After verifying the configuration, save the Process Definition before execution.