Automation

What is it and how to create a workflow in Dynamics 365?

Tuesday January 31, 2023
6 min read
workflow in Dynamics 365

What is a workflow – definition(s)

Let’s start with what a workflow actually is. The term workflow can be defined and understood in two different ways: as a system and as a business process. Let’s take a look at both of these definitions. A workflow understood as a system runs on the Application Object Server (AOS). This workflow system provides functionality for creating individual workflows or business processes. Workflow can also represent a business process. Its name derives from the fact that it defines how a document flows (moves) through the system and gives information on who has to complete a task, give approval, make a decision, etc. Using the workflow system in an organization brings important benefits. It:
  • makes the processes consistent: you can define how specific documents are processed and approved
  • gives visibility to the process: you can track history, status, performance metrics, etc. of any workflow instance.
  • gives you a centralized work list: users can display the workflow tasks and approvals assigned to each user, including themselves.

Dynamics 365 workflow

What is a workflow in Dynamics 365?

In Microsoft Dynamics 365, a workflow combines the two of the above definitions. It is a series of functions (or methods) that are called steps and which are performed in a sequence. A workflow in D365 application is used for managing both data and (business) processes. It is also referred to as the implementation of automation. It is because it can be used for both simple and complex tasks and you don’t have to be a programmer to create a workflow in Dynamics 365. That is why it is very popular among users. The implementation of automation can be shared not only with your IT department but also with your business partners or associates in order to reduce production time and introduce automation in D365. However, if you want a workflow to be effective, it has to have certain traits, such as:
  • a clear and precise goal
  • it should save time
  • it should serve to avoid creating repetitive tasks in Dynamics 365
Dynamics 365 uses two types of workflows. These are: Asynchronous and Real-time (synchronous) workflows.

Asynchronous (background) workflow

An asynchronous workflow in Dynamics 365 uses the window service to act as a host application for the workflow engine to work. Such a workflow will run in the background, therefore it will not interrupt the main business process flow for the user in their interface. However, this is also a drawback – the user interface is not refreshed with new information until the workflow execution is complete (the user need to refresh the browser screen for an update).

Real-time (synchronous) workflow

It defines using workflow entity records and is mainly for non-developers. It executes a plug-in Event Execution Pipeline which can be used pre-operation, during the core operations or after it. It is best to use it when you need to execute quick workflows and get a real-time workflow refresh. You cannot, however, execute a real-time workflow after the Delete operation or before the Create one. Real-time workflows can be converted to asynchronous workflows and vice versa. What can a workflow be used for? It can actually do a few things that Dynamics 365 is not capable of. Here is a couple of scenarios:
  • Notifications
  • User created workflows
  • Approvals
  • Lightweight integration options

Dynamics 365 workflow

How to create a workflow in Dynamics 365?

Before you create a workflow in Dynamics 365, bear in mind that with D365 subscription, you can use two different environment for this. The first one is called the generation. This is a typical D365 environment that you would use for your day-to-day work. The second one is the sandbox. You can use this environment to test any changes or development that you want to implement. Sandbox is ideal for any workflow creation tests. It will not affect your production environment and also will not touch any sensitive data or impact the work of your colleagues (especially if something goes wrong). Therefore, if you want to make some changes to the solution, make them first in a sandbox environment to get rid of the risk. In Dynamics 365 Finance and Operations (F&O), workflows are often used for routing business documents (like vendor invoices, purchase order, purchase requisitions, general journals, etc.) to the appropriate person/ people for approval. In order to enable workflows in Dynamics 365 F&O for different document types, you need different configurations. The below shows how to enable Change Management option in the Procurement and sourcing parameters if you want to create a workflow for purchase orders. D365 workflow

Who can create a workflow in Dynamics 365?

As mentioned above, you don’t need to have any programming skills to create a workflow in Dynamics 365. However, you need to have a security role assigned to your account so that you have the necessary level of security. Without the required privileges, your newly created workflow might simply not work.
Workflow D365

Workflow in Dynamics 365 – element types

Each workflow contains some basic elements:

Approval

This is a workflow element that allows a user to either approve or reject an order, journal, etc. It is required as it is the only element that can change an order or a journal to the approved status so that it can be progressed for processing.

Conditional Decision

It allows you to define a condition which the system will then evaluate, based on the current order or journal, to be true or false. After that, the workflow is sent down the true branch or the dales branch. You might want to include one or many Conditional Decision nodes, depending on the complexity of your workflow.

Manual Decision 

This element allows to define two options for the user to whom the workflow has been routed. Depending on the option chosen by the user, the workflow will go down one branch or another. Manual Decision is used when the decision is too complex for the system to decide automatically or human intervention is required to determine the final outcome of the workflow.

Parallel Activity

This element is used if a user needs to run two workflows at the same time (within the main workflow). To set up this element, you need to double click on the Parallel Activity node. This will allow you to set up each of the parallel workflows.

Subworkflow

It invokes a subworkflow at a given point of the main workflow. You have an option to either wait until the subworkflow ends or continue with the main workflow (with the subworkflow executing in the background).

Line Workflow

This is a workflow element that is used for specific approvals at the line level. To use it, first, you need to create the line workflow separately and only then add it as an element in the header level workflow. An example can be a Purchase Order line workflow as an element on a Purchase Order approval workflow.

Review

A Review element assigns a review task to the person that the workflow has been routed to. It differs from an Approval workflow element in the sense that it does not change the status of an order or a journal. A Review element is simply a task assigned to one or many users for review, before it goes out for approval. What can you also do with a workflow in Dynamics 365 once it has been created? For example:
  • You can add business logic (e.g. send an email once a record has been created after 5 minutes). In order to do so, you need to:
  1. add Check condition
  2. add Email properties
Remember that once a new workflow in Dynamics 365 has been created, it has to be activated.
Dynamics 365 workflow

Dynamics 365 workflow and Microsoft Flow – are they the same?

No, they’re not. Apart from the similarity in the name, these two operate differently. A workflow works solely for the Dynamics 365 application. Unfortunately, it is a functionality that does not allow you to create automation between other Microsoft apps. On the other hand, with Microsoft Flow, you can create automation between different parts of the Microsoft ecosystem. It is an external Microsoft service and currently is not available to users from within Dynamics 365 settings.
CONTACT US

We are proficient in solving complex tasks and challenges.

Our goal is an efficient response to unique customer needs. Our field of expertise is the implementation and development of solutions tailored to the specifics of dispersed, multinational organizations. We will be happy to help your business.

Let’s talk!

If you would like to discuss your needs concerning Microsoft Dynamics 365 (FSCM), please fill in the form below.
Hey there! 👋 What brought you to our site today?_
1