Edit

Share via


workflow: previewTaskFailures

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.

Validate the tasks configured in a workflow to check for configuration errors. This action identifies any tasks that would fail during execution, allowing you to fix issues before running the workflow. Returns an empty collection if no task failures are detected.

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

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. Global Reader and Lifecycle Workflows Administrator are the least privileged roles supported for this operation.

HTTP request

POST /identityGovernance/lifecycleWorkflows/workflows/{workflow-id}/previewTaskFailures

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

Don't supply a request body for this method.

Response

If successful, this action returns a 200 OK response code and a collection of previewFailedTasks objects in the response body. If no task failures are detected, an empty collection is returned.

Examples

Example 1: Workflow with task failures

The following example shows a request that validates a workflow and returns task failures.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/14879e66-9ea9-48d0-804d-8fea672d0341/previewTaskFailures

Response

The following example shows the response.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.identityGovernance.previewFailedTask)",
  "value": [
    {
      "name": "Generate Temporary Access Pass",
      "definitionId": "1b555e50-7f65-41d5-b514-5894a026d10d",
      "failureReason": "The logged-in user does not have sufficient privileges to generate a TAP. Required role: Authentication Policy Administrator",
      "taskId": "8bb25690-6104-4e29-943e-1f67b8e662f5"
    }
  ]
}

Example 2: Workflow with no task failures

The following example shows a request that validates a workflow with no configuration issues.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/previewTaskFailures

Response

The following example shows the response.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.identityGovernance.previewFailedTask)",
  "value": []
}