# Gateways and flow logic

> Gateways control how a process branches and merges during execution. Although gateways influence the flow, they do not perform any action by themselves. They evaluate conditions, synchronize branches, or create parallel paths. This section explains how to use gateways effectively in BPMN models, even when conditional logic is handled externally or execution support is partial.

Gateways control how a process branches and merges during execution. Although gateways influence the flow, they do not perform any action by themselves. They evaluate conditions, synchronize branches, or create parallel paths. This section explains how to use gateways effectively in BPMN models, even when conditional logic is handled externally or execution support is partial.

## Exclusive gateway

The exclusive gateway ![](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-image-586916-0fbae15c.webp) allows only one outgoing path to be followed, based on mutually exclusive conditions.

In Maestro, you can mark a path as the default using the `default` attribute on the `<exclusiveGateway>` element.

![exclusive gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-exclusive-gateway-570058-5a2644c4.webp)

**Modeling use case**: Routing based on status (e.g., approved, rejected, needs clarification).
* Use one outgoing flow per condition.
* Define a default path for cases where no conditions match.
  :::note
  Label each flow clearly. Avoid ambiguous conditions.
  :::

## Inclusive gateway

The inclusive gateway can activate one or more outgoing paths, depending on which conditions evaluate as true. It merges incoming paths only after all active branches complete.
  ![inclusive gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-inclusive-gateway-569290-14c8469f.webp)

**Modeling use case**: Optional parallel activities (e.g., notify customer and log request, if applicable)
1. Model a merge gateway to join paths.
2. Use with care—merging inclusive branches can create confusion if conditions overlap.

## Parallel gateway

The parallel gateway activates all outgoing paths simultaneously. When used to merge, it waits for all incoming paths to complete.
   ![parallel gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-parallel-gateway-569282-947f2a6c.webp)

**Modeling use case**: Executing independent tasks in parallel, such as sending confirmation and generating a report.
* No conditions are evaluated—flow is unconditional.
* Use for modeling concurrency or synchronization.
  :::warning
  Always use a parallel gateway to join branches that were split in parallel.
  :::

## Event-based gateway

The event-based gateway waits for one of several [events](https://docs.uipath.com/maestro/automation-suite/2.2510/user-guide/events) to occur. The first triggered event determines the path taken. This gateway must be followed immediately by catching intermediate events or receive tasks.
  ![event based gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-event-based-gateway-569299-b20c2677.webp)

**Modeling use case**: Waiting for a customer response or timeout.
* Only one outgoing path is followed.
* All other events become invalid once one is triggered.
  :::warning
  Event gateways represent uncertainty. Use only when the process must react to external input.
  :::

## Gateway merging

When paths branch out from a gateway, a **corresponding merge** is often required.

| Gateway type | Icon | Merge required? | Merge type |
| --- | --- | --- | --- |
| Exclusive | ![exclusive gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-exclusive-gateway-587165-3552845a.webp) | Optional | Exclusive |
| Inclusive | ![inclusive gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-inclusive-gateway-587173-8c8ff745.webp) | Required | Inclusive |
| Parallel | ![parallel gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-parallel-gateway-587182-f1eb8963.webp) | Required | Parallel |

:::warning
For clarity, always model merge points explicitly—even if only one path is expected to continue.
:::

## Modeling tips

* Always label gateway conditions for business readability.
* Avoid complex nested gateways when possible. Consider sub-processes for encapsulating logic.
* Default flows should be clearly defined to avoid ambiguous behavior.
* Do not mix gateway types during merge (e.g., merging parallel branches with an exclusive gateway).

For more details about the BPMN elements supported in Maestro, see [BPMN support](https://docs.uipath.com/maestro/automation-suite/2.2510/user-guide/bpmn-support).
