Skip to main content

flows

Creates, updates, deletes, gets or lists a flows resource.

Overview

Nameflows
TypeResource
Idaws.bedrock_agent.flows

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the flow. (pattern: <code>[0-9a-zA-Z]{10}</code>)
namestringThe name of the flow. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>)
arnstringThe Amazon Resource Name (ARN) of the flow. (pattern: <code>arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:flow/[0-9a-zA-Z]{10}</code>)
created_atstring (date-time)The time at which the flow was created.
customer_encryption_key_arnstringThe Amazon Resource Name (ARN) of the KMS key that the flow is encrypted with. (pattern: <code>arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}</code>)
definitionobjectThe definition of the nodes and connections between the nodes in the flow.
descriptionstringThe description of the flow.
execution_role_arnstringThe Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see Create a service row for flows in the Amazon Bedrock User Guide. (pattern: <code>arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/(service-role/)?.+</code>)
statusstringThe status of the flow. The following statuses are possible: NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the DRAFT version won't contain the latest changes for testing. Send a PrepareFlow request to package the latest changes into the DRAFT version. Preparing – The flow is being prepared so that the DRAFT version contains the latest changes for testing. Prepared – The flow is prepared and the DRAFT version contains the latest changes for testing. Failed – The last API operation that you invoked on the flow failed. Send a GetFlow request and check the error message in the validations field. (Failed, Prepared, Preparing, NotPrepared)
updated_atstring (date-time)The time at which the flow was last updated.
validationsarrayA list of validation error messages related to the last failed operation on the flow.
versionstringThe version of the flow for which information was retrieved. (pattern: <code>DRAFT</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_flowselectflow_identifier, regionincludedDataRetrieves information about a flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
list_flowsselectregionmaxResults, nextTokenReturns a list of flows and information about each flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
create_flowinsertregion, name, executionRoleArnCreates a prompt flow that you can use to send an input through various steps to yield an output. Configure nodes, each of which corresponds to a step of the flow, and create connections between the nodes to create paths to different outputs. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
update_flowupdateflow_identifier, region, name, executionRoleArnModifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
delete_flowdeleteflow_identifier, regionskipResourceInUseCheckDeletes a flow.
prepare_flowexecflow_identifier, regionPrepares the DRAFT version of a flow so that it can be invoked. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
validate_flow_definitionexecregion, definitionValidates the definition of a flow.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
flow_identifierstringThe unique identifier of the flow.
regionstringAWS region (default: us-east-1)
includedDatastringControls the scope of data returned. Set to METADATA_ONLY to return only resource metadata. Set to ALL_DATA or omit this field to return the full response.
maxResultsintegerThe maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.
nextTokenstringIf the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.
skipResourceInUseCheckbooleanBy default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use.

SELECT examples

Retrieves information about a flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

SELECT
id,
name,
arn,
created_at,
customer_encryption_key_arn,
definition,
description,
execution_role_arn,
status,
updated_at,
validations,
version
FROM aws.bedrock_agent.flows
WHERE flow_identifier = '{{ flow_identifier }}' -- required
AND region = '{{ region }}' -- required
AND includedData = '{{ includedData }}'
;

INSERT examples

Creates a prompt flow that you can use to send an input through various steps to yield an output. Configure nodes, each of which corresponds to a step of the flow, and create connections between the nodes to create paths to different outputs. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

INSERT INTO aws.bedrock_agent.flows (
name,
description,
executionRoleArn,
customerEncryptionKeyArn,
definition,
clientToken,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ executionRoleArn }}' /* required */,
'{{ customerEncryptionKeyArn }}',
'{{ definition }}',
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
id,
name,
arn,
created_at,
customer_encryption_key_arn,
definition,
description,
execution_role_arn,
status,
updated_at,
version
;

UPDATE examples

Modifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

UPDATE aws.bedrock_agent.flows
SET
name = '{{ name }}',
description = '{{ description }}',
executionRoleArn = '{{ executionRoleArn }}',
customerEncryptionKeyArn = '{{ customerEncryptionKeyArn }}',
definition = '{{ definition }}'
WHERE
flow_identifier = '{{ flow_identifier }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}' --required
AND executionRoleArn = '{{ executionRoleArn }}' --required
RETURNING
id,
name,
arn,
created_at,
customer_encryption_key_arn,
definition,
description,
execution_role_arn,
status,
updated_at,
version;

DELETE examples

Deletes a flow.

DELETE FROM aws.bedrock_agent.flows
WHERE flow_identifier = '{{ flow_identifier }}' --required
AND region = '{{ region }}' --required
AND skipResourceInUseCheck = '{{ skipResourceInUseCheck }}'
;

Lifecycle Methods

Prepares the DRAFT version of a flow so that it can be invoked. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

EXEC aws.bedrock_agent.flows.prepare_flow
@flow_identifier='{{ flow_identifier }}' --required,
@region='{{ region }}' --required
;