This documentation is a draft for private preview for regions in the AWS European Sovereign Cloud. Documentation content will continue to evolve. Published: January 10, 2026.Use ListFlowVersions with an AWS SDK
The following code example shows how to use ListFlowVersions.
- Python
-
- SDK for Python (Boto3)
-
List the versions of an Amazon Bedrock flow.
def list_flow_versions(client, flow_id):
"""
Lists the versions of an Amazon Bedrock flow.
Args:
client: Amazon bedrock agent boto3 client.
flow_id (str): The identifier of the flow.
Returns:
dict: The response from ListFlowVersions.
"""
try:
finished = False
logger.info("Listing flow versions for flow: %s.", flow_id)
response = client.list_flow_versions(
flowIdentifier=flow_id,
maxResults=10)
while finished is False:
print(f"Versions for flow:{flow_id}")
for version in response['flowVersionSummaries']:
print(f"Version: {version['version']}")
print(f"Status: {version['status']}\n")
if 'nextToken' in response:
next_token = response['nextToken']
response = client.list_flow_versions(maxResults=10,
nextToken=next_token)
else:
finished = True
logging.info("Successfully listed flow versions for flow %s.",
flow_id)
return response
except ClientError as e:
logging.exception("Client error listing flow versions: %s", str(e))
raise
except Exception as e:
logging.exception("Unexpected error listing flow versions: %s", str(e))
raise
For a complete list of AWS SDK developer guides and code examples, see
Using Amazon Bedrock with an AWS SDK.
This topic also includes information about getting started and details about previous SDK versions.