---
title: ValidateWorkflowDefinition
source: https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/validate-workflow-definition
---

This API validates workflow definition YAML before creating or updating a workflow. Use this to check for syntax errors and schema violations.

## Input parameters

| Parameter         | Type   | Required | Description                                              |
| ----------------- | ------ | -------- | -------------------------------------------------------- |
| `account.id`      | Number | Yes      | Your account ID.                                         |
| `definition.yaml` | String | Yes      | The base64-encoded workflow definition YAML to validate. |

## Sample request

```graphql
  query workflowDefinitionValidation {
    actor {
      account(id: 11933347) {
        workflowAutomation {
          workflowDefinitionValidation(
            definition: {yaml: "ICAgICAgICAgICAgICAgIG5hbWU6IG15V29ya2Zsb3cKCiAgICAgICAgICAgICAgICBzdGVwczoKICAgICAgICAgICAgICAgICAgLSBuYW1lOiBvbmx5U3RlcAogICAgICAgICAgICAgICAgICAgIHR5cGU6IHdhaXQKICAgICAgICAgICAgICAgICAgICBzZWNvbmRzOiAtNDIKCiAgICAgICAgICAgICAgICAgIC0gbmFtZTogJycKICAgICAgICAgICAgICAgICAgICB0eXBlOiB3YWl0CiAgICAgICAgICAgICAgICAgICAgc2Vjb25kczogLTQyCgogICAgICAgICAgICAgICAgICAtIG5hbWU6IG9ubHlTdGVwCiAgICAgICAgICAgICAgICAgICAgdHlwZTogYWN0aW9uCiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBDb25zb2xlTG9nCiAgICAgICAgICAgICAgICAgICAgdmVyc2lvbjogIiIKICAgICAgICAgICAgICAgICAgICBpbnB1dHM6CiAgICAgICAgICAgICAgICAgICAgICAgZm9vOiAiIg=="}
          ) {
            errors {
              message
            }
            valid
          }
        }
      }
    }
  }
```

## Sample response

The query returns:

-   `valid`: Boolean indicating whether the workflow definition is valid
-   `errors`: Array of error objects, each containing:
    -   `message`: Description of validation errors (if any)

## Related topics [#related-topics]

[Definition schema](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema)

Complete YAML schema reference for workflow definitions

[Create workflow definition](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/create-workflow-definition)

Create a workflow after validation passes

[Update workflow definition](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/update-workflow-definition)

Update an existing workflow with validated YAML
