Flow Document

The last action should be a HTTP response action or a PowerApps Response action with no payload.

Flow Mailmerge

The last action should be a HTTP response action or a PowerApps Response action with a payload.

It’s possible to combine the different actions in the return data, for example return a message and a document and navigateTo and openUrl.

Message: return only a message that the work is done (available since version 2025.03.24), for example:

{ 
  "message": "All done" 
}

or return an error message:

{ 
  "message": "This is not allowed",
  "messagetype": "error"
}

Document: return a document, so it will be downloaded automatically by the user, for example:

{ 
  "contenttype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", 
  "content": "...base64 string of the docx file...." 
}


If returning a zip file, use as contenttype “application/zip”.
If returning an Excel file, use as contenttype “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”.

Navigation: return info to navigate to (available since version 2025.03.24), for example:


{
  "navigateTo": {
    "input": {
      "pageType": "entityrecord",
      "entityName": "ctse_document",
      "entityId": "3eac5532-19c1-ea11-a812-000d3a4684b2"
    },
    "options": {
      "target": 1
    }
  }
}

Note: This functionality is only supported with HTTP response action, because of complex properties. More info about navigateTo: https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto

Open url: opens an url in another tab in the webbrowser (available since version 2025.08.29), for example a Sharepoint url:


{
  "openUrl": {
    "url": "https://contoso.sharepoint.com/sites/CRM/account/Contoso_FEDA8C48-2B75-486E-AC67-955115650E91/test1.docx"
  }	  
}

To force open the document url in the Word app, add this before the url: “ms-word:ofe|u|”, for example:

{
  "openUrl": {
    "url": "ms-word:ofe|u|https://contoso.sharepoint.com/sites/CRM/account/Contoso_FEDA8C48-2B75-486E-AC67-955115650E91/test1.docx"
  }	  
}

Note: This functionality is only supported with HTTP response action, because of complex properties. With the (optional) property “app” (true or false) you can force to open it in an Office app like Word instead of the webbrowser. Note: when using app: true, the file parameter should exists in the url.

Long operation

If the flow runs more than 1 minute and is started from the front-end to execute a mailmerge (for a lot of records for example), a timeout error will occur. The front-end will catch this timeout error and shows up with a user friendly message that the process takes longer and the front-end will not be waiting for that, but the last response action in the flow will result into an timeout error, despite all actions in the flow have been executed successfully.

To solve this, you have to change the flow at the end where you return a response. Here directly after the Response action add a Terminate action with status “Succeeded” and in the settings of this action at section “Run after” only check the options “Has timed out” and “Has failed”. This ensures the flow will not fail on the timeout of long operations.