startFlowExecution method
Starts an execution of an Amazon Bedrock flow. Unlike flows that run until completion or time out after five minutes, flow executions let you run flows asynchronously for longer durations. Flow executions also yield control so that your application can perform other tasks.
This operation returns an Amazon Resource Name (ARN) that you can use to track and manage your flow execution.
May throw AccessDeniedException.
May throw BadGatewayException.
May throw ConflictException.
May throw DependencyFailedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter flowAliasIdentifier :
The unique identifier of the flow alias to use for the flow execution.
Parameter flowIdentifier :
The unique identifier of the flow to execute.
Parameter inputs :
The input data required for the flow execution. This must match the input
schema defined in the flow.
Parameter flowExecutionName :
The unique name for the flow execution. If you don't provide one, a
system-generated name is used.
Parameter modelPerformanceConfiguration :
The performance settings for the foundation model used in the flow
execution.
Implementation
Future<StartFlowExecutionResponse> startFlowExecution({
required String flowAliasIdentifier,
required String flowIdentifier,
required List<FlowInput> inputs,
String? flowExecutionName,
ModelPerformanceConfiguration? modelPerformanceConfiguration,
}) async {
final $payload = <String, dynamic>{
'inputs': inputs,
if (flowExecutionName != null) 'flowExecutionName': flowExecutionName,
if (modelPerformanceConfiguration != null)
'modelPerformanceConfiguration': modelPerformanceConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/flows/${Uri.encodeComponent(flowIdentifier)}/aliases/${Uri.encodeComponent(flowAliasIdentifier)}/executions',
exceptionFnMap: _exceptionFns,
);
return StartFlowExecutionResponse.fromJson(response);
}