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.
Run a workflow object on-demand. You can run any workflow on-demand, including scheduled workflows. Workflows created from the "Real-time employee termination" template are run on-demand only. When you run a workflow on demand, the tasks are executed regardless of whether the user state matches the scope and trigger execution conditions.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
LifecycleWorkflows.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
LifecycleWorkflows.ReadWrite.All
For delegated scenarios, the admin needs one of the following Azure AD roles:
Global administrator
Lifecycle workflows administrator
HTTP request
POST /identityGovernance/lifecycleWorkflows/workflows/{workflowId}/activate
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
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.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var subjects = new List<User>()
{
new User
{
Id = "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97"
},
new User
{
Id = "ea09ac2e-77e3-4134-85f2-25ccf3c33387"
}
};
await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{identityGovernance.workflow-id}"]
.Activate(subjects)
.Request()
.PostAsync();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<User> subjectsList = new LinkedList<User>();
User subjects = new User();
subjects.id = "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97";
subjectsList.add(subjects);
User subjects1 = new User();
subjects1.id = "ea09ac2e-77e3-4134-85f2-25ccf3c33387";
subjectsList.add(subjects1);
UserCollectionResponse userCollectionResponse = new UserCollectionResponse();
userCollectionResponse.value = subjectsList;
UserCollectionPage userCollectionPage = new UserCollectionPage(userCollectionResponse, null);
graphClient.identityGovernance().lifecycleWorkflows().workflows("14879e66-9ea9-48d0-804d-8fea672d0341")
.activate(WorkflowActivateParameterSet
.newBuilder()
.withSubjects(subjectsList)
.build())
.buildRequest()
.post();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewActivatePostRequestBody()
user := graphmodels.NewUser()
id := "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97"
user.SetId(&id)
user1 := graphmodels.NewUser()
id := "ea09ac2e-77e3-4134-85f2-25ccf3c33387"
user1.SetId(&id)
subjects := []graphmodels.Objectable {
user,
user1,
}
requestBody.SetSubjects(subjects)
graphClient.IdentityGovernance().LifecycleWorkflows().WorkflowsById("workflow-id").Activate().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new ActivatePostRequestBody();
$subjectsUser1 = new User();
$subjectsUser1->setId('8cdf25a8-c9d2-423e-a03d-3f39f03c3e97');
$subjectsArray []= $subjectsUser1;
$subjectsUser2 = new User();
$subjectsUser2->setId('ea09ac2e-77e3-4134-85f2-25ccf3c33387');
$subjectsArray []= $subjectsUser2;
$requestBody->setSubjects($subjectsArray);
$graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflowsById('workflow-id')->activate()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.