Our child record should be triggered manually (also includes invocation from another flow) and contain the necessary properties to dynamically create the HTTP request:
First we need to initialize the variables to authenticate with the D365 environment. In our example we use an application user. For that we need the Azure Active Directory ID (AAD ID), Client-ID and Client-Secret from an app registration. See this article.
After we know the variable values we can get a token from D365:
After that we parse the response to JSON:
Now we are able to execute the request using the access_token node of our parsed JSON response. The method, URI, Query and Request Body are taken from the manual trigger of the child-flow.
Finally we return the response and status code to the calling entity:
Calling a child flow for custom HTTP Request to D365
We can now use our child flow to create custom calls. In this example we generate a PDF using the Microsoft.Dynamics.CRM.documenttemplate action.