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.
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/{workflowId}/createNewVersion
Content-Type: application/json
Content-length: 631
{
"workflow":{
"category": "joiner",
"description": "Configure new hire tasks for onboarding employees on their first day",
"displayName": "Global onboard new hire employee",
"isEnabled": true,
"isSchedulingEnabled": false,
"executionConditions": {
"@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
"scope": {
"@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
"rule": "(department eq 'Marketing')"
},
"trigger": {
"@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
"timeBasedAttribute": "employeeHireDate",
"offsetInDays": 1
}
},
"tasks": [
{
"continueOnError": false,
"description": "Enable user account in the directory",
"displayName": "Enable User Account",
"isEnabled": true,
"taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",
"arguments": []
},
{
"continueOnError": false,
"description": "Send welcome email to new hire",
"displayName": "Send Welcome Email",
"isEnabled": true,
"taskDefinitionId": "70b29d51-b59a-4773-9280-8841dfd3f2ea",
"arguments": []
}
]
}
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceCreateNewVersion.CreateNewVersionPostRequestBody
{
Workflow = new Microsoft.Graph.Beta.Models.IdentityGovernance.Workflow
{
Category = Microsoft.Graph.Beta.Models.IdentityGovernance.LifecycleWorkflowCategory.Joiner,
Description = "Configure new hire tasks for onboarding employees on their first day",
DisplayName = "Global onboard new hire employee",
IsEnabled = true,
IsSchedulingEnabled = false,
ExecutionConditions = new Microsoft.Graph.Beta.Models.IdentityGovernance.TriggerAndScopeBasedConditions
{
OdataType = "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
Scope = new Microsoft.Graph.Beta.Models.IdentityGovernance.RuleBasedSubjectSet
{
OdataType = "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
Rule = "(department eq 'Marketing')",
},
Trigger = new Microsoft.Graph.Beta.Models.IdentityGovernance.TimeBasedAttributeTrigger
{
OdataType = "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
TimeBasedAttribute = Microsoft.Graph.Beta.Models.IdentityGovernance.WorkflowTriggerTimeBasedAttribute.EmployeeHireDate,
OffsetInDays = 1,
},
},
Tasks = new List<Microsoft.Graph.Beta.Models.IdentityGovernance.TaskObject>
{
new Microsoft.Graph.Beta.Models.IdentityGovernance.TaskObject
{
ContinueOnError = false,
Description = "Enable user account in the directory",
DisplayName = "Enable User Account",
IsEnabled = true,
TaskDefinitionId = "6fc52c9d-398b-4305-9763-15f42c1676fc",
Arguments = new List<KeyValuePair>
{
},
},
new Microsoft.Graph.Beta.Models.IdentityGovernance.TaskObject
{
ContinueOnError = false,
Description = "Send welcome email to new hire",
DisplayName = "Send Welcome Email",
IsEnabled = true,
TaskDefinitionId = "70b29d51-b59a-4773-9280-8841dfd3f2ea",
Arguments = new List<KeyValuePair>
{
},
},
},
},
};
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceCreateNewVersion.PostAsync(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.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta identity-governance lifecycle-workflows workflows microsoft-graph-identity-governance-create-new-version post --workflow-id {workflow-id} --body '{\
"workflow":{\
"category": "joiner",\
"description": "Configure new hire tasks for onboarding employees on their first day",\
"displayName": "Global onboard new hire employee",\
"isEnabled": true,\
"isSchedulingEnabled": false,\
"executionConditions": {\
"@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",\
"scope": {\
"@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",\
"rule": "(department eq 'Marketing')"\
},\
"trigger": {\
"@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",\
"timeBasedAttribute": "employeeHireDate",\
"offsetInDays": 1\
}\
},\
"tasks": [\
{\
"continueOnError": false,\
"description": "Enable user account in the directory",\
"displayName": "Enable User Account",\
"isEnabled": true,\
"taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",\
"arguments": []\
},\
{\
"continueOnError": false,\
"description": "Send welcome email to new hire",\
"displayName": "Send Welcome Email",\
"isEnabled": true,\
"taskDefinitionId": "70b29d51-b59a-4773-9280-8841dfd3f2ea",\
"arguments": []\
}\
]\
}\
}\
'
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();
Workflow workflow = new Workflow();
workflow.category = LifecycleWorkflowCategory.JOINER;
workflow.description = "Configure new hire tasks for onboarding employees on their first day";
workflow.displayName = "Global onboard new hire employee";
workflow.isEnabled = true;
workflow.isSchedulingEnabled = false;
TriggerAndScopeBasedConditions executionConditions = new TriggerAndScopeBasedConditions();
RuleBasedSubjectSet scope = new RuleBasedSubjectSet();
scope.rule = "(department eq 'Marketing')";
executionConditions.scope = scope;
TimeBasedAttributeTrigger trigger = new TimeBasedAttributeTrigger();
trigger.timeBasedAttribute = WorkflowTriggerTimeBasedAttribute.EMPLOYEE_HIRE_DATE;
trigger.offsetInDays = 1;
executionConditions.trigger = trigger;
workflow.executionConditions = executionConditions;
LinkedList<Task> tasksList = new LinkedList<Task>();
Task tasks = new Task();
tasks.continueOnError = false;
tasks.description = "Enable user account in the directory";
tasks.displayName = "Enable User Account";
tasks.isEnabled = true;
tasks.taskDefinitionId = "6fc52c9d-398b-4305-9763-15f42c1676fc";
LinkedList<KeyValuePair> argumentsList = new LinkedList<KeyValuePair>();
tasks.arguments = argumentsList;
tasksList.add(tasks);
Task tasks1 = new Task();
tasks1.continueOnError = false;
tasks1.description = "Send welcome email to new hire";
tasks1.displayName = "Send Welcome Email";
tasks1.isEnabled = true;
tasks1.taskDefinitionId = "70b29d51-b59a-4773-9280-8841dfd3f2ea";
LinkedList<KeyValuePair> argumentsList1 = new LinkedList<KeyValuePair>();
tasks1.arguments = argumentsList1;
tasksList.add(tasks1);
TaskCollectionResponse taskCollectionResponse = new TaskCollectionResponse();
taskCollectionResponse.value = tasksList;
TaskCollectionPage taskCollectionPage = new TaskCollectionPage(taskCollectionResponse, null);
workflow.tasks = taskCollectionPage;
graphClient.identityGovernance().lifecycleWorkflows().workflows("{workflowId}")
.createNewVersion(WorkflowCreateNewVersionParameterSet
.newBuilder()
.withWorkflow(workflow)
.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.
const options = {
authProvider,
};
const client = Client.init(options);
const workflow = {
workflow: {
category: 'joiner',
description: 'Configure new hire tasks for onboarding employees on their first day',
displayName: 'Global onboard new hire employee',
isEnabled: true,
isSchedulingEnabled: false,
executionConditions: {
'@odata.type': '#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions',
scope: {
'@odata.type': '#microsoft.graph.identityGovernance.ruleBasedSubjectSet',
rule: '(department eq \'Marketing\')'
},
trigger: {
'@odata.type': '#microsoft.graph.identityGovernance.timeBasedAttributeTrigger',
timeBasedAttribute: 'employeeHireDate',
offsetInDays: 1
}
},
tasks: [
{
continueOnError: false,
description: 'Enable user account in the directory',
displayName: 'Enable User Account',
isEnabled: true,
taskDefinitionId: '6fc52c9d-398b-4305-9763-15f42c1676fc',
arguments: []
},
{
continueOnError: false,
description: 'Send welcome email to new hire',
displayName: 'Send Welcome Email',
isEnabled: true,
taskDefinitionId: '70b29d51-b59a-4773-9280-8841dfd3f2ea',
arguments: []
}
]
}
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/{workflowId}/createNewVersion')
.version('beta')
.post(workflow);
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.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CreateNewVersionPostRequestBody();
$workflow = new Workflow();
$workflow->setCategory(new LifecycleWorkflowCategory('joiner'));
$workflow->setDescription('Configure new hire tasks for onboarding employees on their first day');
$workflow->setDisplayName('Global onboard new hire employee');
$workflow->setIsEnabled(true);
$workflow->setIsSchedulingEnabled(false);
$workflowExecutionConditions = new TriggerAndScopeBasedConditions();
$workflowExecutionConditions->setOdataType('#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions');
$workflowExecutionConditionsScope = new RuleBasedSubjectSet();
$workflowExecutionConditionsScope->setOdataType('#microsoft.graph.identityGovernance.ruleBasedSubjectSet');
$workflowExecutionConditionsScope->setRule('(department eq \'Marketing\')');
$workflowExecutionConditions->setScope($workflowExecutionConditionsScope);
$workflowExecutionConditionsTrigger = new TimeBasedAttributeTrigger();
$workflowExecutionConditionsTrigger->setOdataType('#microsoft.graph.identityGovernance.timeBasedAttributeTrigger');
$workflowExecutionConditionsTrigger->setTimeBasedAttribute(new WorkflowTriggerTimeBasedAttribute('employeeHireDate'));
$workflowExecutionConditionsTrigger->setOffsetInDays(1);
$workflowExecutionConditions->setTrigger($workflowExecutionConditionsTrigger);
$workflow->setExecutionConditions($workflowExecutionConditions);
$tasksTask1 = new Task();
$tasksTask1->setContinueOnError(false);
$tasksTask1->setDescription('Enable user account in the directory');
$tasksTask1->setDisplayName('Enable User Account');
$tasksTask1->setIsEnabled(true);
$tasksTask1->setTaskDefinitionId('6fc52c9d-398b-4305-9763-15f42c1676fc');
$tasksTask1->setArguments([ ]);
$tasksArray []= $tasksTask1;
$tasksTask2 = new Task();
$tasksTask2->setContinueOnError(false);
$tasksTask2->setDescription('Send welcome email to new hire');
$tasksTask2->setDisplayName('Send Welcome Email');
$tasksTask2->setIsEnabled(true);
$tasksTask2->setTaskDefinitionId('70b29d51-b59a-4773-9280-8841dfd3f2ea');
$tasksTask2->setArguments([ ]);
$tasksArray []= $tasksTask2;
$workflow->setTasks($tasksArray);
$requestBody->setWorkflow($workflow);
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceCreateNewVersion()->post($requestBody)->wait();
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.
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
workflow = @{
category = "joiner"
description = "Configure new hire tasks for onboarding employees on their first day"
displayName = "Global onboard new hire employee"
isEnabled = $true
isSchedulingEnabled = $false
executionConditions = @{
"@odata.type" = "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions"
scope = @{
"@odata.type" = "#microsoft.graph.identityGovernance.ruleBasedSubjectSet"
rule = "(department eq 'Marketing')"
}
trigger = @{
"@odata.type" = "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger"
timeBasedAttribute = "employeeHireDate"
offsetInDays =
}
}
tasks = @(
@{
continueOnError = $false
description = "Enable user account in the directory"
displayName = "Enable User Account"
isEnabled = $true
taskDefinitionId = "6fc52c9d-398b-4305-9763-15f42c1676fc"
arguments = @(
)
}
@{
continueOnError = $false
description = "Send welcome email to new hire"
displayName = "Send Welcome Email"
isEnabled = $true
taskDefinitionId = "70b29d51-b59a-4773-9280-8841dfd3f2ea"
arguments = @(
)
}
)
}
}
New-MgBetaIdentityGovernanceLifecycleWorkflowNewVersion -WorkflowId $workflowId -BodyParameter $params
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 PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = CreateNewVersionPostRequestBody(
workflow = Workflow(
category = LifecycleWorkflowCategory.Joiner,
description = "Configure new hire tasks for onboarding employees on their first day",
display_name = "Global onboard new hire employee",
is_enabled = True,
is_scheduling_enabled = False,
execution_conditions = TriggerAndScopeBasedConditions(
odata_type = "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
scope = RuleBasedSubjectSet(
odata_type = "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
rule = "(department eq 'Marketing')",
),
trigger = TimeBasedAttributeTrigger(
odata_type = "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
time_based_attribute = WorkflowTriggerTimeBasedAttribute.EmployeeHireDate,
offset_in_days = 1,
),
),
tasks = [
Task(
continue_on_error = False,
description = "Enable user account in the directory",
display_name = "Enable User Account",
is_enabled = True,
task_definition_id = "6fc52c9d-398b-4305-9763-15f42c1676fc",
arguments = [
]
),
Task(
continue_on_error = False,
description = "Send welcome email to new hire",
display_name = "Send Welcome Email",
is_enabled = True,
task_definition_id = "70b29d51-b59a-4773-9280-8841dfd3f2ea",
arguments = [
]
),
]
),
)
result = await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_create_new_version.post(body = request_body)
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.
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/{workflowId}/createNewVersion
Content-Type: application/json
Content-length: 631
{
"category": "joiner",
"description": "Configure new hire tasks for onboarding employees on their first day",
"displayName": "custom email marketing API test",
"isEnabled": true,
"isSchedulingEnabled": false,
"executionConditions": {
"@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
"scope": {
"@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
"rule": "(department eq 'Marketing')"
},
"trigger": {
"@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
"timeBasedAttribute": "employeeHireDate",
"offsetInDays": 0
}
},
"tasks": [
{
"continueOnError": false,
"description": "Enable user account in the directory",
"displayName": "Enable User Account",
"isEnabled": true,
"taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",
"arguments": []
},
{
"continueOnError": false,
"description": "Send welcome email to new hire",
"displayName": "Send Welcome Email",
"isEnabled": true,
"taskDefinitionId": "70b29d51-b59a-4773-9280-8841dfd3f2ea",
"arguments": [
{
"name": "cc",
"value": "1baa57fa-3c4e-4526-ba5a-db47a9df95f0"
},
{
"name": "customSubject",
"value": "Welcome to the organization {{userDisplayName}}!"
},
{
"name": "customBody",
"value": "Welcome to our organization {{userGivenName}}!"
},
{
"name": "locale",
"value": "en-us"
}
]
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceCreateNewVersion.CreateNewVersionPostRequestBody
{
AdditionalData = new Dictionary<string, object>
{
{
"category" , "joiner"
},
{
"description" , "Configure new hire tasks for onboarding employees on their first day"
},
{
"displayName" , "custom email marketing API test"
},
{
"isEnabled" , true
},
{
"isSchedulingEnabled" , false
},
{
"executionConditions" , new
{
OdataType = "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
Scope = new
{
OdataType = "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
Rule = "(department eq 'Marketing')",
},
Trigger = new
{
OdataType = "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
TimeBasedAttribute = "employeeHireDate",
OffsetInDays = 0,
},
}
},
{
"tasks" , new List<object>
{
new
{
ContinueOnError = false,
Description = "Enable user account in the directory",
DisplayName = "Enable User Account",
IsEnabled = true,
TaskDefinitionId = "6fc52c9d-398b-4305-9763-15f42c1676fc",
Arguments = new List<object>
{
},
},
new
{
ContinueOnError = false,
Description = "Send welcome email to new hire",
DisplayName = "Send Welcome Email",
IsEnabled = true,
TaskDefinitionId = "70b29d51-b59a-4773-9280-8841dfd3f2ea",
Arguments = new List<object>
{
new
{
Name = "cc",
Value = "1baa57fa-3c4e-4526-ba5a-db47a9df95f0",
},
new
{
Name = "customSubject",
Value = "Welcome to the organization {{userDisplayName}}!",
},
new
{
Name = "customBody",
Value = "Welcome to our organization {{userGivenName}}!",
},
new
{
Name = "locale",
Value = "en-us",
},
},
},
}
},
},
};
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceCreateNewVersion.PostAsync(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.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta identity-governance lifecycle-workflows workflows microsoft-graph-identity-governance-create-new-version post --workflow-id {workflow-id} --body '{\
"category": "joiner",\
"description": "Configure new hire tasks for onboarding employees on their first day",\
"displayName": "custom email marketing API test",\
"isEnabled": true,\
"isSchedulingEnabled": false,\
"executionConditions": {\
"@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",\
"scope": {\
"@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",\
"rule": "(department eq 'Marketing')"\
},\
"trigger": {\
"@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",\
"timeBasedAttribute": "employeeHireDate",\
"offsetInDays": 0\
}\
},\
"tasks": [\
{\
"continueOnError": false,\
"description": "Enable user account in the directory",\
"displayName": "Enable User Account",\
"isEnabled": true,\
"taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",\
"arguments": []\
},\
{\
"continueOnError": false,\
"description": "Send welcome email to new hire",\
"displayName": "Send Welcome Email",\
"isEnabled": true,\
"taskDefinitionId": "70b29d51-b59a-4773-9280-8841dfd3f2ea",\
"arguments": [\
{\
"name": "cc",\
"value": "1baa57fa-3c4e-4526-ba5a-db47a9df95f0"\
},\
{\
"name": "customSubject",\
"value": "Welcome to the organization {{userDisplayName}}!"\
},\
{\
"name": "customBody",\
"value": "Welcome to our organization {{userGivenName}}!"\
},\
{\
"name": "locale",\
"value": "en-us"\
}\
]\
}\
]\
}\
\
'
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.
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.
const options = {
authProvider,
};
const client = Client.init(options);
const workflow = {
category: 'joiner',
description: 'Configure new hire tasks for onboarding employees on their first day',
displayName: 'custom email marketing API test',
isEnabled: true,
isSchedulingEnabled: false,
executionConditions: {
'@odata.type': '#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions',
scope: {
'@odata.type': '#microsoft.graph.identityGovernance.ruleBasedSubjectSet',
rule: '(department eq \'Marketing\')'
},
trigger: {
'@odata.type': '#microsoft.graph.identityGovernance.timeBasedAttributeTrigger',
timeBasedAttribute: 'employeeHireDate',
offsetInDays: 0
}
},
tasks: [
{
continueOnError: false,
description: 'Enable user account in the directory',
displayName: 'Enable User Account',
isEnabled: true,
taskDefinitionId: '6fc52c9d-398b-4305-9763-15f42c1676fc',
arguments: []
},
{
continueOnError: false,
description: 'Send welcome email to new hire',
displayName: 'Send Welcome Email',
isEnabled: true,
taskDefinitionId: '70b29d51-b59a-4773-9280-8841dfd3f2ea',
arguments: [
{
name: 'cc',
value: '1baa57fa-3c4e-4526-ba5a-db47a9df95f0'
},
{
name: 'customSubject',
value: 'Welcome to the organization {{userDisplayName}}!'
},
{
name: 'customBody',
value: 'Welcome to our organization {{userGivenName}}!'
},
{
name: 'locale',
value: 'en-us'
}
]
}
]
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/{workflowId}/createNewVersion')
.version('beta')
.post(workflow);
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.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CreateNewVersionPostRequestBody();
$additionalData = [
'category' => 'joiner',
'description' => 'Configure new hire tasks for onboarding employees on their first day',
'displayName' => 'custom email marketing API test',
'isEnabled' => true,
'isSchedulingEnabled' => false,
'executionConditions' => [
'@odata.type' => '#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions',
'scope' => [
'@odata.type' => '#microsoft.graph.identityGovernance.ruleBasedSubjectSet',
'rule' => '(department eq \'Marketing\')',
],
'trigger' => [
'@odata.type' => '#microsoft.graph.identityGovernance.timeBasedAttributeTrigger',
'timeBasedAttribute' => 'employeeHireDate',
'offsetInDays' => 0,
],
],
'tasks' => [
[
'continueOnError' => false,
'description' => 'Enable user account in the directory',
'displayName' => 'Enable User Account',
'isEnabled' => true,
'taskDefinitionId' => '6fc52c9d-398b-4305-9763-15f42c1676fc',
'arguments' => [],
],
[
'continueOnError' => false,
'description' => 'Send welcome email to new hire',
'displayName' => 'Send Welcome Email',
'isEnabled' => true,
'taskDefinitionId' => '70b29d51-b59a-4773-9280-8841dfd3f2ea',
'arguments' => [
[
'name' => 'cc',
'value' => '1baa57fa-3c4e-4526-ba5a-db47a9df95f0',
],
[
'name' => 'customSubject',
'value' => 'Welcome to the organization {{userDisplayName}}!',
],
[
'name' => 'customBody',
'value' => 'Welcome to our organization {{userGivenName}}!',
],
[
'name' => 'locale',
'value' => 'en-us',
],
],
],
],
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceCreateNewVersion()->post($requestBody)->wait();
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.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = CreateNewVersionPostRequestBody(
additional_data = {
"category" : "joiner",
"description" : "Configure new hire tasks for onboarding employees on their first day",
"display_name" : "custom email marketing API test",
"is_enabled" : True,
"is_scheduling_enabled" : False,
"execution_conditions" : (
odata_type = "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
scope = (
odata_type = "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
rule = "(department eq 'Marketing')",
),
trigger = (
odata_type = "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
time_based_attribute = "employeeHireDate",
offset_in_days = 0,
),
),
"tasks" : [
(
continue_on_error = False,
description = "Enable user account in the directory",
display_name = "Enable User Account",
is_enabled = True,
task_definition_id = "6fc52c9d-398b-4305-9763-15f42c1676fc",
arguments = [
]
),
(
continue_on_error = False,
description = "Send welcome email to new hire",
display_name = "Send Welcome Email",
is_enabled = True,
task_definition_id = "70b29d51-b59a-4773-9280-8841dfd3f2ea",
arguments = [
(
name = "cc",
value = "1baa57fa-3c4e-4526-ba5a-db47a9df95f0",
),
(
name = "customSubject",
value = "Welcome to the organization {{userDisplayName}}!",
),
(
name = "customBody",
value = "Welcome to our organization {{userGivenName}}!",
),
(
name = "locale",
value = "en-us",
),
]
),
]
}
)
result = await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_create_new_version.post(body = request_body)
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.