flows
Creates, updates, deletes, gets or lists a flows resource.
Overview
| Name | flows |
| Type | Resource |
| Id | aws.bedrock_agent.flows |
Fields
The following fields are returned by SELECT queries:
- get_flow
- list_flows
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the flow. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
name | string | The name of the flow. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
arn | string | The 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_at | string (date-time) | The time at which the flow was created. |
customer_encryption_key_arn | string | The 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>) |
definition | object | The definition of the nodes and connections between the nodes in the flow. |
description | string | The description of the flow. |
execution_role_arn | string | The 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>) |
status | string | The 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_at | string (date-time) | The time at which the flow was last updated. |
validations | array | A list of validation error messages related to the last failed operation on the flow. |
version | string | The version of the flow for which information was retrieved. (pattern: <code>DRAFT</code>) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the flow. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
name | string | The name of the flow. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
arn | string | The 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_at | string (date-time) | The time at which the flow was created. |
description | string | A description of the flow. |
status | string | The 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_at | string (date-time) | The time at which the flow was last updated. |
version | string | The latest version of the flow. (pattern: <code>DRAFT</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_flow | select | flow_identifier, region | includedData | Retrieves information about a flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide. |
list_flows | select | region | maxResults, nextToken | Returns 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_flow | insert | region, name, executionRoleArn | 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. | |
update_flow | update | flow_identifier, region, name, executionRoleArn | 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. | |
delete_flow | delete | flow_identifier, region | skipResourceInUseCheck | Deletes a flow. |
prepare_flow | exec | flow_identifier, region | 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. | |
validate_flow_definition | exec | region, definition | Validates 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.
| Name | Datatype | Description |
|---|---|---|
flow_identifier | string | The unique identifier of the flow. |
region | string | AWS region (default: us-east-1) |
includedData | string | Controls 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. |
maxResults | integer | The 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. |
nextToken | string | If 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. |
skipResourceInUseCheck | boolean | By 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
- get_flow
- list_flows
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 }}'
;
Returns 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.
SELECT
id,
name,
arn,
created_at,
description,
status,
updated_at,
version
FROM aws.bedrock_agent.flows
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_flow
- Manifest
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
;
# Description fields are for documentation purposes
- name: flows
props:
- name: region
value: "{{ region }}"
description: Required parameter for the flows resource.
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: executionRoleArn
value: "{{ executionRoleArn }}"
- name: customerEncryptionKeyArn
value: "{{ customerEncryptionKeyArn }}"
- name: definition
description: |
The definition of the nodes and connections between nodes in the flow.
value:
nodes:
- name: "{{ name }}"
type_: "{{ type_ }}"
configuration:
input: "{{ input }}"
output: "{{ output }}"
knowledgeBase:
knowledgeBaseId: "{{ knowledgeBaseId }}"
modelId: "{{ modelId }}"
guardrailConfiguration:
guardrailIdentifier: "{{ guardrailIdentifier }}"
guardrailVersion: "{{ guardrailVersion }}"
numberOfResults: {{ numberOfResults }}
promptTemplate:
textPromptTemplate: "{{ textPromptTemplate }}"
inferenceConfiguration:
text: "{{ text }}"
rerankingConfiguration:
type_: "{{ type_ }}"
bedrockRerankingConfiguration: "{{ bedrockRerankingConfiguration }}"
orchestrationConfiguration:
promptTemplate: "{{ promptTemplate }}"
inferenceConfig: "{{ inferenceConfig }}"
additionalModelRequestFields: "{{ additionalModelRequestFields }}"
performanceConfig: "{{ performanceConfig }}"
condition:
conditions:
- name: "{{ name }}"
expression: "{{ expression }}"
lex:
botAliasArn: "{{ botAliasArn }}"
localeId: "{{ localeId }}"
prompt:
sourceConfiguration:
resource: "{{ resource }}"
inline: "{{ inline }}"
guardrailConfiguration:
guardrailIdentifier: "{{ guardrailIdentifier }}"
guardrailVersion: "{{ guardrailVersion }}"
lambdaFunction:
lambdaArn: "{{ lambdaArn }}"
storage:
serviceConfiguration:
s3: "{{ s3 }}"
agent:
agentAliasArn: "{{ agentAliasArn }}"
retrieval:
serviceConfiguration:
s3: "{{ s3 }}"
iterator: "{{ iterator }}"
collector: "{{ collector }}"
inlineCode:
code: "{{ code }}"
language: "{{ language }}"
loop:
definition:
nodes: "{{ nodes }}"
connections: "{{ connections }}"
loopInput: "{{ loopInput }}"
loopController:
continueCondition:
name: "{{ name }}"
expression: "{{ expression }}"
maxIterations: {{ maxIterations }}
inputs: "{{ inputs }}"
outputs: "{{ outputs }}"
connections:
- type_: "{{ type_ }}"
name: "{{ name }}"
source: "{{ source }}"
target: "{{ target }}"
configuration:
data:
sourceOutput: "{{ sourceOutput }}"
targetInput: "{{ targetInput }}"
conditional:
condition: "{{ condition }}"
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_flow
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
- delete_flow
Deletes a flow.
DELETE FROM aws.bedrock_agent.flows
WHERE flow_identifier = '{{ flow_identifier }}' --required
AND region = '{{ region }}' --required
AND skipResourceInUseCheck = '{{ skipResourceInUseCheck }}'
;
Lifecycle Methods
- prepare_flow
- validate_flow_definition
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
;
Validates the definition of a flow.
EXEC aws.bedrock_agent.flows.validate_flow_definition
@region='{{ region }}' --required
@@json=
'{
"definition": "{{ definition }}"
}'
;