cancelFlowExecutions method
Cancels active runs for a flow.
You can cancel all of the active runs for a flow, or you can cancel specific runs by providing their IDs.
You can cancel a flow run only when the run is in progress. You can't
cancel a run that has already completed or failed. You also can't cancel a
run that's scheduled to occur but hasn't started yet. To prevent a
scheduled run, you can deactivate the flow with the StopFlow
action.
You cannot resume a run after you cancel it.
When you send your request, the status for each run becomes
CancelStarted. When the cancellation completes, the status
becomes Canceled.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter flowName :
The name of a flow with active runs that you want to cancel.
Parameter executionIds :
The ID of each active run to cancel. These runs must belong to the flow
you specify in your request.
If you omit this parameter, your request ends all active runs that belong to the flow.
Implementation
Future<CancelFlowExecutionsResponse> cancelFlowExecutions({
required String flowName,
List<String>? executionIds,
}) async {
final $payload = <String, dynamic>{
'flowName': flowName,
if (executionIds != null) 'executionIds': executionIds,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/cancel-flow-executions',
exceptionFnMap: _exceptionFns,
);
return CancelFlowExecutionsResponse.fromJson(response);
}