Power Platform – Dataverse Low Code Plug-Ins Part 2: Instant Plug-Ins, the line between Child Flows and Actions…and plugin?

A continuation of my previous blog post: Power Platform – Dataverse Low Code Plug-Ins Part 1: A hybrid of Power Automate, Classic Workflow and Plug-Ins?

[Note! This blog is written about the public preview version of Low Code Plug-Ins. I will try to update it whenever possible.]

Read part 2.1 here: Power Platform – Dataverse Low Code Plug-Ins Part 2.1 [Preview]: Instant Plug-ins, not that great… yet


Introduction


In the previous blog post, I focused 🧘 on the automated LCP (Low Code Plug-Ins). However this time we will take a look at the Instant Plug-Ins, which seems to be a combination of Child Flows (Power Automate)1 and Actions2. I will reference it as ILCP (Instant Low Code Plugin) for short. I will not go into details of how to use the basics of ILCP, there are other great articles/posts about it. For example posts by Nishant Rana or Arun Potti.

Dataverse Accelerator App: The option to create instant plug-in on the left.

Both (Child Flow & Action) provide the option to configure input & output parameters, both are called manually and are global tables (although actions do have the option to reference a dataverse table).

D365 CE Action: Example of Action with input and output parameters.
Power Automate: Child Flow with input and output parameters.

TDLR


  • ILCP is somewhat a combination of Child Flows and Actions
  • It uses Custom API that references Microsoft.PowerFx.PlexPlugin to perform business logic (Similar to Automated Plug-Ins but without Custom API).
    • Does not have a plugin step as Automated Plug-In.
  • Custom API is automatically created upon creation of ILCP and is locked to Plugins (not workflows).
  • If you have a custom workflow you may re-write it as a plugin if you want to execute it from ILCP.

The Instant Plug-In


As in my previous blog post, I checked the trace log to see what gets traced 🕵️ and how it looks like in Plugin Registration Tool. You probably guess right, you won’t see any plugin step within Microsoft.PowerFx.PlexPlugins assembly.

Plugin Registration Tool: No plugin step for ILCP.
Instant Plug-In: Runs synchronously and within Main Operation stage.

If you have read other articles/posts about ILCP, you should know by now that it uses custom api3. And if you look into the custom api that is generated upon creation of ILCP, you will see that it references the PlexPlugins assembly.

D365 CE Custom API: Custom API references Microsoft.PowerFx.PlexPlugin on ‘Plugin Type’ field.

When I saw this, I thought to myself… since ILCP has the option to configure input/output parameters. Should you not be able to configure this to run against a custom workflow (code activity)? Well, the ‘Enabled for Workflow’ field is locked and you cannot change it with LevelUp extension, maybe there’s another way to do that. But first, I went to Metadata Browser to see its field configuration. To my surprise, the field is not valid for update! 🔼

XrmToolBox – Metadata Browser: WorkflowSdkStepEnabled field is not updatable.

So as of this version and perhaps from now on, you will probably not be able to configure your ILCP to run against a custom workflow. Why? Because if ‘Enable for Workflow’ is set to no, the custom api expected an implementation of IPlugin of the assembly that you reference on ‘Plugin Type’. You can perhaps get away with this using some dirty nice hack, but I won’t get into it in this blog post.

Now why would you even want to reference your code assembly the whole purpose of ILCP is to implement business logic 🧑‍💻 without code! Well, if you cannot solve your business requirements through PowerFX you will probably be able to do so with code. Also, if this is Microsoft’s approach to replace workflows, it makes even more sense to enable the ability to execute custom workflows from ILCP! Hold your horses, you can more or less achieve the same results with code plugins. How? Plugins has since way back been able to take input parameters and set output parameters! This means, as of this version, you should convert ♻️ your custom workflows into plugins instead.

For example, see the following screenshots below. I am setting up an ILCP with input and output parameters. Within Custom API, I am referencing my plugin code that I have registered through Plugin Registration Tool.

ILCP: A very simple configuration with one input parameters and an output parameter. We do not want to do anything with the output parameter because we want our plugin to do that instead. Hence, empty brackets.
Plugin Registration Tool: Plugin to be used by Instant Plug-In.
Custom API Form: I’ve changed the Plugin Type to reference my Plugin code.
Plugin Code: Sets ‘CustomEmail’ output parameter to the input parameters + @contoso.com.
Custom Workflow: Performs same operation as plugin code above. Not that this custom workflow is NOT referenced by ILCP in this example.
ILCP tests: Sending JohnDoe to EmailName parameter (don’t mind ‘ThisRecord’ parameter, this is visible because I didn’t configure ILCP to be global table (meaning I actively assigned a specific table).
Plugin Trace Viewer: Execution of LCP executed CustomApiPlugin and that traced the target entity and input parameter (EmailName).

As you can see below, our out-parameter is the value we got from plugin. For this specific example, you might as well do it using PowerFX Expression rather than plugin code. But the point ☝️ of this example is to demonstrate that you can partially configure 🛠️ this as a classic workflow to execute plugin.


Limitations


I will keep this very short for this post.

  • Set operator is not available for ILCP
    • You’ll need to use Patch instead.
  • You cannot use Output parameter as a variable within the PowerFX expression (Hopefully you can prove me wrong!)

Updates


[2023-11-11] Hours after posting this blog post, it is no longer possible to create an ILCP without actively assigning a value to output parameter in the expression 😅 It is however expected that output shall be assigned but it seems there wasn’t a validation check in the ILCP until now.


Final Note


I have more interesting topics to cover in relation to ILCP, but that will be in another blog post. I hope that you found this post interesting and, most importantly, gives you any value to your work!


Related Links


  1. https://learn.microsoft.com/en-us/power-automate/create-child-flows ↩︎
  2. https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/actions?view=op-9-1 ↩︎
  3. https://learn.microsoft.com/en-us/power-apps/developer/data-platform/custom-api ↩︎

Happy Low Code Plug-in-ing….!


2 responses to “Power Platform – Dataverse Low Code Plug-Ins Part 2: Instant Plug-Ins, the line between Child Flows and Actions…and plugin?”

Leave a comment

Blog at WordPress.com.

Design a site like this with WordPress.com
Get started