# Advanced patterns

> Implement advanced BPMN patterns in Maestro Orchestrate, including asynchronous request-reply flows with event-based gateways, SLA windows, and timeout paths.

## Request and wait handshake

![A send task followed by an event‑based wait for payment or a deadline.](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-a-send-task-followed-by-an-event-based-wait-for-payment-or-a-deadline-620715-117d33b6.webp)

### Use when

* You send an asynchronous request and wait for a reply or a timeout.
* You need an SLA window and a clean outcome on either path.

### Pattern in simple words

1. Start.
2. Send task: Send payment request.
3. Event‑based gateway: wait for one of the following.
   * Message event: Payment received. End Paid.
   * Timer event: Fourteen days elapsed. Service task Close unpaid. End Closed unpaid.

## Result

The process routes to one of two outcomes depending on which event occurs first: the paid path if a payment message is received, or the closed-unpaid path if the fourteen-day timer elapses.

:::note
This pattern cleanly models asynchronous communication with an SLA.
:::

### Other scenarios

* Finance: Invoice payment versus due‑date closure.
* Insurance: Claim evidence versus expiry.
* Retail: Supplier confirmation versus alternate sourcing.
* Public sector: Response received versus auto‑close.
* Manufacturing: Order acknowledgment versus cancel.

## Wait for a specific message with a deadline

  ![A receive task that either proceeds on message or escalates on timer.](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-a-receive-task-that-either-proceeds-on-message-or-escalates-on-timer-620719-ea57376c.webp)

### Use when

* A precise message is expected before continuing.
* A deadline must trigger escalation if the message does not arrive.

### Pattern in simple words

1. Start.
2. Receive task: Await specialist report, with an interrupting boundary timer set to five days.
3. On timer: User task Escalate. End Escalated.
4. Normal path: Receive report. User task Review report. End Reviewed.

## Result

The process completes on one of two paths: the reviewed path if the specialist report arrives within five days, or the escalated path if the boundary timer fires before the message is received.

   :::note
   The timer defines the SLA and triggers escalation.
   :::

   **Other scenarios**

* Finance: Await audit response versus escalation.
* Healthcare: Await patient records versus escalation.
* Retail: Await vendor confirmation versus procurement escalation.
* Manufacturing: Await QA test results versus manager escalation.
* Public sector: Await citizen reply versus auto‑close.
