May 24 2023 09:16 AM - edited May 24 2023 09:21 AM
I am new to Logic Apps, but fairly well-versed in Power Automate. In Power Automate I have a small child flow that I use as an error handler and call it from other flows to send me an email with a link to the failed flow run. I re-created this for my Logic Apps but I have run into a problem.
The Error Handler Logic App is triggered by an HTTP request that takes the outputs of the workflow() expression from the calling app. Within the error handler app I parse through the definition to build a clickable link back to the calling app run that failed.
When I was testing, the workflow() outputs from my ERROR_TESTER app looked like this:
{
"id": "/subscriptions/<SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Logic/workflows/ERROR_TESTER",
"name": "ERROR_TESTER",
"type": "Microsoft.Logic/workflows",
"location": "centralus",
"run": {
"id": "/subscriptions/<SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Logic/workflows/ERROR_TESTER/runs/<RUN ID>",
"name": "<RUN ID>",
"type": "Microsoft.Logic/workflows/runs"
}
}
I just caught an error from an actual app I was running. The link didn't work and on further inspection I realized that the failed app's workflow() outputs looked like this instead:
{
"id": "/workflows/<WORKFLOW ID>",
"name": "<LOGIC APP NAME>",
"type": "Microsoft.Logic/workflows",
"location": "centralus",
"run": {
"id": "/workflows/<WORKFLOW ID>/runs/<RUN ID>",
"name": "<RUN ID>",
"type": "Microsoft.Logic/workflows/runs"
}
}
Despite the other differences, I was using the "run.id" property to build the URL to the flow run. Now that it seems to be getting truncated my original error handler app doesn't work.
Can anyone enlighten me on why the outputs are so different and potentially how to fix or plan for the differing outputs?