Running Commerce Engine minions using Postman

Abstract

How to manually trigger a minion process to run using Postman.

You can use Postman samples to manually trigger a Commerce Engine minion to run. Some minions run on explicit requests. Others run as scheduled processes, like indexing or order processing minions, for example. There are some situations, when testing or troubleshooting, where you might want to manually trigger a minion process, and not wait for the scheduler to run the minion. The SitecoreCommerce_DevOps collection in Postman contains sample requests that enable you to manually trigger minion processes.

When you trigger a request to run a minion in Postman, ensure that you run the command from the instance of the Commerce Engine configured to run as the minions role, that is, by passing the minions environment value in the "environmentName" header. For example, in a default Commerce solution, the CommerceMinions_Sc service is the instance of the Commerce Engine dedicated for minions processing. It is configured to run as the HabitatMinions role, as shown in the following example from the config.json file:

    "AppSettings":  {
                        "SiteTitle":  "CommerceMinions_Sc",
                        "BootStrapFile":  "Global",
                        "DeploymentId":  "Deployment01",
                        "EnvironmentName":  "HabitatMinions",
                       

Warning

Avoid triggering a minion from a different Commerce Engine service than the instance dedicated to run as the minions role.

If you run a minion request, for example, from the Commerce Engine running as the Authoring service ( CommerceAuthoring_Sc), during execution of the request, the Authoring role starts behaving as a second minion processing role, resulting in concurrency errors. In a Commerce deployment, there can only be one instance of the Commerce Engine dedicated to run minions processing.

If, for some reason, you execute a Postman request to run a minion from a Commerce Engine service that is not configured as the minions role, stop and restart that engine service in IIS.

Sample Run Minion requests

In the SitecoreCommerce_DevOps collection in Postman, the Minions folder contains the following sample requests to run minions:

  • Entity archiving minions:

    • Run Archive Orders Minion

    • Run Archive Journals Minion

  • Order processing minions:

    • Run PendingOrders Minion

    • Run ReleasedOrders Minion

    • Run WaitingForAvailabilityOrders Minion

    • Run SettleSalesActivities Minion

    • Run RefundRmas Minion

  • Indexing minions:

    • Run FullIndex Minion - Orders

    • Run IncrementalIndex Minion - Orders

    • Run FullIndex Minion - Customers

    • Run IncrementalIndex Minion - Customers

    • Run DeleteIndexDocuments Minion - Customers

    • Run FullIndex Minion - Promotions

    • Run IncrementalIndex Minion - Promotions

    • Run FullIndex Minion - PriceCards

    • Run IncrementalIndex Minion - PriceCard

    • Run FullIndex Minion - Catalog Items

    • Run IncrementalIndex Minion - Catalog Items

    • Run FullIndex Minion - Storefront (Master)

    • Run FullIndex Minion - Storefront (Web)

    • Run IncrementalIndex Minion - Storefront (Master)

    • Run IncrementalIndex Minion - Storefront (Web)

  • Catalog data management minions:

    • Run Purge Catalogs Minion

    • Run Purge Categories Minion

    • Run DeleteIndexDocuments Minion - Catalog

  • Shopping cart management minions:

    • Run Purge Carts Minion

  • Troubleshooting minions

    • Check Long Running Command Status for Minions