---
title: UpdateWorkflowDefinition
source: https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/update-workflow-definition
---

This API updates an existing workflow definition. It returns an error if the workflow definition does not already exist.

## Input parameters

| Parameter         | Type   | Required | Description                                  |
| ----------------- | ------ | -------- | -------------------------------------------- |
| `definition.yaml` | String | Yes      | The base64-encoded workflow definition YAML. |
| `scope.id`        | String | Yes      | Your account ID.                             |
| `scope.type`      | Enum   | Yes      | The scope type (ACCOUNT).                    |

## Sample request

```graphql
  mutation {
    workflowAutomationUpdateWorkflowDefinition(
      definition: {yaml: "<workflow definition YAML>"}
      scope: {id: "11608789", type: ACCOUNT}
    ) {
      definition {
        name
        version
        yaml
      }
    }
  }
```

## Sample response

The mutation returns:

-   `definition.name`: The name of the updated workflow definition
-   `definition.version`: The new version number of the workflow definition
-   `definition.yaml`: The base64-encoded workflow definition YAML

## Related topics [#related-topics]

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

Test your workflow YAML syntax before updating

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

View the current workflow definition before updating

[Start workflow run](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/start-workflow-run)

Execute your updated workflow

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

Reference for workflow YAML structure
