setWFState Step

Use this feature to set the state of a workflow process instance while the instance is executing.

Last published at: August 31st, 2026

Description:

This step is used to set the workflow states during instance execution. For example, a business proposal life cycle includes the following stages: Pre-proposal, RFP/Opportunity, Pre-writing, Submission, Award, Progress Management, and Follow Up. We can configure the workflow with the appropriate life cycle stages using this process step. The current stage of business proposals (at runtime) can be easily identified during process instance review. 

The Set Process State workflow step sets the process instance state while the workflow is executing.

The step accepts a single required State of the instance value. The state is supplied as a string, allowing the workflow to determine the process state that should be assigned.

The step supports:

  • Setting the state of a process instance.
  • Providing the desired process state as a string.
  • Dynamically supplying the state value from workflow data.
  • Updating process state during workflow execution.
  • Returning a success or failure result.

This step can be used for:

  • Updating workflow instance status.
  • Indicating progress through a business process.
  • Setting a meaningful state after a major workflow activity.
  • Representing business-specific processing stages.
  • Updating state before or after an approval or review.
  • Supporting workflow monitoring and reporting.
  • Communicating the current state of a long-running process.
  • Controlling the state information associated with a workflow instance.

 

Inputs

  • State of the Instance - Specifies the state that should be assigned to the executing process instance.
 

 

Returns

  • True – The True return path represents successful execution of the process-state update.
  • False – The False return path represents an unsuccessful execution.
 

 

Usage:

The Set Process State step is typically placed at a point in a workflow where the process instance needs to reflect a new state.

For example, a workflow can update its state after completing an important business activity:

Start → Process Request → Set Process State → Continue

The state value can be determined from workflow data and supplied to the step through the State of the instance property.

The step can therefore be useful when the workflow needs to expose a meaningful current state while the process instance continues through additional activities.

Typical uses include:

  • Updating the state after a request is received.
  • Indicating that a request is being processed.
  • Marking a process as being under review.
  • Indicating that an approval stage has been reached.
  • Updating state after an external system interaction.
  • Marking a workflow as ready for a subsequent stage.
  • Providing meaningful state information for monitoring and reporting.

 

Typical Workflow Suggestions:

Indicate Processing Status

Use Set Process State after a request enters the processing stage.

Example:

Receive Request → Set Process State → Process Request → Complete

The state could be:

Processing

This allows the workflow instance to reflect its current processing stage.

 

Set an Approval State

Update the process state when a workflow reaches an approval or review stage.

Example:

Validate Request → Set Process State → Approval Task → Continue

The state could be:

Under Review

 

Update State After Data Validation

Set the process state after required data has been successfully validated.

Example:

Receive Data → Validate Data → Set Process State → Process Data

A state such as:

Validated

could indicate that the validation stage has been completed.

 

Update State Before an External Operation

Use the step before an external system interaction to indicate what the workflow is currently doing.

Example:

Prepare Request → Set Process State → Send Request → Process Response

A state such as:

Waiting for External Response

could communicate the current processing stage if that is an appropriate state value in the target environment.

 

Update State After an External Operation

The step can also be used after an external interaction.

Example:

Send Request → Process Response → Set Process State → Continue

This can provide a state indicating that the external operation has completed.

 

Business Process Stages

Use Set Process State at significant stages of a long-running business workflow.

Example:

Receive → Validate → Review → Approve → Fulfill → Complete

Set Process State can be inserted at appropriate points to update the instance state as it moves through the process.

For example:

Receive → Set State: Received → Validate

Review → Set State: Under Review → Approve

Fulfill → Set State: Fulfillment → Complete

The exact state values are not defined in the XML and should be selected according to the workflow's requirements.

 

Dynamic Process States

Use a workflow Variable or another dynamically supplied value when the state needs to be determined at runtime.

Example:

Evaluate Request → Determine State → Set Process State → Continue

Because the state property uses the string data type, a string value can be supplied to the step.

 

State-Based Monitoring

Set the process state at meaningful points so that workflow monitoring and reporting can reflect the current processing stage.

Example:

Start → Set State → Process → Set State → Approval → Set State → Complete

Use state values that are meaningful to the users and systems consuming the process-state information.

 

Exception or Recovery State

Use the step as part of a recovery path to indicate that a workflow has entered a particular processing condition.

Example:

Processing Error → Set Process State → Recovery Processing

The XML does not define specific exception-state values, so the state terminology should be established as part of the workflow design.

 

Success and Failure Handling

Use the two return paths to separate successful state updates from unsuccessful execution.

Example:

Set Process State → True → Continue Processing

↳ False → Log Failure / Retry / Notify Administrator

The step explicitly provides True and False return values.

 

Example:

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

  • Create a new definition called “setWFStateDef” and open the definition in designer mode. 
  • Drag a “setWFState” step to the canvas. 
  • Connect the dots between the “Start” and “setWFState” 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 "setWFState" step to configure its "Required" properties. Provide a name for the step and describe the process instance state. Click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

  • Click the "routeForm" step to configure its "Required" properties. Provide a name for the step and the task. Select the Form Definition from the drop-down list. Provide a variable or global reference to store the form instance ID. Click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

  • Click the "routeForm" step to configure its "Optional" properties. Click the button to specify the users who will route the Form. A pop-up window appears for configuration. Search for and select the user, then click the Save button. In this example, the “variable.initiatorID” system variable routes the Form to the user who initiated the new process instance. 

 

  • The “Logging” configuration is necessary for documentation and for measuring workflow progress and percent complete. This is done 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. The instance should be updated with the latest executed state step value. When the workflow reaches the Set Process State step, the configured state value is used to set the state of the executing process instance. The step's XML description explicitly identifies its purpose as setting process states while the instance is executing. The workflow then follows the True or False return path based on the operation's result.
  • In the following example, the setWFState step captures the user's feedback submitted through a process workflow. The “State” process indicates the process flow at runtime.  

 

  • The workflow below shows the process that repeats when the user's feedback rating is < 8.  

 

  • The workflow is complete for the user's feedback rating of >= 8. 

 

Tips:

  • Configure the required State of the instance property before executing the workflow.
  • Use clear and meaningful state values that accurately describe the process stage.
  • Keep state naming consistent across related workflows.
  • Use dynamically supplied values when the appropriate state depends on workflow data.
  • Place the step at meaningful process boundaries rather than unnecessarily changing state after every activity.
  • Consider updating the state before a significant long-running operation, so the current activity is visible.
  • Consider updating the state after a significant operation to indicate that the stage has completed.
  • Test the state values with representative workflow instances before deploying the process.
  • Test both the True and False return paths.
  • Use the False path for appropriate error handling or notification.
  • Avoid assuming that arbitrary state values are valid unless they have been tested in the target FlowWright environment.
  • Establish a consistent state vocabulary across workflows that use process states for monitoring or reporting.
  • Use Variables or other workflow data when the state must be determined dynamically.
  • Ensure that state changes do not make the workflow appear to be in a misleading processing stage.
  • Consider the effect of state updates on any monitoring, reporting, or downstream processes that consume process-state information.

 

Notes:

  • The Set Process State step is defined in the Engine category with the internal name setwfstate, label “Sets the process states while executing the instance”, and display name “Set Process State.”
  • The step is implemented by FlowWright.Workflow.Setwfstate in FlowWright.Workflow.dll and is a Process step with 2 incoming connections and 2 outgoing connections.
  • The XML defines one configurable property, State of the instance, which is required.
  • The property is internally named state and uses the string data type.
  • The string data type is implemented by FlowWright.DataTypes.ClsTextBox in FlowWright.DataTypes.dll.
  • The step provides two predefined return values: False and True.

 

Definition Sample:

You may download the sample definition(s) from the link provided and later import them into your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

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

  • State of the instance
  • Variable mappings, if the state is dynamically supplied
  • Environment-specific workflow settings
  • Downstream True and False workflow paths

Verify that the selected state value is appropriate for the target FlowWright environment.

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

Click here to download the sample file.

Click here to download the loop sample file.