创建工作流

命名空间: microsoft.graph.identityGovernance

创建新的 工作流 对象。 一个租户中最多可以创建 100 个工作流。

此 API 可用于以下国家级云部署。

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国
✅ ✅ ✅ ✅

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) LifecycleWorkflows-Workflow.ReadWrite.All LifecycleWorkflows.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 LifecycleWorkflows-Workflow.ReadWrite.All LifecycleWorkflows.ReadWrite.All

重要

对于使用工作或学校帐户的委派访问权限,必须为登录用户分配受支持的 Microsoft Entra 角色或授予此操作所需权限的自定义角色。 生命周期工作流管理员是 此操作支持的最小特权角色。

HTTP 请求

POST /identityGovernance/lifecycleWorkflows/workflows

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权。
Content-Type application/json. 必需。

请求正文

在请求正文中,提供 工作流 对象的 JSON 表示形式。

创建 工作流时,可以指定以下属性。

属性 类型 说明
“类别” microsoft.graph.identityGovernance.lifecycleWorkflowCategory 工作流的类别。 可能的值包括 joiner、leaver、unknownFutureValue。 只能是一个值。 必需。
description String 描述工作流用于管理用途的目的的字符串。
displayName String 标识工作流的唯一字符串。 必填。
executionConditions microsoft.graph.identityGovernance.workflowExecutionConditions 定义工作流运行的人员和时间。 必需。
id String 用于单独处理特定工作流的标识符。
isEnabled Boolean 一个布尔值,指示工作流是否设置为运行。
isSchedulingEnabled 布尔值 一个布尔值,表示是否启用了计划。
tasks microsoft.graph.identityGovernance.task 集合 表示要执行的配置任务及其在工作流中的执行顺序。 必填。

响应

如果成功,此方法将在响应正文中返回 201 Created 响应代码和 microsoft.graph.identityGovernance.workflow 对象。

示例

示例 1:创建新工作流

请求

以下示例演示了使用以下配置创建工作流的请求:

  • 这是一个已启用并计划运行的“joiner”工作流。
  • 它针对澳大利亚的新用户根据其 employeeHireDate 运行。
  • 工作流运行时将执行两项任务:启用用户帐户和向用户发送“欢迎”电子邮件。
POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
    "category": "joiner",
    "description": "Configure new hire tasks for onboarding employees on their first day",
    "displayName": "Australia Onboard new hire employee",
    "isEnabled": true,
    "isSchedulingEnabled": true,
    "executionConditions": {
        "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
        "scope": {
            "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
            "rule": "(country eq 'Australia')"
        },
        "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": []
        }
    ]
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 201 Created
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
    "category": "joiner",
    "description": "Configure new hire tasks for onboarding employees on their first day",
    "displayName": "New Zealand new hire",
    "lastModifiedDateTime": "2022-08-26T04:51:27.521792Z",
    "createdDateTime": "2022-08-26T04:51:27.5217824Z",
    "deletedDateTime": null,
    "id": "818cd47f-138c-4a83-b3f5-afa92bfcf391",
    "isEnabled": true,
    "isSchedulingEnabled": false,
    "nextScheduleRunDateTime": null,
    "version": 1,
    "executionConditions": {
        "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
        "scope": {
            "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
            "rule": "(country eq 'New Zealand')"
        },
        "trigger": {
            "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
            "timeBasedAttribute": "employeeHireDate",
            "offsetInDays": 0
        }
    }
}

示例 2:使用自定义电子邮件创建任务的新版本

请求

以下示例显示了一个请求。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
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"
                }
            ]
        }
    ]
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-Type: application/json

{
    "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": [
                    {
                    "name": "cc",
                    "value": "b47471b9-af8f-4a5a-bfa2-b78e82398f6e, a7a23ce0-909b-40b9-82cf-95d31f0aaca2"
                },
                {
                "name": "customSubject",
                "value": "Welcome to the organization {{userDisplayName}}!"
                },
                {
                "name": "customBody",
                "value": "Welcome to our organization {{userGivenName}} {{userSurname}}. \nFor more information, reach out to your manager {{managerDisplayName}} at {{managerEmail}}."
                },
                {
                "name": "locale",
                "value": "en-us"
                }, 
    ]
            }
        ]
    }
}

示例 3:创建具有设定目标范围的移动程序工作流

请求

以下示例演示了使用以下配置创建工作流的请求:

  • 它是一个启用“移动器”工作流,并设置为仅按需运行。
  • 它为管理单元“4f9dc456-0574-4122-9e55-8b4cc494b27d”和“2c987843-e9b1-4b1a-b924-ff1d2a9b054d”的设置目标范围内的用户运行。
  • 执行一项任务,即发送电子邮件以通知用户的经理移动。
POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "mover",
  "displayName": "On Demand workflow move",
  "description": "Execute real-time tasks for employee job changes",
  "tasks": [
    {
      "arguments": [],
      "description": "Send email to notify user's manager of user move",
      "displayName": "Send email to notify manager of user move",
      "isEnabled": true,
      "continueOnError": false,
      "taskDefinitionId": "aab41899-9972-422a-9d97-f626014578b7",
      "category": "mover"
    }
  ],
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.onDemandExecutionOnly"
  },
  "isEnabled": true,
  "isSchedulingEnabled": false,
  "administrationScopeTargets": [
    {
      "@odata.type": "#microsoft.graph.administrativeUnit",
      "id": "4f9dc456-0574-4122-9e55-8b4cc494b27d"
    },
    {
      "@odata.type": "#microsoft.graph.administrativeUnit",
      "id": "2c987843-e9b1-4b1a-b924-ff1d2a9b054d"
    }
  ]
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "category": "mover",
  "description": "Execute real-time tasks for employee job changes",
  "displayName": "On Demand workflow move",
  "isEnabled": true,
  "isSchedulingEnabled": false,
  "lastModifiedDateTime": "2025-01-09T15:28:24.0565594Z",
  "createdDateTime": "2025-01-09T15:28:24.0565526Z",
  "id": "465d0d08-3099-483f-9d93-16aad77bcd22",
  "version": 1,
  "administrationScopeTargets": [
    {
      "@odata.type": "#microsoft.graph.administrativeUnit",
      "id": "4f9dc456-0574-4122-9e55-8b4cc494b27d"
    },
    {
      "@odata.type": "#microsoft.graph.administrativeUnit",
      "id": "2c987843-e9b1-4b1a-b924-ff1d2a9b054d"
    }
  ]
}

示例 4:创建在招聘日期前 7 天运行的工作流

请求

以下示例创建了一个联接者工作流,该工作流在用户雇用日期前 7 天运行,并生成要发送给用户经理的临时访问通行证。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "joiner",
  "displayName": "Pre-hire onboarding: 7 days before hire",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Engineering')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeHireDate",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorEqualTo",
        "eventTiming": "before",
        "offsetInDays": 7
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "1b555e50-7f65-41d5-b514-5894a026d10d",
      "displayName": "Generate Temporary Access Pass and send via email to user's manager",
      "arguments": [
        {
          "name": "tapLifetimeMinutes",
          "value": "480"
        },
        {
          "name": "tapIsUsableOnce",
          "value": "false"
        }
      ]
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "c35e0d2a-8725-4aa1-b132-6b21a80635b5",
  "category": "joiner",
  "displayName": "Pre-hire onboarding: 7 days before hire",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}

示例 5:在休假日期后 60 天内为用户创建工作流

请求

以下示例创建了一个离职者工作流,该工作流确定休假日期为 60 天或更短的用户的范围,并向其经理发送退职电子邮件。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "leaver",
  "displayName": "Post-leave notification: within 60 days after leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Finance')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeLeaveDateTime",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorLessThanEqualTo",
        "eventTiming": "after",
        "offsetInDays": 60
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "6f22ddd4-b3a5-47a4-a846-0d7c201a49ce",
      "displayName": "Send offboarding email to user's manager after their last day",
      "arguments": []
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "83d68cba-56c0-4412-8bf7-1af2befc1333",
  "category": "leaver",
  "displayName": "Post-leave notification: within 60 days after leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}

示例 6:为 7 到 30 天前雇用的用户创建工作流

请求

以下示例创建一个联接器工作流,该工作流将范围确定雇用时间超过 7 天且不到 30 天的用户,并发送载入提醒电子邮件。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "joiner",
  "displayName": "Post-hire check-in: 7 to 30 days after hire",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Engineering')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeHireDate",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorBetween",
        "eventTiming": "after",
        "greaterThanOffsetInDays": 7,
        "lessThanOffsetInDays": 30
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "3c860712-2d37-42a4-928f-5c93935d26a1",
      "displayName": "Send onboarding reminder email",
      "arguments": []
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "445ffc46-3ccc-4e1a-bac9-aef675ee8d18",
  "category": "joiner",
  "displayName": "Post-hire check-in: 7 to 30 days after hire",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}

示例 7:为休假日期前 3 天到 14 天的用户创建工作流

请求

以下示例创建了一个离职者工作流,该工作流确定离职日期超过三天且在未来 14 天内的用户的范围,并在最后一天之前向其经理发送电子邮件。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "leaver",
  "displayName": "Pre-leave prep: 3 to 14 days before leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Engineering')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeLeaveDateTime",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorBetween",
        "eventTiming": "before",
        "greaterThanOffsetInDays": 3,
        "lessThanOffsetInDays": 14
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "52853a3e-f4e5-4eb8-bb24-1ac09a1da935",
      "displayName": "Send email to manager before user last day",
      "arguments": []
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "6bc1a524-6df8-4cfd-ac6d-caf9f88b3702",
  "category": "leaver",
  "displayName": "Pre-leave prep: 3 to 14 days before leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}

示例 8:创建在招聘日期运行的工作流

请求

以下示例创建了一个在用户的雇用日期运行并启用用户帐户的联接器工作流。 在 offsetInDays 时0eventTiming,必须设置为 on。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "joiner",
  "displayName": "Day-of-hire: enable account",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Engineering')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeHireDate",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorEqualTo",
        "eventTiming": "on",
        "offsetInDays": 0
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",
      "displayName": "Enable user account",
      "arguments": []
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "275fb885-528a-46f1-b5cf-cfdfb7069824",
  "category": "joiner",
  "displayName": "Day-of-hire: enable account",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}

示例 9:创建在休假日期后 30 天运行的工作流

请求

以下示例创建一个离职者工作流,该工作流在用户休假日期后 30 天运行,并删除用户的帐户。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "leaver",
  "displayName": "Post-leave cleanup: 30 days after leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Engineering')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeLeaveDateTime",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorEqualTo",
        "eventTiming": "after",
        "offsetInDays": 30
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "8d18588d-9ad3-4c0f-99d0-ec215f0e3dff",
      "displayName": "Delete user",
      "arguments": []
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "83b77dc5-751d-4640-b628-69d949b09bac",
  "category": "leaver",
  "displayName": "Post-leave cleanup: 30 days after leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}

示例 10:为休假日期后 14 天内的用户创建工作流

请求

以下示例创建了一个离职者工作流,该工作流确定未来休假日期为 14 天或更短的用户的范围,并在最后一天之前向其经理发送电子邮件。

POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
Content-Type: application/json

{
  "category": "leaver",
  "displayName": "Pre-leave: within 14 days of leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(department eq 'Engineering')"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTriggerV2",
      "attribute": "employeeLeaveDateTime",
      "operator": {
        "@odata.type": "#microsoft.graph.identityGovernance.operatorLessThanEqualTo",
        "eventTiming": "before",
        "offsetInDays": 14
      }
    }
  },
  "tasks": [
    {
      "isEnabled": true,
      "taskDefinitionId": "52853a3e-f4e5-4eb8-bb24-1ac09a1da935",
      "displayName": "Send email to manager before user last day",
      "arguments": []
    }
  ]
}

响应

以下示例显示了相应的响应。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "b784cf0f-1b6e-4e04-bb24-d2af0261514d",
  "category": "leaver",
  "displayName": "Pre-leave: within 14 days of leave",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1
}