Skip to content

Latest commit

 

History

History
331 lines (273 loc) · 11.9 KB

File metadata and controls

331 lines (273 loc) · 11.9 KB
title Get workflow
description Read the properties and relationships of a workflow object.
author AlexFilipin
ms.localizationpriority medium
ms.subservice entra-id-governance
doc_type apiPageType
ms.date 04/05/2024

Get workflow

Namespace: microsoft.graph.identityGovernance

[!INCLUDE beta-disclaimer]

Read the properties and relationships of a workflow object.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

[!INCLUDE rbac-lifecycle-workflows-apis-read]

HTTP request

GET /identityGovernance/lifecycleWorkflows/workflows/{workflowId}

Optional query parameters

This method supports the $select and $expand OData query parameters to help customize the response. The tasks relationship is expanded by default and $expand is supported by the createdBy and lastModifiedBy relationships. For general information, see OData query parameters.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a microsoft.graph.identityGovernance.workflow object in the response body.

Examples

Example 1: Retrieve the details of a workflow

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/156ce798-1eb6-4e0a-8515-e79f54d04390

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
    "category": "joiner",
    "description": "Configure new hire tasks for onboarding employees on their first day",
    "displayName": "Onboard new hire employee",
    "lastModifiedDateTime": "2022-08-24T15:39:17.6496744Z",
    "createdDateTime": "2022-08-24T15:39:17.6496704Z",
    "deletedDateTime": null,
    "id": "156ce798-1eb6-4e0a-8515-e79f54d04390",
    "isEnabled": true,
    "isSchedulingEnabled": false,
    "nextScheduleRunDateTime": null,
    "version": 1,
    "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
        }
    },
    "lastModifiedBy": {
        "id": "a698128f-b34f-44db-a9f9-7661c7aba8d8"
    },
    "tasks@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/lifecycleWorkflows/workflows('156ce798-1eb6-4e0a-8515-e79f54d04390')/tasks",
    "tasks": [
        {
            "category": "joiner,leaver",
            "continueOnError": false,
            "description": "Enable user account in the directory",
            "displayName": "Enable User Account",
            "executionSequence": 1,
            "id": "4469d2ee-0626-4aa6-a792-84afcb9f3759",
            "isEnabled": true,
            "taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",
            "arguments": []
        },
        {
            "category": "joiner",
            "continueOnError": false,
            "description": "Send welcome email to new hire",
            "displayName": "Send Welcome Email",
            "executionSequence": 2,
            "id": "e93e4d5d-1bcd-4175-b8a1-81729e3b4df9",
            "isEnabled": true,
            "taskDefinitionId": "70b29d51-b59a-4773-9280-8841dfd3f2ea",
            "arguments": []
        },
        {
            "category": "joiner,leaver",
            "continueOnError": false,
            "description": "Add user to selected groups",
            "displayName": "Add User To Groups",
            "executionSequence": 3,
            "id": "072a6872-6052-4d4a-93f0-a0ff3f1dec19",
            "isEnabled": true,
            "taskDefinitionId": "22085229-5809-45e8-97fd-270d28d66910",
            "arguments": [
                {
                    "name": "groupID",
                    "value": "e5659cb0-bcbb-4a9f-9092-90f72bd19028"
                }
            ]
        }
    ],
    "createdBy": {
        "id": "a698128f-b34f-44db-a9f9-7661c7aba8d8"
    }
}

Example 2: Retrieve specific properties of a workflow

Request

GET https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/c0548e6c-8849-46e8-be14-8b6d2b04957e?$select=id,displayName,executionConditions,category

Response

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/lifecycleWorkflows/workflows(id,displayName,executionConditions,category)/$entity",
    "category": "leaver",
    "displayName": "Pre-Offboarding employees in the R&D department",
    "id": "c0548e6c-8849-46e8-be14-8b6d2b04957e",
    "executionConditions": {
        "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
        "scope": {
            "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
            "rule": "(department eq 'R&D')"
        },
        "trigger": {
            "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
            "timeBasedAttribute": "employeeLeaveDateTime",
            "offsetInDays": -7
        }
    }
}

Example 3: Retrieve a workflow with the previewScope relationship expanded

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/14879e66-9ea9-48d0-804d-8fea672d0341?$expand=previewScope

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
  "id": "14879e66-9ea9-48d0-804d-8fea672d0341",
  "category": "joiner",
  "displayName": "Onboard pre-hire employee",
  "description": "Configure pre-hire tasks for onboarding employees before their start date",
  "isEnabled": true,
  "isSchedulingEnabled": true,
  "version": 1,
  "createdDateTime": "2024-01-15T10:30:00Z",
  "lastModifiedDateTime": "2024-01-15T10:30:00Z",
  "deletedDateTime": null,
  "nextScheduleRunDateTime": "2024-01-16T08:00:00Z",
  "executionConditions": {
    "@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
    "scope": {
      "@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
      "rule": "(employeeHireDate ne null)"
    },
    "trigger": {
      "@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
      "timeBasedAttribute": "employeeHireDate",
      "offsetInDays": -7
    }
  },
  "previewScope": [
    {
      "@odata.type": "#microsoft.graph.user",
      "id": "b59552b8-fa7b-4f68-8496-0a529aace8c0"
    },
    {
      "@odata.type": "#microsoft.graph.user",
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  ]
}