We have a requirement where we need to manually cancel a pipeline when an activity fails or completes.
We did try the steps mentioned in MS Docs : Pipeline cancel run : https://docs.microsoft.com/en-us/rest/api/datafactory/pipelineruns/cancel; but this does not work because even when the RUN ID is correct it says incorrect RUN ID.
Pipeline run ID shown in ADF: 
Response Received:
{
"error": {
"code": "ReferencedPipelineRunNotFound",
"message": "Referenced pipeline run id bb157b3c-8d69-4eee-b606-9fd42ea100cc does not exist.",
"target": "pipelinerun",
"details": null
}
}
Can some one please advise us how to achieve this?