stopWorkflowRun method

Future<StopWorkflowRunResponse> stopWorkflowRun({
  1. required String runId,
  2. required String workflowArn,
})

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.

May throw AccessDeniedException. May throw InternalServerException. May throw OperationTimeoutException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter runId : The unique identifier of the workflow run to stop.

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

Implementation

Future<StopWorkflowRunResponse> stopWorkflowRun({
  required String runId,
  required String workflowArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonMWAAServerless.StopWorkflowRun'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RunId': runId,
      'WorkflowArn': workflowArn,
    },
  );

  return StopWorkflowRunResponse.fromJson(jsonResponse.body);
}