What should my classic workflow become? Workflows from CRM 3.0 to Power Automate

How to decide what replaces a classic Dataverse workflow, dialog or custom process action, using Microsoft's own comparison tables, and how workflow got here from the CRM 3.0 Workflow Manager.

Answer first

Microsoft’s direction is clear: build new automation as Power Automate flows, and review existing classic background workflows for replacement. The real-time workflow documentation carries the same note: there are better ways to create modern automations.

But Microsoft’s own comparison shows classic workflows still do some things flows don’t. What a workflow does decides what it should become:

If the classic process… Look at Why
Runs in the background: creates records, sends email, updates fields A Power Automate cloud flow Microsoft’s recommended route; flows add loops, parallel branches, connectors, approvals and schedules
Must run synchronously, before the user’s save completes Keep a real-time workflow, or write a plug-in Flows can’t run synchronously
Waits for a column to reach a value Keep it classic, or redesign around a trigger Flows have no wait condition on columns
Needs the record’s values from before the change Keep it classic, or use a plug-in Flows have no access to the pre-image
Calls custom workflow activities Keep it classic, or move the code Flows can’t run custom background workflow activities
Is a custom process action A custom API, if you need what only custom APIs offer See the comparison below
Is a dialog or a task flow A business process flow, or a canvas app for dialogs Both are deprecated
Shows, hides, requires or defaults fields on a form A business rule No code, and rules can also run on the server

Sources: Microsoft’s “Replace classic Dataverse workflows with flows”, its real-time and background workflow pages, the custom process action and custom API comparison, and its deprecation announcements. The “Look at” column is this site’s reading of Microsoft’s comparisons; the “Why” column is what those comparisons say.

Flows versus classic workflows

Source: Microsoft’s “Replace classic Dataverse workflows with flows”. Microsoft says it updates the comparison as flows gain capabilities, but the page was last revised in 2022, so check the live page before relying on a “No”.

Capability Power Automate Classic workflow
Conditional branching Yes Yes
Looping Yes No
Wait conditions on columns No Yes
Parallel branches Yes No
Connectors to external systems Yes No
Dynamic content Yes Yes
Access to the pre-image of event data No Yes
Run child workflows Yes Yes
Run Dataverse actions, including custom ones Yes Yes
Run custom background workflow activities No Yes
Group steps in a transaction Yes (changesets) No
Approvals Yes No
Trigger on column changes Yes Yes
Trigger on multiple table events Yes Yes
Run on demand Yes Yes
Run-as scopes such as organization, business unit or user Yes Yes
Run on a schedule Yes No
Run synchronously (real-time) No Yes
Auditing Yes Yes
Run analytics Yes No
Solution support Yes Yes

Two of Microsoft’s recommended patterns when replacing workflows:

  • Use a switch action for complex else-if chains.
  • Start the flow from a trigger rather than from plug-in or other code.

Custom process action or custom API

Source: Microsoft’s “Compare Custom Process Action and custom API”.

Custom process actions, introduced in CRM 2013, still work. Custom APIs are the developer-focused alternative:

Capability Custom process action Custom API
Logic defined declaratively in the workflow designer Yes No: a .NET plug-in provides the logic
Require a specific privilege to call it No Yes
Main operation logic in code Yes Yes
Stop other publishers’ plug-ins extending it Yes Yes
Make the message private No Yes
Localizable names and descriptions No Yes
Create an OData function, not just an action No Yes
Global, or bound to a table Yes Yes
Bound to a table collection No Yes
Define or edit it in solution files No Yes
Subject to the 2-minute plug-in limit No, though long-running actions still fail Yes

Keeping classic workflows healthy

Source: Microsoft’s “Best practices for background workflow processes”.

  • Infinite loops stop at 16. A background workflow that updates the column that triggers it runs again and again. When one runs more than 16 times on a row in a short period, it fails with This workflow job was canceled because the workflow that started it included an infinite loop.
  • Several workflows updating the same table can lock each other out. The failures show errors such as SQL Timeout: Cannot obtain lock on resource.
  • Delete completed jobs automatically to save space. Failed runs are always kept.
  • Reuse logic through child workflows and workflow templates.

How workflow got here

CRM 3.0: Workflow Manager

Sources: Microsoft’s CRM 3.0 SDK and Workflow Manager Help.

  • Rules were built in Workflow Manager, a Windows tool on the server, not in the web application. See CRM 3.0.
  • Custom code meant workflow .NET assemblies, listed in workflow.config in the server’s bin\assembly folder. Changing one meant stopping the Workflow Service, resetting IIS and starting the service again. Only signed assemblies loaded, unless the configuration allowed unsigned ones.
  • The SDK steered ISVs to post-callouts instead of workflow rules. Workflow rules couldn’t be imported or exported programmatically, the SDK exposed no workflow APIs, and callouts gave more control over execution and failure.

CRM 4.0: workflow in the web application

Sources: Microsoft’s CRM 4.0 SDK and readme.

  • Workflow moved into the web application, built on Windows Workflow Foundation.
  • Custom workflow activities were classes derived from Windows Workflow Foundation activities, registered the same way as plug-ins and stored in the database. They were on-premises only, not CRM Online.
  • 3.0 workflows upgraded, with gaps. Definitions, running instances, logs and assemblies came across. Not upgraded: code using 3.0 workflow entities and messages, workflows using the deprecated Post URL action or change stage and skip step, and the execution order. Ownership also changed; see CRM 4.0.

CRM 2011: processes, dialogs and XAML

Source: the CRM 2011 SDK.

  • Workflows became “processes”, in two categories:
    • workflows, asynchronous and running in the background;
    • dialogs, synchronous wizards that need user input to finish.
  • Windows Workflow Foundation 4. New custom activities use System.Activities. Workflows still accept 3.5 activities; dialogs accept only 4.
  • XAML workflows could be designed in Visual Studio without code, for on-premises only and disabled by default. CRM Online didn’t support custom XAML workflows.
  • When to choose a workflow over a plug-in, per the SDK:
    • non-developers need to change the logic;
    • a delay after the event is acceptable;
    • users should be able to run it by hand.
  • Moving workflows in solutions breaks references to specific records. Only system users and currencies are matched by name in the target.

CRM 2013 to 2015: real-time workflows, actions and rules

Sources: Microsoft’s archived CRM 2013 and 2015 documentation.

  • CRM 2013 added real-time workflows that run in the event pipeline like synchronous plug-ins, custom actions, and business process flows. See CRM 2013.
  • CRM 2015 let business rules run on the server, and its 7.1 update made custom actions callable from workflows and dialogs. See CRM 2015.

Dataverse: flows first

Sources: Microsoft’s current Power Automate, Power Apps and deprecation documentation.

  • Classic background and real-time workflows are still documented, each with a pointer to Power Automate.
  • Dialogs and task flows are deprecated, with removal announced for 1 December 2020 and 1 October 2021.
  • Business process flows remain current, now with concurrent flows, and so do business rules.
  • The 9.x on-premises guidance still compares plug-ins and workflows. Microsoft says real-time workflows have similar performance characteristics to sandboxed plug-ins. It also says asynchronous plug-ins and workflows perform about the same, and that each workflow activity has a two-minute limit. See 9.x on-premises.

Sources

  1. Replace classic Microsoft Dataverse workflows with flows Microsoft · · Primary, current docs Microsoft’s comparison of Power Automate and classic workflows, recommending flows for new automation and reviewing existing classic background workflows for replacement.
  2. Use Custom Process Actions with code: Compare Custom Process Action and custom API Microsoft · · Primary, current docs Microsoft's comparison of custom process actions and custom APIs: declarative workflow logic, required privileges, private messages, localizable labels, OData functions, table and collection binding, editing in solution files, and the 2-minute limit.
  3. Classic Dataverse background workflows Microsoft · · Primary, current docs Microsoft's overview of classic Dataverse workflows: background workflows, created with the Run this workflow in the background option, and real-time workflows documented with Power Apps.
  4. Microsoft Dataverse real-time workflows Microsoft · · Primary, current docs Microsoft's page on real-time (synchronous) workflows, which notes that there are better ways to create modern automations and points to Power Automate.
  5. Best practices for background workflow processes Microsoft · · Primary, current docs Microsoft's background workflow best practices: the infinite loop limit of 16 and its error message, templates and child workflows, deleting completed jobs, and lock timeouts when several workflows update the same table.
  6. Business process flows overview Microsoft · · Primary, current docs Microsoft's current overview of business process flows: stages and steps, stage-gating on required steps, concurrent process flows, multiple tables, and how flows interact with business rules, form scripts and workflows.
  7. Create a business rule for a table Microsoft · · Primary, current docs Microsoft's guide to table business rules: setting and clearing values, defaults, validation, and the form-only actions of requirement levels, visibility and enabling, with differences between canvas and model-driven apps.
  8. Important changes (deprecations) coming in Power Apps and Power Automate Microsoft · · Primary, current docs Microsoft’s running deprecation list, first published June 2017 and written for the online service. Its section on deprecated client APIs, linked from the 9.x on-premises client scripting page, lists Xrm.Page and its replacements.
  9. Best practices for developing with Dynamics 365 Customer Engagement (on-premises) Microsoft · · Primary, current docs Microsoft’s 9.x on-premises best practices: synchronous plug-ins designed to finish in under two seconds, the plug-in versus workflow comparison, single long workflows for throughput, InvalidPluginExecutionException in custom workflow activities, and server-side security guidance.
  10. Microsoft CRM 3.0 Workflow Manager and Workflow Monitor Help Microsoft · Primary, archived Private archive: Microsoft CRM 3.0 Professional server install media (CD 1), PFiles/MSCRM/Tools/WorkflowManager.chm and Workflowmonitor.chm Microsoft’s compiled Help for the 3.0 Workflow Manager and Workflow Monitor tools, decompiled with the Windows Help viewer and read as documents; the tools themselves were never run. Covers workflow rules, sales processes, templates, trigger events, run-as credentials and scope, workflow loops, and what was new for workflow in 3.0.
  11. Microsoft CRM 3.0 SDK (compiled help, crmsdk3_0.chm, 2007 edition) Microsoft · Primary, archived Private archive: CRM-SDK-Rescue/3.0-SDK/crmsdk3_0.chm Microsoft’s SDK help for CRM 3.0: the Server Programming Guide’s callout model, method signatures, callout.config.xml reference, error handling and tracing, and the CrmService and MetadataService web services at /mscrmservices/2006/, including security, impersonation, DynamicEntity, FetchXML and QueryExpression. The owner’s copy came from a third-party software archive; it is a valid help file whose 6,937 pages all carry Microsoft’s 2007 copyright. Read as documents only, never executed. Quote sparingly and cite; do not republish.
  12. Microsoft Dynamics CRM 4.0 SDK (compiled help, CrmSdk4.chm, version 4.0.13, November 2010) Microsoft · Primary, archived Private archive: CRM-SDK-Rescue/4.0-SDK/sdk/crmsdk4.chm Microsoft's SDK help for CRM 4.0 Update Rollup 13 and CRM Online: plug-in development (IPlugin, the execution context, the unsecure and secure constructor strings), the event execution pipeline and its parent and child pipelines, registration and deployment, impersonation, error handling, offline plug-ins, execution of CRM 3.0 callouts, the 2006 endpoint, and what is new in the 4.0 web services. Extracted without running anything from CrmSdk4.exe, whose Microsoft Authenticode signature is valid and which the Internet Archive captured from download.microsoft.com. All 12,022 pages carry Microsoft's copyright. Quote sparingly and cite; do not republish.
  13. Microsoft Dynamics CRM 2011 SDK (compiled help, CrmSdk2011.chm) Microsoft · Primary, archived Private archive: CRM-SDK-Rescue/2011-SDK_from_desk/SDK/CrmSdk2011.chm Microsoft's own SDK help for the 2011 release, from an owner-held copy. Static reading only; the package is never executed and is not part of this repository. Quote sparingly and cite; do not republish.
  14. Create real-time workflows (Microsoft Dynamics CRM 2013 SDK, archived) Microsoft · · Primary, archived Microsoft’s archived CRM 2013 guidance on real-time workflows: they run in an event pipeline stage like synchronous plug-ins, immediately and inside the current transaction, can be ranked within a stage, cannot contain wait or delay activities, cannot run on retrieves, and can be converted to and from asynchronous. In CRM Online they must be created in the web application; XAML workflows are on-premises or IFD only.
  15. What’s new for developers (Microsoft Dynamics CRM 2015 SDK, archived) Microsoft · · Primary, archived Microsoft’s archived CRM 2015 developer documentation, in two parts. CRM 2015 and CRM Online 2015 Update (7.0): calculated and rollup fields, hierarchies and hierarchical security, server-side business rules, business process flow branching and scripting, field-level security on system fields, removal of deprecated form script methods, and .NET Framework 4.5.2 as the minimum for plug-ins. CRM Online 2015 Update 1 (7.1): alternate keys, upsert, change tracking, ExecuteTransactionRequest, optimistic concurrency, Update for specialized operations, plug-in trace logs, date and time behaviours, and the Web API preview.