persistProcessInstance Step

Use this step to persist the process instance to the database

Last published at: August 5th, 2025

Description:

This step in the workflow persists the process instance to the database. By design, the process instance persists automatically to the database when the instance status is Sleeping, Error, ErrorWait, Aborted, and Completed. This step allows the process instance to persist to the database on demand.

 

Inputs

  • None
 

 

Returns

  • None
 

 

 

Usage:

 

 

 

Example:

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

  • Create a new definition called “persistProcessInstanceDef” and open the definition in designer mode. 
  • Drag the “UpdateVariables,” “subWorkflow,”  “persistProcessInstance,” “executeSQL,”  and “getXMLValue” steps to the canvas. 
  • Connect the dots between the “Start” and other steps, as shown above 
  • Define a variable or a global to store the result. 
  • Click the “UpdateVariables” step to configure its “Required” properties. Provide a name for the step. 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 “UpdateVariables” step to configure its “Optional” properties. Click the button to configure the multiple variables. A pop-up window is displayed for configuration. Click the Add Row button to insert an empty row. Provide the variable name and value. Click the save button. You may add multiple variables using the Add Row button. 

 

  • Click the “sub-workflow” step to configure its “Required” properties. Provide a name for the step. Select the process definition 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 “sub-workflow” step to configure its “Optional” properties. Select “Yes” to pass variables from parent to child Instance. Select “Yes” to pass variables from the child to the process instance. You can configure this setting to pass globals between parent and child instances. Click the Save button. 

 

  • Click the button to configure the parent-to-child variable mappings as shown below. Click the Add Row button to insert empty rows. Provide the mapping between sub-process variables and parent process variables or values. Click the Save button. You may insert multiple variable mappings using the Add Row button. 

 

  • Click the button to configure the child-to-parent variable mappings as below.  Click the Add Row button to insert empty rows. Provide the mapping between sub-process variables and parent process variables or values. Click the Save button. You may insert multiple variable mappings using the Add Row button. 

 

  • Click the “persistProcessInstance” step to configure its “Required” properties. Provide a name for the step. 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 “executeSQL” step to configure its “Required” properties. Provide a name to the step. Select the connection string from the drop-down list. Provide the SQL statement. Select the result format as XML or JSON. 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 “executeSQL” step to configure its “Optional” properties. Provide the name of the other database, if it is not the default. Provide the variable or global reference to store the value. Select “Yes” to get a single SQL result set. Provide the command time-out value in seconds. Click the button to configure multiple SQL parameters and values. Click the Save button. 

 

  • Click the “getXMLNode” step to configure its “Required” properties. Provide the XPath expression to query the collection. Provide the variable or global reference to store the XML result. Provide the node reference row from which to get the value. Provide a variable or a global to store the collection index. Provide the variable or global reference to hold the XML 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” setting configuration is necessary for documentation and also measures the workflow progress and the 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 then execute it. This “persistProcessInstance” step persists the current instance to the database as configured. 
  • In this example, the process instance values from the Start step till the “persistProcessInstance” step are recorded to the database. This step enables completion when the current instance is still not finished. On the process instance page, select the current process instance and navigate to the View—History menu option. The instance history, including the persistence to the database event, is displayed in a table on a new page.  

 

Definition Sample:

You may download the sample definition(s) from the link here and later import them (drag-and-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

Note: Please verify and complete the process steps for any missing configurations, such as file path references and database connections, after import. Then, save the definition to confirm the changes.

Click here to download the sample file.