Skip to main content

Flows Uncovered

About Flows

The two Plugins A ntw_logicflow entity record represents a logic flow definition. The definition includes properties of the Flow, such as the name of Logic Flow, the Project to which the Flow is related, and its configuration in the form of a JSON document. Flux.Crm.LogicFlows.Plugins.LogicFlowPlugin and Flux.Crm.LogicFlows.Plugins.InvokeLogicFlowPlugin plays a crucial role during the lifetime of a logic flow definition.

Flux.Crm.LogicFlows.Plugins.LogicFlowPlugin plugin supervises the customizations for Flows. This Plugin springs into action whenever you create a new flow, make changes, or delete it. The Plugin validates configuration and performs the necessary customization in response to updates. This supervision manifests in a few plugin registration steps (Figure 7: Flux Flow)

Figure 1:  Flux Flow

Figure 1: Flux Flow

Flows Plugin Steps

MessageStageDescription
CreatePreValidationUpon creating a Logic Flow, the Plugin performs a series of validations to ensure the integrity of the configuration. The Plugin blocks the creation of the Flow in case of validation failures.
CreatePostOperationFollowing a successful validation, this Plugin performs customizations by introducing a process action, and registering a new plugin step only if Is Action flag is true (Figure 2: Flow Create Customizations).
DeletePreValidationBefore the deletion of the Flow, the Plugin performs a series of validations to ensure that this Flow does not serve as a dependency for any other component (Flow, Recipe).
DeletePreOperationFollowing a successful validation, this Plugin removes the registered plugin registration step and the process action only if Is Action flag is true. (Figure 4: Flow Delete Customizations).
UpdatePostOperationAfter updating a Logic Flow, the Plugin updates both the plugin registration step and the process action if the 'isAction' flag is set to true. If the 'isAction' flag is false, and the previous state of the 'isAction' flag was true before the update, the Plugin deletes the registration step and the process action. (Figure 3: Flow Update Customizations).

Table 1: Flows Plugin Steps

Flow Creation

When a flow is created and marked as isAction, the Plugin generates a CRM process action with input and output arguments matching the Flow configuration. Dynamics subsequently creates a specialized SDK message and registers a plugin registration step with the necessary configuration.

Figure 2: Flow Create Customizations

Figure 2: Flow Create Customizations

Flow Update & Deletion

In cases of updates, the Plugin adjusts the process action and the plugin registration step configuration.

Figure 3: Flow Update Customizations

Figure 3: Flow Update Customizations

Likewise, when the Flow is deleted, the Plugin removes the associated plugin registration step and the previously created process action. Please note that this Plugin is active only during flow creation, modification, or deletion and does not intervene during the execution.

Figure 4: Flow Delete Customizations

Figure 4: Flow Delete Customizations

Flux Flow Invoke Logic Flow Plugin

Each time a logic block is executed through a process action, the Flux.Crm.LogicFlows.Plugins.InvokeLogicFlowPlugin Plugin intercepts the call and executes the logic.

Figure 5: Flux Flow Invoke Logic Flow Plugin

Figure 5: Flux Flow Invoke Logic Flow Plugin

Process Action Request Life Cycle

In the diagram below, the process action commences by receiving the necessary parameters: the SDK message and Process action input arguments. Following successful execution, it returns a response.

Figure 6:  Process Action Request Life Cycle Figure 6: Process Action Request Life Cycle

What's Next

After exploring the internals of Flows, let's now dive into the behind the scenes of recipes logic.