Agents for Amazon Bedrock Runtime

2025/05/21 - Agents for Amazon Bedrock Runtime - 6 new api methods

Changes  Amazon Bedrock introduces asynchronous flows (in preview), which let you run flows for longer durations and yield control so that your application can perform other tasks and you don't have to actively monitor the flow's progress.

ListFlowExecutions (new) Link ¶

Lists all asynchronous executions for a flow. Results can be paginated and include summary information about each execution, such as status, start and end times, and the execution's Amazon Resource Name (ARN).

See also: AWS API Documentation

Request Syntax

client.list_flow_executions(
    flowAliasIdentifier='string',
    flowIdentifier='string',
    maxResults=123,
    nextToken='string'
)
type flowAliasIdentifier:

string

param flowAliasIdentifier:

The unique identifier of the flow alias to list executions for.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow to list executions for.

type maxResults:

integer

param maxResults:

The maximum number of async executions to return in a single response. If more executions exist than the specified maxResults value, a token is included in the response so that the remaining results can be retrieved.

type nextToken:

string

param nextToken:

A token to retrieve the next set of results. This value is returned in the response if more results are available.

rtype:

dict

returns:

Response Syntax

{
    'flowExecutionSummaries': [
        {
            'createdAt': datetime(2015, 1, 1),
            'endedAt': datetime(2015, 1, 1),
            'executionArn': 'string',
            'flowAliasIdentifier': 'string',
            'flowIdentifier': 'string',
            'flowVersion': 'string',
            'status': 'Running'|'Succeeded'|'Failed'|'TimedOut'|'Aborted'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • flowExecutionSummaries (list) --

      A list of async execution summaries. Each summary includes the execution ARN, flow identifier, flow alias identifier, flow version, status, and timestamps.

      • (dict) --

        Contains summary information about a flow's async execution, including its status, timestamps, and identifiers.

        • createdAt (datetime) --

          The timestamp when the async execution was created.

        • endedAt (datetime) --

          The timestamp when the async execution ended. This field is only populated when the execution has completed, failed, timed out, or been aborted.

        • executionArn (string) --

          The Amazon Resource Name (ARN) that uniquely identifies the async execution.

        • flowAliasIdentifier (string) --

          The unique identifier of the flow alias used for the execution.

        • flowIdentifier (string) --

          The unique identifier of the flow.

        • flowVersion (string) --

          The version of the flow used for the execution.

        • status (string) --

          The current status of the async execution.

          Async executions time out after 24 hours.

    • nextToken (string) --

      A token to retrieve the next set of results. This value is returned if more results are available.

StopFlowExecution (new) Link ¶

Stops an Amazon Bedrock flow's asynchronous execution. This operation prevents further processing of the flow and changes the execution status to Aborted.

See also: AWS API Documentation

Request Syntax

client.stop_flow_execution(
    executionIdentifier='string',
    flowAliasIdentifier='string',
    flowIdentifier='string'
)
type executionIdentifier:

string

param executionIdentifier:

[REQUIRED]

The unique identifier of the async execution to stop.

type flowAliasIdentifier:

string

param flowAliasIdentifier:

[REQUIRED]

The unique identifier of the flow alias used for the execution.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

rtype:

dict

returns:

Response Syntax

{
    'executionArn': 'string',
    'status': 'Running'|'Succeeded'|'Failed'|'TimedOut'|'Aborted'
}

Response Structure

  • (dict) --

    • executionArn (string) --

      The Amazon Resource Name (ARN) that uniquely identifies the async execution that was stopped.

    • status (string) --

      The updated status of the async execution after the stop request. This will typically be ABORTED if the execution was successfully stopped.

GetExecutionFlowSnapshot (new) Link ¶

Retrieves the flow definition snapshot used for an asynchronous execution. The snapshot represents the flow metadata and definition as it existed at the time the asynchronous execution was started. Note that even if the flow is edited after an execution starts, the snapshot connected to the execution remains unchanged.

See also: AWS API Documentation

Request Syntax

client.get_execution_flow_snapshot(
    executionIdentifier='string',
    flowAliasIdentifier='string',
    flowIdentifier='string'
)
type executionIdentifier:

string

param executionIdentifier:

[REQUIRED]

The unique identifier of the async execution.

type flowAliasIdentifier:

string

param flowAliasIdentifier:

[REQUIRED]

The unique identifier of the flow alias used for the async execution.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

rtype:

dict

returns:

Response Syntax

{
    'customerEncryptionKeyArn': 'string',
    'definition': 'string',
    'executionRoleArn': 'string',
    'flowAliasIdentifier': 'string',
    'flowIdentifier': 'string',
    'flowVersion': 'string'
}

Response Structure

  • (dict) --

    • customerEncryptionKeyArn (string) --

      The Amazon Resource Name (ARN) of the customer managed KMS key that's used to encrypt the flow snapshot.

    • definition (string) --

      The flow definition used for the async execution, including the nodes, connections, and configuration at the time when the execution started.

      The definition returns as a string that follows the structure of a FlowDefinition object.

    • executionRoleArn (string) --

      The Amazon Resource Name (ARN) of the IAM service role that's used by the async execution.

    • flowAliasIdentifier (string) --

      The unique identifier of the flow alias used for the async execution.

    • flowIdentifier (string) --

      The unique identifier of the flow.

    • flowVersion (string) --

      The version of the flow used for the async execution.

GetFlowExecution (new) Link ¶

Retrieves details about a specific asynchronous execution of a flow, including its status, start and end times, and any errors that occurred during execution.

See also: AWS API Documentation

Request Syntax

client.get_flow_execution(
    executionIdentifier='string',
    flowAliasIdentifier='string',
    flowIdentifier='string'
)
type executionIdentifier:

string

param executionIdentifier:

[REQUIRED]

The unique identifier of the async execution to retrieve.

type flowAliasIdentifier:

string

param flowAliasIdentifier:

[REQUIRED]

The unique identifier of the flow alias used for the execution.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

rtype:

dict

returns:

Response Syntax

{
    'endedAt': datetime(2015, 1, 1),
    'errors': [
        {
            'error': 'ExecutionTimedOut',
            'message': 'string',
            'nodeName': 'string'
        },
    ],
    'executionArn': 'string',
    'flowAliasIdentifier': 'string',
    'flowIdentifier': 'string',
    'flowVersion': 'string',
    'startedAt': datetime(2015, 1, 1),
    'status': 'Running'|'Succeeded'|'Failed'|'TimedOut'|'Aborted'
}

Response Structure

  • (dict) --

    • endedAt (datetime) --

      The timestamp when the async execution ended. This field is only populated when the execution has completed, failed, timed out, or been aborted.

    • errors (list) --

      A list of errors that occurred during the async execution. Each error includes an error code, message, and the node where the error occurred, if applicable.

      • (dict) --

        Contains information about an error that occurred during an async execution.

        • error (string) --

          The error code for the type of error that occurred.

        • message (string) --

          A descriptive message that provides details about the error.

        • nodeName (string) --

          The name of the node in the flow where the error occurred (if applicable).

    • executionArn (string) --

      The Amazon Resource Name (ARN) that uniquely identifies the async execution.

    • flowAliasIdentifier (string) --

      The unique identifier of the flow alias used for the execution.

    • flowIdentifier (string) --

      The unique identifier of the flow.

    • flowVersion (string) --

      The version of the flow used for the execution.

    • startedAt (datetime) --

      The timestamp when the async execution started.

    • status (string) --

      The current status of the async execution.

      Async executions time out after 24 hours.

StartFlowExecution (new) Link ¶

Starts an asynchronous execution of an Amazon Bedrock flow. Unlike synchronous flows that run until completion or time out after five minutes, you can run asynchronous flows for longer durations. Asynchronous flows 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's async execution.

See also: AWS API Documentation

Request Syntax

client.start_flow_execution(
    flowAliasIdentifier='string',
    flowExecutionName='string',
    flowIdentifier='string',
    inputs=[
        {
            'content': {
                'document': {...}|[...]|123|123.4|'string'|True|None
            },
            'nodeInputName': 'string',
            'nodeName': 'string',
            'nodeOutputName': 'string'
        },
    ],
    modelPerformanceConfiguration={
        'performanceConfig': {
            'latency': 'standard'|'optimized'
        }
    }
)
type flowAliasIdentifier:

string

param flowAliasIdentifier:

[REQUIRED]

The unique identifier of the flow alias to use for the async execution.

type flowExecutionName:

string

param flowExecutionName:

The unique name for the async execution. If you don't provide one, a system-generated name is used.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow to execute.

type inputs:

list

param inputs:

[REQUIRED]

The input data required for the async execution. This must match the input schema defined in the flow.

  • (dict) --

    Contains information about an input into the prompt flow and where to send it.

    • content (dict) -- [REQUIRED]

      Contains information about an input into the prompt flow.

      • document (:ref:`document<document>`) --

        The input to send to the prompt flow input node.

    • nodeInputName (string) --

      The name of the input from the flow input node.

    • nodeName (string) -- [REQUIRED]

      The name of the flow input node that begins the prompt flow.

    • nodeOutputName (string) --

      The name of the output from the flow input node that begins the prompt flow.

type modelPerformanceConfiguration:

dict

param modelPerformanceConfiguration:

The performance settings for the foundation model used in the async execution.

  • performanceConfig (dict) --

    The latency configuration for the model.

    • latency (string) --

      To use a latency-optimized version of the model, set to optimized.

rtype:

dict

returns:

Response Syntax

{
    'executionArn': 'string'
}

Response Structure

  • (dict) --

    • executionArn (string) --

      The Amazon Resource Name (ARN) that uniquely identifies the async execution.

ListFlowExecutionEvents (new) Link ¶

Lists events that occurred during an asynchronous execution of a flow. Events provide detailed information about the execution progress, including node inputs and outputs, flow inputs and outputs, condition results, and failure events.

See also: AWS API Documentation

Request Syntax

client.list_flow_execution_events(
    eventType='Node'|'Flow',
    executionIdentifier='string',
    flowAliasIdentifier='string',
    flowIdentifier='string',
    maxResults=123,
    nextToken='string'
)
type eventType:

string

param eventType:

[REQUIRED]

The type of events to retrieve. Specify Node for node-level events or Flow for flow-level events.

type executionIdentifier:

string

param executionIdentifier:

[REQUIRED]

The unique identifier of the async execution.

type flowAliasIdentifier:

string

param flowAliasIdentifier:

[REQUIRED]

The unique identifier of the flow alias used for the execution.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

type maxResults:

integer

param maxResults:

The maximum number of events to return in a single response. If more events exist than the specified maxResults value, a token is included in the response so that the remaining results can be retrieved.

type nextToken:

string

param nextToken:

A token to retrieve the next set of results. This value is returned in the response if more results are available.

rtype:

dict

returns:

Response Syntax

{
    'flowExecutionEvents': [
        {
            'conditionResultEvent': {
                'nodeName': 'string',
                'satisfiedConditions': [
                    {
                        'conditionName': 'string'
                    },
                ],
                'timestamp': datetime(2015, 1, 1)
            },
            'flowFailureEvent': {
                'errorCode': 'VALIDATION'|'INTERNAL_SERVER'|'NODE_EXECUTION_FAILED',
                'errorMessage': 'string',
                'timestamp': datetime(2015, 1, 1)
            },
            'flowInputEvent': {
                'fields': [
                    {
                        'content': {
                            'document': {...}|[...]|123|123.4|'string'|True|None
                        },
                        'name': 'string'
                    },
                ],
                'nodeName': 'string',
                'timestamp': datetime(2015, 1, 1)
            },
            'flowOutputEvent': {
                'fields': [
                    {
                        'content': {
                            'document': {...}|[...]|123|123.4|'string'|True|None
                        },
                        'name': 'string'
                    },
                ],
                'nodeName': 'string',
                'timestamp': datetime(2015, 1, 1)
            },
            'nodeFailureEvent': {
                'errorCode': 'VALIDATION'|'DEPENDENCY_FAILED'|'BAD_GATEWAY'|'INTERNAL_SERVER',
                'errorMessage': 'string',
                'nodeName': 'string',
                'timestamp': datetime(2015, 1, 1)
            },
            'nodeInputEvent': {
                'fields': [
                    {
                        'content': {
                            'document': {...}|[...]|123|123.4|'string'|True|None
                        },
                        'name': 'string'
                    },
                ],
                'nodeName': 'string',
                'timestamp': datetime(2015, 1, 1)
            },
            'nodeOutputEvent': {
                'fields': [
                    {
                        'content': {
                            'document': {...}|[...]|123|123.4|'string'|True|None
                        },
                        'name': 'string'
                    },
                ],
                'nodeName': 'string',
                'timestamp': datetime(2015, 1, 1)
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • flowExecutionEvents (list) --

      A list of events that occurred during the async execution. Events can include node inputs and outputs, flow inputs and outputs, condition results, and failure events.

      • (dict) --

        Represents an event that occurred during an async execution. This is a union type that can contain one of several event types, such as node input and output events; flow input and output events; condition node result events, or failure events.

        • conditionResultEvent (dict) --

          Contains information about a condition evaluation result during the async execution. This event is generated when a condition node in the flow evaluates its conditions.

          • nodeName (string) --

            The name of the condition node that evaluated the conditions.

          • satisfiedConditions (list) --

            A list of conditions that were satisfied during the evaluation.

            • (dict) --

              Represents a condition that was satisfied during a condition node evaluation in a flow's async execution.

              • conditionName (string) --

                The name of the condition that was satisfied.

          • timestamp (datetime) --

            The timestamp when the condition evaluation occurred.

        • flowFailureEvent (dict) --

          Contains information about a failure that occurred at the flow level during execution.

          • errorCode (string) --

            The error code that identifies the type of failure that occurred.

          • errorMessage (string) --

            A descriptive message that provides details about the failure.

          • timestamp (datetime) --

            The timestamp when the failure occurred.

        • flowInputEvent (dict) --

          Contains information about the inputs provided to the flow at the start of execution.

          • fields (list) --

            A list of input fields provided to the flow.

            • (dict) --

              Represents an input field provided to a flow during an async execution.

              • content (dict) --

                The content of the input field, which can contain text or structured data.

                • document (:ref:`document<document>`) --

                  The document content of the field, which can contain text or structured data.

              • name (string) --

                The name of the input field as defined in the flow's input schema.

          • nodeName (string) --

            The name of the node that receives the inputs.

          • timestamp (datetime) --

            The timestamp when the inputs are provided.

        • flowOutputEvent (dict) --

          Contains information about the outputs produced by the flow at the end of execution.

          • fields (list) --

            A list of output fields produced by the flow.

            • (dict) --

              Represents an output field produced by a flow during an async execution.

              • content (dict) --

                The content of the output field, which can contain text or structured data.

                • document (:ref:`document<document>`) --

                  The document content of the field, which can contain text or structured data.

              • name (string) --

                The name of the output field as defined in the flow's output schema.

          • nodeName (string) --

            The name of the node that produces the outputs.

          • timestamp (datetime) --

            The timestamp when the outputs are produced.

        • nodeFailureEvent (dict) --

          Contains information about a failure that occurred at a specific node during execution.

          • errorCode (string) --

            The error code that identifies the type of failure that occurred at the node.

          • errorMessage (string) --

            A descriptive message that provides details about the node failure.

          • nodeName (string) --

            The name of the node where the failure occurred.

          • timestamp (datetime) --

            The timestamp when the node failure occurred.

        • nodeInputEvent (dict) --

          Contains information about the inputs provided to a specific node during execution.

          • fields (list) --

            A list of input fields provided to the node.

            • (dict) --

              Represents an input field provided to a node during a flow's async execution.

              • content (dict) --

                The content of the input field, which can contain text or structured data.

                • document (:ref:`document<document>`) --

                  The document content of the field, which can contain text or structured data.

              • name (string) --

                The name of the input field as defined in the node's input schema.

          • nodeName (string) --

            The name of the node that received the inputs.

          • timestamp (datetime) --

            The timestamp when the inputs were provided to the node.

        • nodeOutputEvent (dict) --

          Contains information about the outputs produced by a specific node during execution.

          • fields (list) --

            A list of output fields produced by the node.

            • (dict) --

              Represents an output field produced by a node during a flow's async execution.

              • content (dict) --

                The content of the output field, which can contain text or structured data.

                • document (:ref:`document<document>`) --

                  The document content of the field, which can contain text or structured data.

              • name (string) --

                The name of the output field as defined in the node's output schema.

          • nodeName (string) --

            The name of the node that produced the outputs.

          • timestamp (datetime) --

            The timestamp when the outputs were produced by the node.

    • nextToken (string) --

      A token to retrieve the next set of results. This value is returned if more results are available.