removeFormInstance Step
Description:
The Remove Form Instance workflow step removes a selected form instance and its associated data during workflow execution.
The step supports:
- Selecting the form instance to remove.
- Using a Variable, Global, or FormVariable that contains the form instance ID.
- Dynamically identifying the form instance to be removed.
- Removing a form instance during workflow processing.
- Performing form-instance cleanup within a workflow.
- Returning a True or False result for subsequent workflow processing.
Inputs
-
Variable/Global/FormVariable that holds the Form ID – The
formIDproperty specifies the Variable, Global, or FormVariable that contains the ID of the form instance to 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 appropriate handling when the expected result is not produced.
Usage:
The Remove Form Instance step is typically placed after a workflow has identified a form instance that is no longer required.
The form instance ID is supplied through a Variable, Global, or FormVariable. The step then uses that value to identify the form instance to be removed.
A typical workflow pattern is:
Identify Form Instance → Remove Form Instance → Continue Process
The step can be used when a workflow needs to remove form data as part of its processing or cleanup logic.
The XML describes the operation as “Remove form instance and its data.” Therefore, workflows that use this step should be designed with care, as the operation is intended to remove the form instance and its data, rather than simply changing or hiding it.

Typical Workflow Suggestions:
Remove an Unneeded Form Instance
Use the step when workflow processing determines that a form instance is no longer required.
Example:
Identify Form Instance → Remove Form Instance → Continue Process
The workflow supplies the form instance ID to the Remove Form Instance step.
Clean Up a Form Instance After Processing
Use the step as a cleanup operation after the workflow has finished using a form instance.
Example:
Process Form → Complete Processing → Remove Form Instance
This can be useful when a form instance is only needed temporarily during a workflow.
Remove a Form Instance Based on a Workflow Condition
Use a decision or evaluation step to determine whether the form instance should be removed.
Example:
Evaluate Condition → Remove Form Instance → Continue Process
This allows the workflow to apply business logic before performing the removal operation.
Use a FormVariable to Identify the Form Instance
The formID property accepts a selectFormVariable value, allowing the target form instance to be supplied through a Variable, Global, or FormVariable.
Example:
Get Form Instance → Remove Form Instance → Continue
This allows the same workflow definition to operate on different form instances.
Remove a Dynamically Identified Form Instance
Use preceding workflow activities to determine which form instance should be removed.
Example:
Retrieve Form Information → Determine Target Form → Remove Form Instance
The resulting form instance ID can then be supplied to the formID property.
Perform Form Data Cleanup
Use the step when removing the form instance and its data is part of the workflow's cleanup process.
Example:
Complete Request → Remove Form Instance → Finalize Process
The step's XML label explicitly identifies its operation as removing the form instance and its data.
Remove Temporary Form Instances
Use the step for workflows that create or use form instances temporarily and no longer require them after processing.
Example:
Create Form → Process Data → Remove Form Instance → Complete
This can help incorporate form-instance cleanup into the overall workflow.
Route Processing After Form Removal
Use the True and False return paths to control subsequent workflow processing.
Example:
Remove Form Instance
→ True: Continue Process
→ False: Handle Removal 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 removal result is not obtained.
Example:
Remove Form Instance → False → Handle Removal Result
This gives the workflow an explicit path for the non-True result.
Remove a Form Instance After a Business Transaction
Use the step after the workflow has completed processing for the associated form instance.
Example:
Process Request → Complete Transaction → Remove Form Instance → Continue
This can be useful when the form instance is no longer required after the business process has completed.
Use the Step in Form Lifecycle Workflows
Use the step as one stage in a workflow that manages the lifecycle of form instances.
Example:
Create Form → Populate Form → Process Form → Complete → Remove Form Instance
The exact point at which removal should occur depends on the requirements of the workflow.
Example:
Let’s build and execute the “removeFormInstanceDef” example.
- Create a new process definition called “removeFormInstanceDef” and open it in Designer mode.
- Drag the steps above onto the canvas.
- Connect the dots between the “Start” and the above steps, as shown above.
- Select the line between the steps to configure the “Connection Properties”. The default property values are “None, Closed, Completed, Rejected, Timeout, Error, and Evaluate”. Depending on the step’s purpose, additional values are available for configuration.
- Define a variable or a global to store the FormInstanceID.
- Click the “routeForm” step to configure its “Required” properties. Provide a name for the step. Select the Form Definition from the drop-down list. Provide a variable or a global reference to store the FormInstanceID. Click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- You may also configure a form variable to hold the FormInstanceID. To do so, select the Actions—Manage Form Variables menu option.

- Provide a Form variable name. Select the Form definition from the drop-down list.

- Click the Add button to include the form variable in the workflow. A notification appears in the top-right corner, as shown below. You may now use the Form variable reference to store the FormInstanceID in the “routeForm” step.

- Click the “Wait” step to configure its “Required” properties. Provide a name for the step. Enter the wait time and select the Wait type from the drop-down list. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the “removeFormInstance” step to configure its “Required” properties. Provide a name for the step and the variable or global reference that holds the FormInstanceID value. 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 Form Instance step, FlowWright uses the configured
formIDvalue to identify the target form instance. The step is defined to “Remove form instance and its data.” The workflow can then follow the True-or-False return path defined for the step. The Form task is assigned to the user. You must “Reject” the Form task to continue.

- Render the process instance. Click the process step to view its properties. The step should remove the Form Instance.

Tips:
- Verify that the step
formIDidentifies the intended form instance before the step executes. - Use a meaningful Variable, Global, or FormVariable reference for the target form instance.
- Use dynamically supplied form instance IDs when the target form is determined during workflow execution.
- Test the workflow with representative form instances before deploying it.
- Verify that preceding workflow activities correctly identify the target form instance.
- Avoid hard-coding form instance identifiers when the target form can change between workflow instances.
- Be careful when placing this step near the end of a workflow because the operation is defined to remove the form instance and its data.
- Make sure downstream workflow activities do not depend on the removed form instance unless they are designed to execute before the removal.
- Consider connecting both the True and False return paths to appropriate subsequent workflow activities.
- Provide appropriate handling for a False result.
- Use Logging to document form-instance removal when the operation needs to be traceable.
- Test the workflow when the supplied form instance ID is missing or invalid.
- Test scenarios where the target form instance is unavailable when the step executes.
- Verify the form instance and its data before executing the workflow in a production environment.
- Review the workflow carefully before enabling automated removal.
- Use meaningful workflow step names that describe why the form instance is being removed.
- Keep form cleanup logic separate from business processing when doing so makes the workflow easier to understand and maintain.
- Do not assume that the step removes other workflow objects, documents, process instances, or unrelated records unless confirmed by the FlowWright implementation.
- Do not assume that the False return value represents a particular error condition unless confirmed by the FlowWright implementation.
- If the same form instance is referenced by multiple workflow activities, verify the execution order before placing the removal step.
- Consider the impact of removing form data before connecting the step to downstream activities.
Notes:
- The Remove Form Instance step is defined in the Forms category with the internal name
removeforminstance, label “Remove form instance and its data,” namespaceFlowWright.Workflow.RemoveFormInstance, and display name “Remove Form Instance.” - The step is implemented by
FlowWright.Workflow.RemoveFormInstanceinFlowWright.Workflow.dlland is defined as a Process step with 2 incoming connections and 2 outgoing connections. - The step defines one required property:
-
formID– Variable/Global/FormVariable that holds the Form ID.
-
- The
formIDproperty uses the selectFormVariable data type. This data type is described in the XML as “Variable/Global/FormVariable that holds the form instance ID.” - The
selectFormVariabledata type is implemented byFlowWright.DataTypes.SelectFormVariableinFlowWright.DataTypes.dll. - The step provides two return values:
- False
- True
Definition Sample:
You may provide a sample definition for the Remove Form Instance 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:
- Form instance ID.
- Variable, Global, or FormVariable reference.
- Workflow Variable references.
- Target form instance.
- Environment-specific settings.
- Downstream True and False workflow paths.
- Logging configuration.
- Any downstream activities that might depend on the form instance.
After verifying the configuration, save the Process Definition before execution.