---
title: DeleteWorkflowDefinition
source: https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/delete-workflow-definition
---

This API deletes all the workflow definition versions with the specified name.

> #### ⚠️ IMPORTANT
>
> -   In order to delete a definition, there must be no schedules using the definition. If the definition is currently used by a schedule, deleting the definition will fail and return an error accordingly.
> -   All running workflow runs will continue to completion even if the definition is deleted.

## Input parameters

| Parameter         | Type   | Required | Description                                                                                 |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `definition.name` | String | Yes      | The name of the workflow definition to delete. All versions with this name will be deleted. |
| `scope.id`        | String | Yes      | Your account ID.                                                                            |
| `scope.type`      | Enum   | Yes      | The scope type (ACCOUNT).                                                                   |

## Sample request

```graphql
mutation {
  workflowAutomationDeleteWorkflowDefinition(
    definition: {name: "my-workflow"}
    scope: {id: "12345678", type: ACCOUNT}
  ) {
    definition {
      name
    }
  }
}
```

## Related topics [#related-topics]

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

Check if workflow is used by any schedules before deleting

[Delete schedule](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/delete-schedule)

Remove schedules before deleting workflow definition

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

List all workflow definitions in your account
