

# DeleteWorkflow
<a name="API_DeleteWorkflow"></a>

Deletes a workflow and all its versions. This operation permanently removes the workflow and cannot be undone. Amazon Managed Workflows for Apache Airflow Serverless ensures that all associated resources are properly cleaned up, including stopping any running executions, removing scheduled triggers, and cleaning up execution history. The deletion process respects the multi-tenant isolation boundaries and ensures that no residual data or configurations remain that could affect other customers or workflows.

## Request Syntax
<a name="API_DeleteWorkflow_RequestSyntax"></a>

```
{
   "WorkflowArn": "string",
   "WorkflowVersion": "string"
}
```

## Request Parameters
<a name="API_DeleteWorkflow_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [WorkflowArn](#API_DeleteWorkflow_RequestSyntax) **   <a name="mwaaserverless-DeleteWorkflow-request-WorkflowArn"></a>
The Amazon Resource Name (ARN) of the workflow you want to delete.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `arn:aws(?:-(?:cn|us-gov|iso|iso-b|iso-e|iso-f))?:airflow-serverless:([a-z]{2}-[a-z]+-[0-9]{1}):([0-9]{12}):workflow/([a-zA-Z0-9][a-zA-Z0-9\.\-_]{0,254}-[a-zA-Z0-9]{10})`   
Required: Yes

 ** [WorkflowVersion](#API_DeleteWorkflow_RequestSyntax) **   <a name="mwaaserverless-DeleteWorkflow-request-WorkflowVersion"></a>
Optional. The specific version of the workflow to delete. If not specified, all versions of the workflow are deleted.  
Type: String  
Length Constraints: Fixed length of 32.  
Pattern: `[a-z0-9]{32}`   
Required: No

## Response Syntax
<a name="API_DeleteWorkflow_ResponseSyntax"></a>

```
{
   "WorkflowArn": "string",
   "WorkflowVersion": "string"
}
```

## Response Elements
<a name="API_DeleteWorkflow_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [WorkflowArn](#API_DeleteWorkflow_ResponseSyntax) **   <a name="mwaaserverless-DeleteWorkflow-response-WorkflowArn"></a>
The Amazon Resource Name (ARN) of the deleted workflow.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `arn:aws(?:-(?:cn|us-gov|iso|iso-b|iso-e|iso-f))?:airflow-serverless:([a-z]{2}-[a-z]+-[0-9]{1}):([0-9]{12}):workflow/([a-zA-Z0-9][a-zA-Z0-9\.\-_]{0,254}-[a-zA-Z0-9]{10})` 

 ** [WorkflowVersion](#API_DeleteWorkflow_ResponseSyntax) **   <a name="mwaaserverless-DeleteWorkflow-response-WorkflowVersion"></a>
The version of the workflow that was deleted.  
Type: String  
Length Constraints: Fixed length of 32.  
Pattern: `[a-z0-9]{32}` 

## Errors
<a name="API_DeleteWorkflow_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have sufficient permission to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An unexpected server-side error occurred during request processing.    
 ** RetryAfterSeconds **   
The number of seconds to wait before retrying the operation.
HTTP Status Code: 500

 ** OperationTimeoutException **   
The operation timed out.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found. You can only access or modify a resource that already exists.    
 ** ResourceId **   
The unique identifier of the resource.  
 ** ResourceType **   
The type of the resource.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was denied because too many requests were made in a short period, exceeding the service rate limits. Amazon Managed Workflows for Apache Airflow Serverless implements throttling controls to ensure fair resource allocation across all customers in the multi-tenant environment. This helps maintain service stability and performance. If you encounter throttling, implement exponential backoff and retry logic in your applications, or consider distributing your API calls over a longer time period.    
 ** QuotaCode **   
The code of the quota.  
 ** RetryAfterSeconds **   
The number of seconds to wait before retrying the operation.  
 ** ServiceCode **   
The code for the service.
HTTP Status Code: 400

 ** ValidationException **   
The specified request parameters are invalid, missing, or inconsistent with Amazon Managed Workflows for Apache Airflow Serverless service requirements. This can occur when workflow definitions contain unsupported operators, when required IAM permissions are missing, when S3 locations are inaccessible, or when network configurations are invalid. The service validates workflow definitions, execution roles, and resource configurations to ensure compatibility with the managed Airflow environment and security requirements.    
 ** FieldList **   
The fields that failed validation.  
 ** Reason **   
The reason the request failed validation.
HTTP Status Code: 400

## See Also
<a name="API_DeleteWorkflow_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/mwaa-serverless-2024-07-26/DeleteWorkflow) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/mwaa-serverless-2024-07-26/DeleteWorkflow) 