Driven by success, the future is bright!

Microsoft Flow :: How To Get Run Link

flowRunLink

Requirement

I would like to be able to link through to a specific flow instances run history (for those with permission to access it) for troubleshooting purposes. It would be great if a direct link to an instances run history could be created maybe with an action or just be a persistent constant in the dynamic content. This could then be added to an email that triggers when a flow has failed to prevent you having to find the failed instance in the run history.

Steps

To this link you need the the LogicAppName and Run instance ID. You can get these values from the workflow() function. Here is how I have been able to accomplish this:

  1. Declare a variable of object type, wfFlowObj
    variable wkFlowObj

  2. Set this variable to the workflow() function.
    set variable

    This will return a JSON object like this one
    variable output

  3. To get the vaules you need, we need Parse this JSON object, using the wfFlowObj output as payload to generate the schema.

    PARSE JSON
    payload

  4. Declare anothe variable of string type, runLink
    runLink variable

  5. Now we need to construct the link URL, which is as follows:

    https://us.flow.microsoft.com/manage/environments/{environment name}/flows/{logicAppName}/runs/{run_name}

    We can now construct this URL using the dynamic values from our PARSE_JSON Step

    LINK URL
    complete flow

At this point, you can use this variable as you wish.

Leave a comment

Your email address will not be published. Required fields are marked *