I need to trigger a main workflow whenever any one of the workflows in the tenant fails during execution.
The tenant contains multiple workflows. If *even a single workflow execution fails, the main workflow should be triggered to *send a notification alerting about the failure.
Current Implementation Attempts:
I tried using a Scheduled Trigger to periodically check for failures.
I attempted using the HTTP Request Action to call the “List Workflow Executions” API, but it fails with a 403 Forbidden error, even though I’ve granted the necessary permissions in the token.
Is there a recommended approach to monitor workflow execution failures tenant-wide and trigger a separate workflow automatically when a failure occurs? Would appreciate any guidance or alternate solutions.
I am able to reach the endpoint using Postman, but when using an HTTP operation, I receive errors like 401 and 403. I’m looking for any workarounds or suggestions for this requirement.
Are you using a personal access token or an OAuth client credential generated from Global → API Management.?
The OAuth client credentials does not have a user context and is advisable to use the PAT for the workflow actions as the ISC API’s expect a user context.
Hello @Gopi2000
To add on Jesvin, you are always advised to use a service account to generate PAT’s from ISC and use it inside the WF’s.
I can check deep but if its 401 or 403 than it seems the permissions are not right, did you try with All Scope ? As the postman you attempted would have a different PAT.
And ensure your Service Account is set to ORG ADMIN. This gives you an added advantage as to when someone leaves your organisation and you terminate the user, the PATS used in WF’s will cause WF’s to fail.
And further more to satisfy your use case, you need to iterate over the LIST WORKFLOWS call, which will return you the list of WF’s in your tenant and than use the values in the HTTP call you make over the iteration in LOOP.