---
title: "Orders minions"
slug: "orders-minions"
abstract: "Describes the minions that the Order plugin contributes and the role they play in the order process."
---
# Orders minions

The Orders plugin contributes minions that play a key role in the overall [order process flow](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/orders-overview.html "Orders overview"), moving orders from the pending status to the next status until the order is completed.  

<details>
<summary><h2>Pending orders minions</h2></summary>

The pending orders process is managed using scaled minions. 

The `PendingOrdersMinionBoss` is a [scaled minion](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/commerce-engine-minions.html#UUID-40e69aa8-daa0-e67f-e33f-4c2fabbf023a_UUID-271ffdb2-0598-faee-10a5-55cd87d10f02) that watches the `PendingOrdersList`. It runs every 5 minutes and, using a round-robin algorithm, it distributes the items in its list to two *children*`PendingOrderMinions` for further processing.

There are two instances of the `PendingOrdersMinion`, defined as children of the `PendingOrderMinionBoss`: `PendingOrders.1` and `PendingOrders.2`. Each pending order *child* minion watches its own list of pending orders passed on by the parent minion (`PendingOrdersMinionBoss`).

The `PendingOrderMinion`runs the `IPendingOrdersMinionPipeline`. This pipeline checks if all the order's lines are available and then performs the following:

- Generates the corresponding sale activities.
- Processes payments as required.
- Moves the order to the `ReleasedOrders` list.
- Changes the order’s status to *Released*.

If one of the order's lines is not available, the `IPendingOrdersMinionPipeline` moves the pending order to the `WaitingForAvailabilityOrders` list. The order's status changes from *pending* to *WaitingForAvailability*.

If a problem or situation interrupts the [normal order process flow](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/orders-overview.html "Orders overview"), the order status is set to *Problem* and the order is added to the *Problem order list*.

</details>

<details>
<summary><h2>WaitingForAvailabilityOrdersMinion</h2></summary>

The `WaitingForAvailabilityOrdersMinion` watches the `WaitingForAvailabilityOrders` list and runs the `IWaitingForAvailabilityOrdersMinionPipeline` that performs availability checks on the line items included in the order.  Once items are in stock, the order is moved back to the `PendingOrderslist`. The order is put in the *Pending* status.

The `WaitingForAvailabilityOrdersMinion` runs every 5 minutes.

</details>

<details>
<summary><h2>ReleasedOrdersMinion</h2></summary>

The `ReleasedOrdersMinion` watches the `ReleasedOrdersList`. It calls the `IReleasedOrdersMinionPipeline` and checks if the order is ready to be completed.

If the release order is ready, it generates the order’s shipments or entitlements and moves the order to the `CompletedOrderList`. The order’s status changes to *Completed*.

In Sitecore XC 9.2, the `SettleSalesActivitiesMinion` and `iSettleSalesActivitiesPipeline` are deprecated, and the `ReleasedOrdersMinion` settles sales activities for federated payments. Sales activities for gift cards payments are still settled by the `PendingOrdersMinion`.

The `ReleasedOrdersMinion` attempts to settle the federated payments only once. If the payment provider (for example, Braintree) fails to settle, the sales activity and the order are marked as *Problem* and are moved to the Problem lists. Otherwise, the sales activity is marked as *Settled* and moved to the Settled list. The order is then marked as *Completed* and moved to the Completed list.

The `ReleasedOrdersMinion` runs every 5 minutes.

</details>

<details>
<summary><h2>RefundRmasMinion</h2></summary>

The `RefundRmasMinion` watches the `RefundPendingRmas` list.  It calls the `IRefundRmasMinionPipeline` that processes Refund Authorization Requests and refunds the orders payments for order with returned items.

The `RefundRmasMinion` runs every 5 minutes.

</details>