:doc:`MWAAServerless <../../mwaa-serverless>` / Client / stop_workflow_run

*****************
stop_workflow_run
*****************



.. py:method:: MWAAServerless.Client.stop_workflow_run(**kwargs)

  

  Stops a running workflow execution. This operation terminates all running tasks and prevents new tasks from starting. Amazon Managed Workflows for Apache Airflow Serverless gracefully shuts down the workflow execution by stopping task scheduling and terminating active ECS worker containers. The operation transitions the workflow run to a ``STOPPING`` state and then to ``STOPPED`` once all cleanup is complete. In-flight tasks may complete or be terminated depending on their current execution state.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mwaa-serverless-2024-07-26/StopWorkflowRun>`_  


  **Request Syntax**
  ::

    response = client.stop_workflow_run(
        WorkflowArn='string',
        RunId='string'
    )
    
  :type WorkflowArn: string
  :param WorkflowArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the workflow that contains the run you want to stop.

    

  
  :type RunId: string
  :param RunId: **[REQUIRED]** 

    The unique identifier of the workflow run to stop.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'WorkflowArn': 'string',
          'WorkflowVersion': 'string',
          'RunId': 'string',
          'Status': 'STARTING'|'QUEUED'|'RUNNING'|'SUCCESS'|'FAILED'|'TIMEOUT'|'STOPPING'|'STOPPED'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **WorkflowArn** *(string) --* 

        The Amazon Resource Name (ARN) of the workflow that contains the stopped run.

        
      

      - **WorkflowVersion** *(string) --* 

        The version of the workflow that was stopped.

        
      

      - **RunId** *(string) --* 

        The unique identifier of the stopped workflow run.

        
      

      - **Status** *(string) --* 

        The status of the workflow run after the stop operation. This is typically ``STOPPING`` or ``STOPPED``.

        
  
  **Exceptions**
  
  *   :py:class:`MWAAServerless.Client.exceptions.ThrottlingException`

  
  *   :py:class:`MWAAServerless.Client.exceptions.ValidationException`

  
  *   :py:class:`MWAAServerless.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`MWAAServerless.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`MWAAServerless.Client.exceptions.InternalServerException`

  
  *   :py:class:`MWAAServerless.Client.exceptions.OperationTimeoutException`

  