Namespace: microsoft.graph.identityGovernance
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Cancel one or more workflow runs that are currently in queued or inProgress status. Currently limited to canceling one run per request.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
LifecycleWorkflows-Workflow.ReadWrite.All |
LifecycleWorkflows.ReadWrite.All |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
LifecycleWorkflows-Workflow.ReadWrite.All |
LifecycleWorkflows.ReadWrite.All |
Important
For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. Lifecycle Workflows Administrator is the least privileged role supported for this operation.
HTTP request
POST /identityGovernance/lifecycleWorkflows/workflows/{workflow-id}/cancelProcessing
Request body
In the request body, supply a JSON representation of the parameters.
The following table shows the parameters that are required with this action.
cancelRunsScope properties
When using cancelRunsScope, the @odata.type property is required in the request body.
| Property |
Type |
Description |
| @odata.type |
String |
Must be #microsoft.graph.identityGovernance.cancelRunsScope. Required. |
| runs |
microsoft.graph.identityGovernance.run collection |
The workflow runs to cancel. Currently limited to one run per request. Required. |
Response
If successful, this action returns a 204 No Content response code.
Examples
Example 1: Successfully cancel a workflow run
The following example shows a request that successfully cancels a single workflow run.
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/14879e66-9ea9-48d0-804d-8fea672d0341/cancelProcessing
Content-Type: application/json
{
"scope": {
"@odata.type": "#microsoft.graph.identityGovernance.cancelRunsScope",
"runs": [
{
"id": "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97"
}
]
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceCancelProcessing;
using Microsoft.Graph.Beta.Models.IdentityGovernance;
var requestBody = new CancelProcessingPostRequestBody
{
Scope = new CancelRunsScope
{
OdataType = "#microsoft.graph.identityGovernance.cancelRunsScope",
Runs = new List<Run>
{
new Run
{
Id = "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceCancelProcessing.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/identitygovernance"
graphmodelsidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/models/identitygovernance"
//other-imports
)
requestBody := graphidentitygovernance.NewCancelProcessingPostRequestBody()
scope := graphmodelsidentitygovernance.NewCancelRunsScope()
run := graphmodelsidentitygovernance.NewRun()
id := "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97"
run.SetId(&id)
runs := []graphmodelsidentitygovernance.Runable {
run,
}
scope.SetRuns(runs)
requestBody.SetScope(scope)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.IdentityGovernance().LifecycleWorkflows().Workflows().ByWorkflowId("workflow-id").MicrosoftGraphIdentityGovernanceCancelProcessing().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernancecancelprocessing.CancelProcessingPostRequestBody cancelProcessingPostRequestBody = new com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernancecancelprocessing.CancelProcessingPostRequestBody();
com.microsoft.graph.beta.models.identitygovernance.CancelRunsScope scope = new com.microsoft.graph.beta.models.identitygovernance.CancelRunsScope();
scope.setOdataType("#microsoft.graph.identityGovernance.cancelRunsScope");
LinkedList<com.microsoft.graph.beta.models.identitygovernance.Run> runs = new LinkedList<com.microsoft.graph.beta.models.identitygovernance.Run>();
com.microsoft.graph.beta.models.identitygovernance.Run run = new com.microsoft.graph.beta.models.identitygovernance.Run();
run.setId("8cdf25a8-c9d2-423e-a03d-3f39f03c3e97");
runs.add(run);
scope.setRuns(runs);
cancelProcessingPostRequestBody.setScope(scope);
graphClient.identityGovernance().lifecycleWorkflows().workflows().byWorkflowId("{workflow-id}").microsoftGraphIdentityGovernanceCancelProcessing().post(cancelProcessingPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const cancelProcessing = {
scope: {
'@odata.type': '#microsoft.graph.identityGovernance.cancelRunsScope',
runs: [
{
id: '8cdf25a8-c9d2-423e-a03d-3f39f03c3e97'
}
]
}
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/14879e66-9ea9-48d0-804d-8fea672d0341/cancelProcessing')
.version('beta')
.post(cancelProcessing);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\IdentityGovernance\LifecycleWorkflows\Workflows\Item\MicrosoftGraphIdentityGovernanceCancelProcessing\CancelProcessingPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\CancelRunsScope;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\Run;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CancelProcessingPostRequestBody();
$scope = new CancelRunsScope();
$scope->setOdataType('#microsoft.graph.identityGovernance.cancelRunsScope');
$runsRun1 = new Run();
$runsRun1->setId('8cdf25a8-c9d2-423e-a03d-3f39f03c3e97');
$runsArray []= $runsRun1;
$scope->setRuns($runsArray);
$requestBody->setScope($scope);
$graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceCancelProcessing()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identitygovernance.lifecycleworkflows.workflows.item.microsoft_graph_identity_governance_cancel_processing.cancel_processing_post_request_body import CancelProcessingPostRequestBody
from msgraph_beta.generated.models.identity_governance.cancel_runs_scope import CancelRunsScope
from msgraph_beta.generated.models.identity_governance.run import Run
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CancelProcessingPostRequestBody(
scope = CancelRunsScope(
odata_type = "#microsoft.graph.identityGovernance.cancelRunsScope",
runs = [
Run(
id = "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97",
),
],
),
)
await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_cancel_processing.post(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content