# What is the difference between when and fork in flow?

**URL:** <https://forums.pega.com/t/what-is-the-difference-between-when-and-fork-in-flow/8496>\
**Category:** General\
**Tags:** case-management\
**Created:** [October 22, 2024, 12:51pm UTC](https://forums.pega.com/t/what-is-the-difference-between-when-and-fork-in-flow/8496 "2024-10-22T12:51:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satya\_K](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Satya\_K](https://forums.pega.com/u/Satya_K)\
**Post date:** [October 22, 2024, 12:51pm UTC](https://forums.pega.com/t/what-is-the-difference-between-when-and-fork-in-flow/8496/1 "2024-10-22T12:51:03Z")

</div>

What is the difference between when and fork in flow and when we use them in an application?

---

<div class="post-metadata">

**Author:** ![SohamM95](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sohamm95/32/4726_2.png) [@SohamM95](https://forums.pega.com/u/SohamM95)\
**Post date:** [October 22, 2024, 1:34pm UTC](https://forums.pega.com/t/what-is-the-difference-between-when-and-fork-in-flow/8496/2 "2024-10-22T13:34:45Z")

</div>

@Satya K

Fork is a type in decision shape in a flow. From a fork decision, the process can goto any of the two or more connectors its attched with. To decide which fork connector to select, when rules are used in the connectors. If the when of a connector returns true then the process follows that connector.

Eg: On a screen the user selects a radio button with options Yes/No. After the assignment is completed there will be a decision shape of type fork with two output connectors. On any one of them, a when rule is defined which checks the value of the radio button property as ‘Yes’. If the user selects ‘Yes’, then the when returns true and the process follows this connector, else it follows the other connector.

---

<div class="post-metadata">

**Author:** ![Atmakuri\_Koti\_Raja](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/atmakuri_koti_raja/32/2442_2.png) [@Atmakuri\_Koti\_Raja](https://forums.pega.com/u/Atmakuri_Koti_Raja)\
**Post date:** [October 22, 2024, 1:47pm UTC](https://forums.pega.com/t/what-is-the-difference-between-when-and-fork-in-flow/8496/3 "2024-10-22T13:47:19Z")

</div>

Hi @Satya K,

### **When Rule**

A **When Rule** is used to evaluate a condition that returns either `true` or `false`. It allows you to conditionally execute parts of the flow, steps in a process, or even UI elements based on specific conditions.

**Use a When Rule** :

- When you need to conditionally evaluate something that might be used in multiple flows, UI elements, or actions.
- When you want to keep the conditional logic separate and reusable in different parts of the application.
- For visibility conditions, decision-making, or evaluating a single condition in a flow

### **Fork Shape**

The **Fork Shape** is a specific flow element in Pega that enables the flow to branch based on multiple conditions, which are often evaluated using **When Rules** or expressions.

**Use a Fork Shape** :

- When you need to evaluate multiple conditions and route to different flow steps based on those conditions.
- When the decision logic is specific to the flow and does not need to be reused elsewhere.
- For more complex branching scenarios with multiple outcomes in a single flow.

Thanks

Regards

Raja
