Showing results for 
Search instead for 
Did you mean: 

Running Microsoft Flow from within Dynamics 365 CE

Wouldn't it be great if you could trigger a Microsoft Flow from within Microsoft Dynamics 365 CE? Well, we have been able to do that since V9.0 release. Unfortunately, there hasn't been enough information published about how to set this up and do it. If you go to the online docs and search for embed Flow in Dynamics 365 you will either get a page that shows you how to enable the Flow button for Dynamics 365 or another doc how to get a Flow to appear in the flyout menu within Dynamics 365. So today I am going walk you through how to do it.

Microsoft Flow Embedded in Dynamics 365


But unfortunately, they are skimpy at best and in the case of the second document listed, a little incomplete at best or a little incorrect as of the writing of this blog. Here is the main piece of information you need to know. Only Flows that start with the COMMON DATA SERVICE TRIGGER WHEN A RECORD IS SELECTED will appear in the Flyout. Button Flows, Recurrence Flows or Flows that start with any other trigger type will not appear in the Flyout. Additionally, as you would suspect the Flow has to be enabled before it will appear. Note: in a future blog post I will explain how you can get around this limitation of only displaying Flows using 'when a record is selected' trigger. Now to the fun part. I will show you a Flow that a user can run from within Dynamics 365. The business scenario is that you want to be able to send a broadcast Text Messages (SMS) to Contacts on a Marketing List. We will use the 3rd party service Twilio and other existing standard connectors to execute this process. Here is what the Flow looks like (if it looks a little scrunched on your screen, click on it to get a bigger view):

Microsoft Flow Send Bulk SMS Messages to a Marketing LIst


Let's break down each step of the Flow:


  1. When a record is selected - this is the first event in the Flow and this Trigger allows the Flow to appear in the Flyout. It is connected to the Common Data Service (CDS) behind the environment it is running in. It will also prompt the user to enter in the message they want to send to the SMS recipients.

Microsoft Flow When a Record is Selected Trigger


This is how the triggering event will present itself to the user. Pretty cool, Huh? Kind of like the old CRM Dialogs but not very pretty though, 😞

Emulating a Dialog with Microsoft Flow


2. Get Marketing List - In this action we get info about the Marketing List we selected that we will use in later actions.

Get Marketing List


3. Using a Condition Check we make sure that we have selected a Marketing List that is of a Contact Type. If not it will send a failure notification to the user. Just a little sanity check that we didn't pick a list that is composed of Accounts or Leads. Also, note that this Flow is assuming we are working with a Static list, modifying for it to use a Dynamic list will be blogged about in a future post. FYI, Contact is a record type '2'.

Microsoft Flow Conditional Check


Since the dynamic content is a little cut off, here is the full name.

Microsoft Flow Condition Check Marketing List Type  


4. Let's get the negativity out of the way. If the condition evaluates to False because the List is an Account or Lead list the User will get an email notification.

Microsoft Flow Condition Check False


5. Moving back to the positive we can proceed down the happy path to get the members of the List.

Microsoft Flow Get List Members


6. Now the last step in data retrieval is to get the Contacts records themselves so that we can use attribute data from their records to send out the bulk SMS message. The way this is setup is we are only looping through the members of the selected Marketing list to get their info, not all the Contacts in the system.

Microsoft Flow Get Contacts


7. Finally, we are ready to send out the SMS message. Well almost. We need to make sure the Flow doesn't try to send a SMS to a Contact that doesn't have a mobile phone number. If it does the Flow will fail for that Contact. Although it will still send out messages to all the other Contacts that have a mobile phone. So therefore, the Flow will show as failed in the Run History. Here is how we keep it clean and also alert the User if any Contacts fail the test. There is not a Condition check that we can use like Does Contain Data as we can in traditional Dynamics 365 workflow. So, we write a condition check that says return the opposite of empty, which if not empty (has a mobile phone) would evaluate as true. It is @not(empty(body('Get_matching_Contact')?['mobilephone'

Microsoft Flow Condition Check is Attribute not empty


8. Let's take a look at what happens if it evaluates False and goes down the If no path. What the Flow will do is to create an Outlook Task for the User notifying them that a SMS could not be sent for that Contact. Would it be less intrusive to send a list of all the failures in one record? Sure, but let's assume that this is an edge case and not the norm for the Marketing List.

Microsoft Flow Create Outlook Task


9. Back to the happy path and the last Action. We are ready to send the message to the Contacts.

Microsoft Flow Twilio Send SMS

That wraps it up.


We build a flow with the trigger when a record is selected, and it worked fine. But we wanted to make it solution aware, so we recreated it within a solution, but now it does not show up in the dropdown.


Any idea how we can fix this?


Did you enable the flow after it was imported? Have you updated the connections in the flow?

We forgot 1 step, we build te flow in the solution, guessing it would run from within the solution. But we had to package it, and deploy it in the right environment (and enable it)


They do not run from within the Solution.

if the guidance i gave you solved the issue please mark as solved to close this post out.

I would love to mark it solved, even though it wasn't your remark that helped me, but there is no way to do this.

I tried by creating the flow outside the solution and also within the solution, but I am not able to see my flow under Flow button.

@crminnovation  : Could you please guide, how to resolve this?


About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: and twitter I also write at, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – Youtube channel -