Skip to content

delete_workflow async

delete_workflow(
    workflow_arn: WorkflowArn,
    *,
    config_overrides: Optional[AsyncMWAAServerlessClientConfig] = None,
    workflow_version: Optional[WorkflowVersion] = None,
) -> DeleteWorkflowResponse

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.

Parameters:

  • workflow_arn (WorkflowArn) –

    The Amazon Resource Name (ARN) of the workflow you want to delete.

  • workflow_version (Optional[WorkflowVersion], default: None ) –

    Optional. The specific version of the workflow to delete. If not specified, all versions of the workflow are deleted.

Raises:

  • AccessDeniedException –

    You do not have sufficient permission to perform this action.

  • InternalServerException –

    An unexpected server-side error occurred during request processing.

  • OperationTimeoutException –

    The operation timed out.

  • ResourceNotFoundException –

    The specified resource was not found. You can only access or modify a resource that already exists.

  • 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.

  • 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.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mwaa_serverless/_services/async_mwaa_serverless.py
async def delete_workflow(
    self,
    workflow_arn: "capo_mwaa_serverless.types.workflow_arn.WorkflowArn",
    *,
    config_overrides: Optional[AsyncMWAAServerlessClientConfig] = None,
    workflow_version: Optional[
        "capo_mwaa_serverless.types.workflow_version.WorkflowVersion"
    ] = None,
) -> "capo_mwaa_serverless.types.delete_workflow_response.DeleteWorkflowResponse":
    """<p>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.</p>

    Args:
        workflow_arn: <p>The Amazon Resource Name (ARN) of the workflow you want to delete.</p>
        workflow_version: <p>Optional. The specific version of the workflow to delete. If not specified, all versions of the workflow are deleted.</p>

    Raises:
        capo_mwaa_serverless.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permission to perform this action.</p>
        capo_mwaa_serverless.errors.internal_server_exception.InternalServerException: <p>An unexpected server-side error occurred during request processing.</p>
        capo_mwaa_serverless.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_mwaa_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. You can only access or modify a resource that already exists.</p>
        capo_mwaa_serverless.errors.throttling_exception.ThrottlingException: <p>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.</p>
        capo_mwaa_serverless.errors.validation_exception.ValidationException: <p>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.</p>
        capo_mwaa_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mwaa_serverless.types.delete_workflow_request.DeleteWorkflowRequest]",
    ) -> AsyncOperationResponse[
        "capo_mwaa_serverless.types.delete_workflow_response.DeleteWorkflowResponse"
    ]:
        import capo_mwaa_serverless._operations.amazon_mwaa_serverless.delete_workflow

        (
            output,
            http_response,
        ) = await capo_mwaa_serverless._operations.amazon_mwaa_serverless.delete_workflow.async_delete_workflow(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteWorkflow")
    )
    input_: capo_mwaa_serverless.types.delete_workflow_request.DeleteWorkflowRequest = {
        "workflow_arn": workflow_arn
    }
    if workflow_version is not None:
        input_["workflow_version"] = workflow_version

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output