> ## 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.

# Configure the workflow stages

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

Both the single-document and the multi-document scenarios need their workflow stages configured. Each stage uses a **Utility** step to call an activity, and some stages also use a **Decision** step to check a condition.

## Open the process for a stage

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>

On the **Diagram** tab, delete the existing step, and then add the steps the stage needs.

<h2 id="2">
  The Utility step
</h2>

The **Utility** step calls the activity for the stage.

<Steps>
  <Step title="Add the step">
    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>
  </Step>

  <Step title="Select the rule type">
    Open the activity window and choose an **Activity** rule type.
  </Step>

  <Step title="Specify the activity">
    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, create it by clicking the configuration button on the left. If the activity already exists, that button opens it.

    <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>
  </Step>
</Steps>

For more information, see [Create a set of activities in Pega](/flexi-capture/connectors/pega/pega-activities-set-create).

<h2 id="3">
  The Decision step
</h2>

The **Decision** step branches the process on a condition.

<Steps>
  <Step title="Add the step">
    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>
  </Step>

  <Step title="Select the expression type">
    Double-click the step and select **Boolean Expression** in the **Type** field.
  </Step>

  <Step title="Build the expression">
    Click the configuration button to the left of the **Expression** field, and then specify the required expression in the **Expression builder** window.

    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>
  </Step>

  <Step title="Apply the changes">
    Click **Submit**. The **Decision** step then has two branches, `true` and `false`.
  </Step>
</Steps>
