Custom workflow activities (workflow assemblies)

Applies to Dynamics 365 for Customer Engagement apps version 9.x

Dynamics 365 (online) Customer Engagement supports the registration and execution of custom workflow activities in addition to the out-of-box activities provided by Windows Workflow Foundation. Windows Workflow Foundation includes an activity library that provides activities for control flow, sending and receiving messages, doing work in parallel, and more. However, to build applications that satisfy your business needs, you may need activities that perform tasks specific to that application. To make this possible, Windows Workflow Foundation supports the creation of custom workflow activities.

You can write custom workflow activities in Microsoft Visual C# or Visual Basic .NET code by creating an assembly that contains one or more classes derived from the Windows Workflow Foundation CodeActivity class. This assembly is annotated with .NET attributes to provide the metadata that Dynamics 365 uses at runtime to link your code to the workflow engine.

After you have created an assembly that contains one or more custom workflow activities, you register this assembly with Dynamics 365. This process is similar to registering a plug-in. The custom workflow activity can then be incorporated into a workflow or dialog in the Process form in Dynamics 365.

Note

Dynamics 365 (online) only supports sandbox (partial trust) execution of custom workflow activities. On-premises Dynamics 365 (online) supports execution of custom workflow activities in partial or full trust.

In This Section

Creating a Custom Workflow Activity

Adding Metadata to the Custom Workflow Activity

Using the Web Services within a Custom Workflow Activity

Registering the Workflow Assembly

Debugging a Custom Workflow Activity

Updating or Upgrading Custom Workflow Activity: Assembly Versioning

Process Classes, Attributes, and Dynamics 365 Types

Sample: Create a custom workflow activity

Sample: Update Next Birthday Using a Custom Workflow Activity

Sample: Calculate a Credit Score with a Custom Workflow Activity

Write Workflows to Automate Business Processes

Write Plug-Ins for Dynamics 365 Customer Engagement

Plug-in Isolation, Trusts, and Statistics