Call Flow from Webhooks in Dynamics 365 CRM | Power Automate

In case you are wondering if there are other ways to call a Flow apart from just Dataverse connectors, well – There are ways! 😊

Here’s how you can use Webhooks registered on Dynamics 365 CRM to call a Flow in Power Automate using HTTP Request trigger

Pre-Requisites

Given that you already have Admin Access to create Flows with HTTP Request Triggers, you’ll need to have Plugin Registration Tool in case you are not familiar – Download Plugin Registration Tool for Dynamics 365 CRM using PowerShell

Initiate a Flow

Here’s how you start building your Flow –

  1. You must select the HTTP Trigger when you start a new flow. This will be your Flow trigger.

  2. Now, in order to be able to get the URL of the HTTP Trigger which you’ll need, you’ll need to save the Flow first.
    And for that, Flow needs to have more than 1 step. So just go ahead and add a variable, maybe. 😊

  3. Once you save the Flow, the URL will be generated which you can copy

  4. Copy this URL and paste it in the Notepad. We’ll come to it later.
    It should look like this –

    So we’ll come to this later. Let’s keep this handy in clipboard since you’ve copied it anyway and let’s move towards registering the Webhook itself.

Register Webhook in Dynamics 365 CRM

Given that you have Plugin Registration Tool and you are logged in, you can proceed with registering a Webhook in the environment –

  1. In the menu, select Register a Webhook option.

  2. Now, you can start by giving it a name.
    Then, in Endpoint URL – copy only till the work invoke
    https://prod-131.westus.logic.azure.com:443/workflows/6092c774224e498ebe413f3d7c05a45e/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gvfm52Mpnhsz4Ew4ufRllNM_VhfC6a-GkCpM7AigPU0

    Also, select the Authentication as HttpQueryString

  3. Now, coming the next part, you can start add properties to this –
    Green are the Properties, Pink are the Values

    https://prod-131.westus.logic.azure.com:443/workflows/6092c774224e498ebe413f3d7c05a45e/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gvfm52Mpnhsz4Ew4ufRllNM_VhfC6a-GkCpM7AigPU0

    Also, in case you are wondering what does the %2F mean – It’s the HTML encoding for a slash symbol “/
    Ref Link: https://www.w3schools.com/tags/ref_urlencode.ASP

    And, the properties should look like below –


  4. Now, you can go ahead and add a Step just like you would do in a Plugin assembly


    And then, for example, register a step on Associate. It could be any message.

  5. And, when you Associate a record, example – Assigning a security role to a User –

  6. The Webhook will call the HTTP Request Flow


    And if you open the Flow, you can expand the first step and see the Detailed outputs






  7. You can copy the above Outputs and use this to generate Schema for the HTTP Trigger so that you can use it further in the Flow


    And this is how it will be generated

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Showing Sandbox or Non Production Apps in Power App mobile app
  2. Create a Power Apps Per User Plan Trial | Dataverse environment
  3. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  4. Co-presence in Power Automate | Multiple users working on a Flow
  5. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  6. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  7. Call a Flow from Canvas Power App and get back response | Power Platform\
  8. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  9. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  10. Asynchronous HTTP Response from a Flow | Power Automate
  11. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  12. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

2 thoughts on “Call Flow from Webhooks in Dynamics 365 CRM | Power Automate

  1. I was trying to do this last week – I don’t seem to be able to ‘Save’ the query string parameters – they just disappear and when invoked the associate call to the webhook fails with an error. Register Webhook, step 3. Is there a trick to this? Plugin Registration tool v 9.2.21111.141

    Like

    • Hi, when you save something and reopen and it disappears? It mean it was not correctly set in the first place. The issue could be typo in the parameters which need to be carefully done.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.