> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring workflow stages

> Configure Pega workflow stages with Utility and Decision steps that call FlexiCapture activities and branch on conditions during document processing.

When setting up scenarios for working with single or multiple documents, you will need to configure workflow stages.

To configure workflow stages, do the following:

1. Open your workflow and click **Configure process → Open process**. Alternatively, click **Records → Process → Flow** in **Dev Studio**.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega61.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=559b7bbaee84b99755a4b244ec5f134b" alt="Screenshot of the Pega case life cycle showing the Send for processing stage with the Open process option, alongside the resulting SendForProcessing_Flow diagram in Dev Studio." width="1457" height="428" data-path="images/flexi-capture/connectors/Pega61.png" />
   </Frame>

2. On the **Diagram** tab, delete the existing step and add a [Utility step](#2), which will call the necessary activity during the scenario. You will also need to add a [Decision step](#3) that will be used to check the conditions at some of the stages.

## <a id="2" />The Utility step

To set up an activity call:

1. Add a new *Utility* step to the process, specify a name for it, and connect it to the *Start* and *End* steps.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega65.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=5941a0cfdfbd4bac6513315fee0dd13a" alt="Diagram of a Pega process flow with a Send for processing Utility step connected between the Start and End steps." width="637" height="157" data-path="images/flexi-capture/connectors/Pega65.png" />
   </Frame>

2. Open the activity window and choose an **Activity** rule type.

3. In the **Rule** field, specify the name of the activity to be called. If the activity does not exist in the context of the case, it can be created by clicking the configuration button on the left. If the activity already exists, clicking the configuration button will open it. For more details about creating activities, see [Creating Pega activities](/flexi-capture/connectors/pega/pega-activities-set-create).

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega66.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=01be2ece0972553d9ac4f4edfd8135f9" alt="Screenshot of the Pega Utility properties dialog for the Send for processing step, with the Activity rule type selected and the SendForProcessing activity entered in the Rule field." width="679" height="529" data-path="images/flexi-capture/connectors/Pega66.png" />
</Frame>

## <a id="3" />The Decision step

To set up a branch:

1. Add a *Decision* step to the process and specify a name for it.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega67.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=f0ac04e8bf34502c6020efa6a3fae9bf" alt="Diagram of a Pega process flow with a Batch stage is processed Decision step branching into true and false paths." width="398" height="215" data-path="images/flexi-capture/connectors/Pega67.png" />
   </Frame>

2. Double-click the step and select **Boolean Expression** in the **Type** field.

3. Click the configuration button to the left of the **Expression** field. In the **Expression builder** window, specify the required expression. To see a full list of available functions and properties, click **Browse**. Click **Test** to test your expression.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega68.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=43726b3e171716928e8dc0016cbec07d" alt="Screenshot of the Pega Decision properties dialog with Boolean Expression selected as the Type, alongside the Expression builder window containing the BatchIsProcessed(.BatchId) expression." width="1338" height="502" data-path="images/flexi-capture/connectors/Pega68.png" />
   </Frame>

4. To apply the changes you have made, click **Submit**. The *Decision* step will now have two branches, *true* and *false*.
