Remove Process Instances

Use this step to remove all process instances older than a certain time duration.

Last published at: March 30th, 2026

removeInstances Step

Description:

The Remove Process Instances workflow step removes old process instances according to the configured Older than value and Expire type.

The step supports:

  • Specifying an age or date-related value for identifying old process instances.
  • Selecting an expiration type.
  • Removing process instances that meet the configured criteria.
  • Using workflow values for the age-related configuration.
  • Performing process-instance cleanup as part of workflow automation.
  • Routing subsequent workflow processing through True or False return paths.

 

Inputs

  • olderThan — The olderThan property specifies the value used to identify process instances that are older than the configured threshold.
  • expireType — The expireType property specifies the expiration type to use when determining which process instances to remove.
 

 

Returns

  • True – The True return path can be connected to the next workflow activity when the operation produces the expected result.
  • False – The False return path can be used for an alternative workflow path or appropriate handling when the expected result is not produced.
 

 

Usage:

The Remove Process Instances step is typically used when a workflow needs to clean up older process instances.

The workflow provides an Older-than value and selects an Expire type. FlowWright then uses these configured properties to determine the process instances that meet the removal criteria.

A typical workflow pattern is:

Determine Retention Criteria → Remove Process Instances → Continue Process

The step can be useful for workflow maintenance scenarios where older process instances need to be removed according to an established age or expiration policy.

Because this step can operate on multiple old process instances, the criteria should be carefully configured and tested before use in a production workflow.

 

Typical Workflow Suggestions:

Remove Old Process Instances

Use the step when older process instances need to be removed as part of workflow maintenance.

Example:

Maintenance Trigger → Remove Process Instances → Complete

Configure Older than and Expire type according to the required process-instance retention criteria.

 

Perform Workflow Cleanup

Use the step as part of a scheduled or administrative workflow that performs cleanup activities.

Example:

Start → Remove Process Instances → Log Result → Complete

This provides a simple workflow pattern for performing process-instance cleanup.

 

Apply an Age-Based Retention Policy

Use the Older than property to define the age-related criterion for identifying process instances that are candidates for removal.

Example:

Maintenance Process → Remove Process Instances

The olderThan property is explicitly defined as a required string input.

Use a value appropriate to the retention policy configured for the workflow environment.

 

Select the Appropriate Expire Type

Use the Expire type property to specify how the expiration criterion should be interpreted.

Example:

Determine Cleanup Criteria → Remove Process Instances

The expireType property uses the TaskExpireType data type.

The XML does not document the individual TaskExpireType options, so select the appropriate value from those exposed by the FlowWright configuration interface.

 

Use Dynamic Cleanup Criteria

Use workflow-generated values when the Older than criterion needs to be determined dynamically.

Example:

Get Retention Setting → Remove Process Instances → Continue

The workflow can determine the appropriate value and supply it to the olderThan property.

 

Perform Cleanup After a Business Process

A workflow can perform process-instance cleanup after completing another administrative or business operation.

Example:

Complete Business Processing → Remove Process Instances → Finalize

This can be useful when cleanup is a stage of a larger workflow management process.

 

Create a Dedicated Maintenance Workflow

Use the step in a process definition dedicated to workflow maintenance.

Example:

Start Maintenance → Remove Process Instances → Record Result → End

This keeps cleanup logic separate from business-processing workflows and makes the purpose of the process definition clear.

 

Route Processing After the Cleanup Operation

Use the True and False return paths to control what happens after the step executes.

Example:

Remove Process Instances

True: Continue Cleanup Process

False: Handle Result

The step provides both True and False return values.

 

Handle a False Result

Connect the False return path to an appropriate workflow activity when the expected result is not obtained.

Example:

Remove Process Instances → False → Handle Cleanup Result

This gives the workflow an explicit path for the non-True result.

 

Combine Cleanup With Administrative Processing

Use the step together with other maintenance activities.

Example:

Identify Maintenance Requirements → Remove Process Instances → Perform Additional Maintenance → Complete

This allows process-instance cleanup to become one stage of a broader administrative workflow.

 

Keep Retention Criteria Consistent

Use a consistent Older-than and Expire-type configuration when multiple workflows perform similar cleanup operations.

Example:

Determine Standard Retention Criteria → Remove Process Instances

This makes cleanup behavior easier to understand and maintain.

 

Example:

Let’s build and execute the “removeInstancesDef” example.          

  • Create a new definition called “removeInstancesDef” and open it in Designer mode.
  • Drag the “removeInstances” step to the canvas.
  • Connect the dots between the “Start” and “removeInstances” 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 values are available for configuration.
  • Click the “removeInstances” step to configure its “Required” properties. Provide a name for the step. Enter the time duration and select the Expire type from the drop-down list. Click the Save button. Note: Click the "AI Predict" button to have Copilot 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 Process Instances step, FlowWright uses the configured Older than and Expire type properties to determine which process instances the operation targets. The XML identifies the step as “Remove old process instances, based on dates.” The workflow can then follow the True-or-False return path defined for the step. Navigate to the Process—Instances page to verify that the table is sorted by date. 

 

Tips:

  • Configure "Older than" carefully, as the step is intended to remove old process instances.
  • Select the appropriate Expire type for the intended cleanup criteria.
  • Test the configured criteria with representative workflow data before deploying the cleanup process.
  • Verify that the retention requirement is understood before enabling automated removal.
  • Use meaningful workflow step names that describe the purpose of the cleanup operation.
  • Keep the cleanup criteria consistent with the organization's process-instance retention requirements.
  • Consider using a dedicated maintenance workflow for process-instance cleanup.
  • Use workflow-generated values for Older than when the retention criterion needs to be determined dynamically.
  • Verify dynamically generated values before supplying them to the step.
  • Consider connecting both the True and False return paths to appropriate subsequent activities.
  • Provide appropriate handling for a False result.
  • Use Logging to document cleanup activity when the operation needs to be traceable.
  • Test the workflow with different age-related values before deployment.
  • Test the workflow with each relevant Expire type exposed by the FlowWright environment.
  • Be particularly careful when changing retention criteria because a broader criterion may identify more process instances for removal.
  • Review the cleanup workflow whenever process-instance retention requirements change.
  • Avoid assuming that related forms, documents, tasks, Variables, or other records are removed unless this behavior is confirmed by the FlowWright implementation.
  • Do not assume that False represents a particular error condition unless confirmed by the FlowWright implementation.
  • Do not assume the specific semantics or available choices of TaskExpireType from the XML alone; verify them in the FlowWright designer.
  • Keep cleanup workflows separate from critical business-processing logic where this improves operational safety and maintainability.

 

Notes:

  • The Remove Process Instances step is defined in the Engine category with the internal name removeinstances, label “Remove old process instances, based on dates”, namespace FlowWright.Workflow.RemoveInstances, and display name “Remove Process Instances.”
  • The step is implemented by FlowWright.Workflow.RemoveInstances in FlowWright.Workflow.dll and is defined as a Process step with 2 incoming connections and 2 outgoing connections.
  • The step defines two required properties:
    • olderThan – Older than.
    • expireType – Expire type. 
  • The olderThan property uses the string data type, implemented by FlowWright.DataTypes.ClsTextBox in FlowWright.DataTypes.dll.
  • The expireType property uses the TaskExpireType data type, implemented by FlowWright.DataTypes.TaskExpireType in FlowWright.DataTypes.dll.
  • The step provides two return values:
    • False
    • True

 

Definition Sample:

You may provide a sample definition for the Remove Process Instances step for download and later import it into the FlowWright Process Definition XML page.

Note: Verify and complete any missing configuration after importing the sample, including:

  • Older than value.
  • Expire type.
  • Workflow Variable references.
  • Environment-specific settings.
  • Process-instance retention requirements.
  • Downstream True and False workflow paths.
  • Logging configuration.

After verifying the configuration, save the Process Definition before execution.

Click here to download the sample file.