Share via


Workflow - Validate

Validate a workflow.

POST {endpoint}/workflow/workflows/{workflowId}/validate?api-version=2023-10-01-preview

URI Parameters

Name In Required Type Description
endpoint
path True

string (url)

The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/

workflowId
path True

string (uuid)

The workflow id.

api-version
query True

string

Version of Purview APIs

Request Body

Name Required Type Description
description True

string

Description of a workflow.

isEnabled True

boolean

Whether the workflow enabled or not.

name True

string

The workflow name.

triggers True

Trigger[]

It describes under what condition a workflow will run.

actionDag

object

The action DAG(Directed Acyclic Graph), it defines actual flow.

Responses

Name Type Description
200 OK

WorkflowValidationRuleViolationsList

OK

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://purview.azure.net/.default Default authorization scope.

Examples

Workflow_CreateOrUpdate

Sample request

POST {endpoint}/workflow/workflows/4afb5752-e47f-43a1-8ba7-c696bf8d2745/validate?api-version=2023-10-01-preview

{
  "name": "Create glossary term workflow",
  "description": "",
  "triggers": [
    {
      "type": "when_term_creation_is_requested",
      "underGlossaryHierarchy": "/glossaries/20031e20-b4df-4a66-a61d-1b0716f3fa48"
    }
  ],
  "isEnabled": true,
  "actionDag": {
    "actions": {
      "Start and wait for an approval": {
        "type": "Approval",
        "inputs": {
          "parameters": {
            "approvalType": "PendingOnAll",
            "title": "Approval Request for Create Glossary Term",
            "assignedTo": [
              "eece94d9-0619-4669-bb8a-d6ecec5220bc"
            ]
          }
        },
        "runAfter": {}
      },
      "Condition": {
        "type": "If",
        "expression": {
          "and": [
            {
              "equals": [
                "@{outputs('Start and wait for an approval')['outcome']}",
                "Approved"
              ]
            }
          ]
        },
        "actions": {
          "Create glossary term": {
            "type": "CreateTerm",
            "runAfter": {}
          },
          "Send email notification": {
            "type": "EmailNotification",
            "inputs": {
              "parameters": {
                "emailSubject": "Glossary Term Create - APPROVED",
                "emailMessage": "Your request for Glossary Term @{runInput()['term']['name']} is approved.",
                "emailRecipients": [
                  "@{runInput()['requestor']}"
                ]
              }
            },
            "runAfter": {
              "Create glossary term": [
                "Succeeded"
              ]
            }
          }
        },
        "else": {
          "actions": {
            "Send reject email notification": {
              "type": "EmailNotification",
              "inputs": {
                "parameters": {
                  "emailSubject": "Glossary Term Create - REJECTED",
                  "emailMessage": "Your request for Glossary Term @{runInput()['term']['name']} is rejected.",
                  "emailRecipients": [
                    "@{runInput()['requestor']}"
                  ]
                }
              },
              "runAfter": {}
            }
          }
        },
        "runAfter": {
          "Start and wait for an approval": [
            "Succeeded"
          ]
        }
      }
    }
  }
}

Sample response

{
  "value": [
    {
      "severity": "error",
      "location": {
        "type": "actionParameter",
        "actionName": "Email notification action",
        "parameterKey": "emailMessage"
      },
      "message": "There's a parameter type error for the function call \"startsWith()\". Actual: (), expected: (string,string)."
    }
  ]
}

Definitions

Name Description
ErrorModel

Default error model

ErrorResponse

Default error response model

Location

The location where the violation happens.

Trigger

Describes under what condition a workflow will run.

TriggerType
ValidationRuleSeverity

The severity of the validation rule.

ValidationRuleViolationLocation

The validation violation location type.

WorkflowCreateOrUpdateCommand

Create or update workflow payload.

WorkflowValidationRuleViolation

The detail of validation rule violated in a workflow.

WorkflowValidationRuleViolationsList

ErrorModel

Default error model

Name Type Description
code

string

Gets or sets the code.

details

ErrorModel[]

Gets or sets the details.

message

string

Gets or sets the messages.

target

string

Gets or sets the target.

ErrorResponse

Default error response model

Name Type Description
error

ErrorModel

Default error model

Location

The location where the violation happens.

Name Type Description
actionName

string

The name of the action where the violation happens.

parameterKey

string

The key of the action parameter where the violation happens.

type

ValidationRuleViolationLocation

The validation violation location type.

Trigger

Describes under what condition a workflow will run.

Name Type Description
type

TriggerType

underCollection

string

The collection name.

underGlossary

string

The glossary guid.

underGlossaryHierarchy

string

Glossary term hierarchy path.

TriggerType

Value Description
when_term_creation_is_requested
when_term_deletion_is_requested
when_term_update_is_requested
when_terms_import_is_requested
when_data_access_grant_is_requested
when_asset_update_is_requested

ValidationRuleSeverity

The severity of the validation rule.

Value Description
error
warning

ValidationRuleViolationLocation

The validation violation location type.

Value Description
workflow
action
actionParameter

WorkflowCreateOrUpdateCommand

Create or update workflow payload.

Name Type Description
actionDag

object

The action DAG(Directed Acyclic Graph), it defines actual flow.

description

string

Description of a workflow.

isEnabled

boolean

Whether the workflow enabled or not.

name

string

The workflow name.

triggers

Trigger[]

It describes under what condition a workflow will run.

WorkflowValidationRuleViolation

The detail of validation rule violated in a workflow.

Name Type Description
location

Location

The location where the violation happens.

message

string

The detail about how the validation rule is violated.

severity

ValidationRuleSeverity

The severity of the validation rule.

WorkflowValidationRuleViolationsList

Name Type Description
value

WorkflowValidationRuleViolation[]

The value of violated validation rule list.