Predefined Commerce Engine minions

Abstract

Lists and describes default minions that play key roles in various processing, such as indexing, or order flow processing, for example.

The Sitecore Commerce Engine defines and uses default minions described in this section.

The index minions perform indexing tasks on Commerce entities (orders, customers and catalog items).

FullIndexMinion

The FullIndexMinion indexes all items a list. It runs on demand, calling the IPrepareFullIndexMinionPipeline and the IFullIndexMinionPipeline to perform indexing functions.

IncrementalIndexMinion

The IncrementalIndexMinion watches for new items that need to be updated in the index. It runs every 3 minutes and calls the IPrepareIncrementalIndexMinionPipeline and the IIncrementalIndexMinionPipeline

DeleteIndexMinion 

The DeleteIndexDocumentsMinion watches a list. It runs every 3 minutes, calling the IPrepareDeleteIndexDocumentsMinionPipeline and the IDeleteIndexDocumentsMinionPipeline

Other minions available out-of-the-box such as the DeletedCustomersIndex and the  DeletedCatalogItemsIndex  delete different entities lists from the search indexes.

Order process minions play a key role in the overall order process flow, moving orders from list to list, as they transition from the initial pending status, to the final order completed status.

The PurgeCartsMinion runs as a maintenance process that deletes abandoned or empty carts from the database, after they have become eligible for deletion based on a predefined threshold.

The PurgeCartsMinion watches a list of carts ("ListToWatch": "Carts") and runs every 24 days ("WakeupInterval": "24:00:00").

The PurgeCartsPolicy determines the threshold (in number of days) after which empty or abandoned carts are deleted from the cart list. The following example shows the policy settings as defined in the sample Plugin.AdventureWorks.CommerceMinions.json file (packaged as part of the Sitecore.Commerce.Engine.SDK).

{
 "$type":"Sitecore.Commerce.Plugin.Carts.PurgeCartsPolicy, Sitecore.Commerce.Plugin.Carts",
 "AbandonedCartsThreshold": 14,
 "EmptyCartsThreshold": 2
},

Based on the above policy definition:

  • an abandoned cart becomes eligible for deletion after 14 days of inactivity.

  • an empty cart becomes eligible for deletion after 2 days of inactivity.

The PurgeCartsMinion calls the IPurgeCartsMinionPipeline .

The PurgeCatalogsMinion minion runs as a maintenance process that purges deleted catalogs from the database. When catalogs are deleted, for example using the Business Tools user interface or using the sample Delete Catalog request in Postman, they are placed on a list of deleted catalogs. The Purge Catalogs minion watches that list ("ListsToWatch": "PurgeCatalogs"), and purges the database of listed deleted catalogs at a set interval. By default, the minion runs every 5 minutes.

Note

In the Sitecore XC Business Tools, deleted catalogs continue to appear in search results until the Purge Catalogs minion runs and effectively deletes them from the database.

When deleted catalogs are purged from the database:

  • Sellable items that are only associated with deleted catalogs remain in the database as orphans. Business Tools users can still find orphan sellable items when searching for them.

  • Categories that are associated with deleted catalogs are also purged from the database.

The following example shows the default PurgeCatalogsMinions policy, as defined in the Plugin.Minions.PolicySet-1.*.*.json file:

{ 
  "$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
  "WakeupInterval": "00:05:00",
  "ListsToWatch": [
    "PurgeCatalogs"
  ],
  "FullyQualifiedName": "Sitecore.Commerce.Plugin.Catalog.PurgeCatalogsMinion, Sitecore.Commerce.Plugin.Catalog",
  "ItemsPerBatch": 10,
  "SleepBetweenBatches": 500
},

Note

You can execute the Run Purge Catalogs Minionrequest in Postman to forcefully purge deleted catalogs from the database.

The PurgeCategoriesMinion runs as a maintenance process that purges deleted catalog categories from the database. When categories are deleted from a catalog, for example using the Business Tools user interface or using the sample Delete Category request in Postman, they are placed on a list of deleted categories. The Purge Categories minion watches that list ("ListsToWatch": "PurgeCategories"), and purges the database of listed deleted categories at a set interval. By default, the minion runs every 5 minutes.

Note

In the Sitecore XC Business Tools, deleted categories continue to appear in search results until the Purge Categories minion runs and effectively deletes them from the database.

The following shows an example of the default PurgeCategoriesMinion policy, as defined in the Plugin.Minions.PolicySet-1.*.*.json file:

 {
   "$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
   "WakeupInterval": "00:05:00",
   "ListsToWatch": [
     "PurgeCategories"
   ],
   "FullyQualifiedName": "Sitecore.Commerce.Plugin.Catalog.PurgeCategoriesMinion, Sitecore.Commerce.Plugin.Catalog",
   "ItemsPerBatch": 10,
   "SleepBetweenBatches": 500
 },

Note

You can execute the Run Purge Categories Minionrequest in Postman to forcefully purge deleted categories from the database.