Skip to main content

Anatomy of a Dynamics 365 Rule Execution Request

The below diagram helps to give a top-level understanding of how InRule is integrated with Microsoft Dynamics 365 (Online). Please note this diagram is a simplification that does not cover topics like caching, iterations, and multiple environments. It serves to show how the request moves through different Azure resources. The steps are also described in the context of the older integration architecture using the Azure Relay, the same principles still generally apply to the new REST Execution API sans the Relay.

  1. A Dynamics 365 Event based on a configured step fires, such as ADD, UPDATE, DELETE, or CUSTOM. This generates a call to the Relay, which is setup to relay requests to the connected Rule Execution App Service.
  2. The Relay receives the request and relays it to the Rule Execution App Service, which has attached itself to the Relay as a relay listener. For On-Premises, the rule execution service interacts directly with Dynamics.
  3. The Rule Execution App Service makes a request to the Catalog Service, asking for a copy of the requested Rule App.
  4. The Catalog Service Queries its SQL Server based database for a copy of the requested Rule App.
  5. The SQL Server responds with the Rule App.
  6. The catalog service responds to the Rule Execution App Service with the Rule App.
  7. The Rule App executes inside the Rule Execution App Service.
  8. Optionally, the Rule App has an opportunity to query Dynamics 365 for additional data needed to execute rules.
  9. The Rule App completed execution
  10. The Rule Execution App Service responds through the Azure Relay
  11. The Azure Relay relays the response to Dynamics 365, where the receiving plugin synchronizes changes.

Rule execution request diagram: Microsoft Dynamics 365 (Online) sends a CRM event through the Microsoft Azure Service Bus to the Rule Execution Azure App Service, which downloads the RuleApp from the Catalog Service (Azure App Service) backed by SQL Server and Database, executes the RuleApp (optionally querying Dynamics 365 through RuleHelper), and relays the response with any changes back to Dynamics 365, with Steps 1 through 11 labeled