---
title: "PUT /flows/{flowIdentifier}/"
method: PUT
path: "/flows/{flowIdentifier}/"
---

# PUT /flows/{flowIdentifier}/

`PUT /flows/{flowIdentifier}/`

Modifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html">How it works</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html">Create a flow in Amazon Bedrock</a> in the Amazon Bedrock User Guide.

## Path parameters

- `flowIdentifier` string, required

## Request body

- object
  - `name` string, required — A name for the flow.
  - `description` string — A description for the flow.
  - `executionRoleArn` string, required — The Amazon Resource Name (ARN) of the service role with permissions to create and manage a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.
  - `customerEncryptionKeyArn` string — The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.
  - `definition` object — The definition of the nodes and connections between nodes in the flow.
    - `nodes` FlowNode[] — An array of node definitions in the flow.
      - `name` string, required — A name for the node.
      - `type` 'Input' | 'Output' | 'KnowledgeBase' | 'Condition' | 'Lex' | 'Prompt' | 'LambdaFunction' | 'Storage' | 'Agent' | 'Retrieval' | 'Iterator' | 'Collector' | 'InlineCode' | 'Loop' | 'LoopInput' | 'LoopController', required — The type of node. This value must match the name of the key that you provide in the configuration you provide in the <code>FlowNodeConfiguration</code> field.
      - `configuration` object — Contains configurations for the node.
        - `input` object — Contains configurations for an input flow node in your flow. The first node in the flow. <code>inputs</code> can't be specified for this node.
        - `output` object — Contains configurations for an output flow node in your flow. The last node in the flow. <code>outputs</code> can't be specified for this node.
        - `knowledgeBase` object — Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.
          - `knowledgeBaseId` string, required — The unique identifier of the knowledge base to query.
          - `modelId` string — The unique identifier of the model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a> to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.
          - `guardrailConfiguration` object — Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.
            - `guardrailIdentifier` string — The unique identifier of the guardrail.
            - `guardrailVersion` string — The version of the guardrail.
          - `numberOfResults` integer — The number of results to retrieve from the knowledge base.
          - `promptTemplate` object — A custom prompt template to use with the knowledge base for generating responses.
            - `textPromptTemplate` string, password — The text of the prompt template.
          - `inferenceConfiguration` object — Contains inference configurations for the prompt.
            - `text` object — Contains inference configurations for a text prompt.
              - …
          - `rerankingConfiguration` object — The configuration for reranking the retrieved results from the knowledge base to improve relevance.
            - `type` 'BEDROCK_RERANKING_MODEL', required — Specifies the type of reranking model to use. Currently, the only supported value is <code>BEDROCK_RERANKING_MODEL</code>.
            - `bedrockRerankingConfiguration` object — Specifies the configuration for using an Amazon Bedrock reranker model to rerank retrieved results.
              - …
          - `orchestrationConfiguration` object — The configuration for orchestrating the retrieval and generation process in the knowledge base node.
            - `promptTemplate` object — A custom prompt template for orchestrating the retrieval and generation process.
              - …
            - `inferenceConfig` object — Contains inference configurations for the prompt.
              - …
            - `additionalModelRequestFields` object — The additional model-specific request parameters as key-value pairs to be included in the request to the foundation model.
            - `performanceConfig` object — The performance configuration options for the knowledge base retrieval and generation process.
              - …
        - `condition` object — Contains configurations for a condition node in your flow. Defines conditions that lead to different branches of the flow.
          - `conditions` FlowCondition[], required — An array of conditions. Each member contains the name of a condition and an expression that defines the condition.
            - `name` string, required — A name for the condition that you can reference.
            - `expression` string, password — Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes">Node types in prompt flows</a>.
        - `lex` object — Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.
          - `botAliasArn` string, required — The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.
          - `localeId` string, required — The Region to invoke the Amazon Lex bot in.
        - `prompt` object — Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.
          - `sourceConfiguration` object, required — Specifies whether the prompt is from Prompt management or defined inline.
            - `resource` object — Contains configurations for a prompt from Prompt management.
              - …
            - `inline` object — Contains configurations for a prompt that is defined inline
              - …
          - `guardrailConfiguration` object — Contains configurations for a guardrail to apply to the prompt in this node and the response generated from it.
            - `guardrailIdentifier` string — The unique identifier of the guardrail.
            - `guardrailVersion` string — The version of the guardrail.
        - `lambdaFunction` object — Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.
          - `lambdaArn` string, required — The Amazon Resource Name (ARN) of the Lambda function to invoke.
        - `storage` object — Contains configurations for a storage node in your flow. Stores an input in an Amazon S3 location.
          - `serviceConfiguration` object, required — Contains configurations for the service to use for storing the input into the node.
            - `s3` object — Contains configurations for the Amazon S3 location in which to store the input into the node.
              - …
        - `agent` object — Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.
          - `agentAliasArn` string, required — The Amazon Resource Name (ARN) of the alias of the agent to invoke.
        - `retrieval` object — Contains configurations for a retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.
          - `serviceConfiguration` object, required — Contains configurations for the service to use for retrieving data to return as the output from the node.
            - `s3` object — Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.
              - …
        - `iterator` object — <p>Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.</p> <p>The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.</p>
        - `collector` object — Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.
        - `inlineCode` object — Contains configurations for an inline code node in your flow. Inline code nodes let you write and execute code directly within your flow, enabling data transformations, custom logic, and integrations without needing an external Lambda function.
          - `code` string, password, required — <p>The code that's executed in your inline code node. The code can access input data from previous nodes in the flow, perform operations on that data, and produce output that can be used by other nodes in your flow.</p> <p>The code must be valid in the programming <code>language</code> that you specify.</p>
          - `language` 'Python_3', required — <p>The programming language used by your inline code node.</p> <p>The code must be valid in the programming <code>language</code> that you specify. Currently, only Python 3 (<code>Python_3</code>) is supported.</p>
        - `loop` object — Contains configurations for a DoWhile loop in your flow.
          - `definition` object, required — The definition of the DoWhile loop nodes and connections between nodes in the flow.
            - `nodes` FlowNode[] — An array of node definitions in the flow.
            - `connections` FlowConnection[] — An array of connection definitions in the flow.
              - …
        - `loopInput` object — Contains input node configurations for a DoWhile loop in your flow.
        - `loopController` object — Contains controller node configurations for a DoWhile loop in your flow.
          - `continueCondition` object, required — Specifies the condition that determines when the flow exits the DoWhile loop. The loop executes until this condition evaluates to true.
            - `name` string, required — A name for the condition that you can reference.
            - `expression` string, password — Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes">Node types in prompt flows</a>.
          - `maxIterations` integer — Specifies the maximum number of times the DoWhile loop can iterate before the flow exits the loop.
      - `inputs` FlowNodeInput[] — An array of objects, each of which contains information about an input into the node.
        - `name` string, required — Specifies a name for the input that you can reference.
        - `type` 'String' | 'Number' | 'Boolean' | 'Object' | 'Array', required — Specifies the data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.
        - `expression` string, password, required — An expression that formats the input for the node. For an explanation of how to create expressions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-expressions.html">Expressions in Prompt flows in Amazon Bedrock</a>.
        - `category` 'LoopCondition' | 'ReturnValueToLoopStart' | 'ExitLoop' — <p>Specifies how input data flows between iterations in a DoWhile loop.</p> <ul> <li> <p> <code>LoopCondition</code> - Controls whether the loop continues by evaluating condition expressions against the input data. Use this category to define the condition that determines if the loop should continue. </p> </li> <li> <p> <code>ReturnValueToLoopStart</code> - Defines data to pass back to the start of the loop's next iteration. Use this category for variables that you want to update for each loop iteration.</p> </li> <li> <p> <code>ExitLoop</code> - Defines the value that's available once the loop ends. Use this category to expose loop results to nodes outside the loop.</p> </li> </ul>
      - `outputs` FlowNodeOutput[] — A list of objects, each of which contains information about an output from the node.
        - `name` string, required — A name for the output that you can reference.
        - `type` 'String' | 'Number' | 'Boolean' | 'Object' | 'Array', required — The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.
    - `connections` FlowConnection[] — An array of connection definitions in the flow.
      - `type` 'Data' | 'Conditional', required — Whether the source node that the connection begins from is a condition node (<code>Conditional</code>) or not (<code>Data</code>).
      - `name` string, required — A name for the connection that you can reference.
      - `source` string, required — The node that the connection starts at.
      - `target` string, required — The node that the connection ends at.
      - `configuration` object — The configuration of the connection.
        - `data` object — The configuration of a connection originating from a node that isn't a Condition node.
          - `sourceOutput` string, required — The name of the output in the source node that the connection begins from.
          - `targetInput` string, required — The name of the input in the target node that the connection ends at.
        - `conditional` object — The configuration of a connection originating from a Condition node.
          - `condition` string, required — The condition that triggers this connection. For more information about how to write conditions, see the <b>Condition</b> node type in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/node-types.html">Node types</a> topic in the Amazon Bedrock User Guide.

## Response `200`

Success

- UpdateFlowResponse
  - `name` string, required — The name of the flow.
  - `description` string — The description of the flow.
  - `executionRoleArn` string, required — The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.
  - `customerEncryptionKeyArn` string — The Amazon Resource Name (ARN) of the KMS key that the flow was encrypted with.
  - `id` string, required — The unique identifier of the flow.
  - `arn` string, required — The Amazon Resource Name (ARN) of the flow.
  - `status` 'Failed' | 'Prepared' | 'Preparing' | 'NotPrepared', required — The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If updating fails, the status becomes <code>Failed</code>.
  - `createdAt` string, date-time, required — The time at which the flow was created.
  - `updatedAt` string, date-time, required — The time at which the flow was last updated.
  - `version` string, required — The version of the flow. When you update a flow, the version updated is the <code>DRAFT</code> version.
  - `definition` object — A definition of the nodes and the connections between nodes in the flow.
    - `nodes` FlowNode[] — An array of node definitions in the flow.
      - `name` string, required — A name for the node.
      - `type` 'Input' | 'Output' | 'KnowledgeBase' | 'Condition' | 'Lex' | 'Prompt' | 'LambdaFunction' | 'Storage' | 'Agent' | 'Retrieval' | 'Iterator' | 'Collector' | 'InlineCode' | 'Loop' | 'LoopInput' | 'LoopController', required — The type of node. This value must match the name of the key that you provide in the configuration you provide in the <code>FlowNodeConfiguration</code> field.
      - `configuration` object — Contains configurations for the node.
        - `input` object — Contains configurations for an input flow node in your flow. The first node in the flow. <code>inputs</code> can't be specified for this node.
        - `output` object — Contains configurations for an output flow node in your flow. The last node in the flow. <code>outputs</code> can't be specified for this node.
        - `knowledgeBase` object — Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.
          - `knowledgeBaseId` string, required — The unique identifier of the knowledge base to query.
          - `modelId` string — The unique identifier of the model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a> to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.
          - `guardrailConfiguration` object — Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.
            - `guardrailIdentifier` string — The unique identifier of the guardrail.
            - `guardrailVersion` string — The version of the guardrail.
          - `numberOfResults` integer — The number of results to retrieve from the knowledge base.
          - `promptTemplate` object — A custom prompt template to use with the knowledge base for generating responses.
            - `textPromptTemplate` string, password — The text of the prompt template.
          - `inferenceConfiguration` object — Contains inference configurations for the prompt.
            - `text` object — Contains inference configurations for a text prompt.
              - …
          - `rerankingConfiguration` object — The configuration for reranking the retrieved results from the knowledge base to improve relevance.
            - `type` 'BEDROCK_RERANKING_MODEL', required — Specifies the type of reranking model to use. Currently, the only supported value is <code>BEDROCK_RERANKING_MODEL</code>.
            - `bedrockRerankingConfiguration` object — Specifies the configuration for using an Amazon Bedrock reranker model to rerank retrieved results.
              - …
          - `orchestrationConfiguration` object — The configuration for orchestrating the retrieval and generation process in the knowledge base node.
            - `promptTemplate` object — A custom prompt template for orchestrating the retrieval and generation process.
              - …
            - `inferenceConfig` object — Contains inference configurations for the prompt.
              - …
            - `additionalModelRequestFields` object — The additional model-specific request parameters as key-value pairs to be included in the request to the foundation model.
            - `performanceConfig` object — The performance configuration options for the knowledge base retrieval and generation process.
              - …
        - `condition` object — Contains configurations for a condition node in your flow. Defines conditions that lead to different branches of the flow.
          - `conditions` FlowCondition[], required — An array of conditions. Each member contains the name of a condition and an expression that defines the condition.
            - `name` string, required — A name for the condition that you can reference.
            - `expression` string, password — Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes">Node types in prompt flows</a>.
        - `lex` object — Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.
          - `botAliasArn` string, required — The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.
          - `localeId` string, required — The Region to invoke the Amazon Lex bot in.
        - `prompt` object — Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.
          - `sourceConfiguration` object, required — Specifies whether the prompt is from Prompt management or defined inline.
            - `resource` object — Contains configurations for a prompt from Prompt management.
              - …
            - `inline` object — Contains configurations for a prompt that is defined inline
              - …
          - `guardrailConfiguration` object — Contains configurations for a guardrail to apply to the prompt in this node and the response generated from it.
            - `guardrailIdentifier` string — The unique identifier of the guardrail.
            - `guardrailVersion` string — The version of the guardrail.
        - `lambdaFunction` object — Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.
          - `lambdaArn` string, required — The Amazon Resource Name (ARN) of the Lambda function to invoke.
        - `storage` object — Contains configurations for a storage node in your flow. Stores an input in an Amazon S3 location.
          - `serviceConfiguration` object, required — Contains configurations for the service to use for storing the input into the node.
            - `s3` object — Contains configurations for the Amazon S3 location in which to store the input into the node.
              - …
        - `agent` object — Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.
          - `agentAliasArn` string, required — The Amazon Resource Name (ARN) of the alias of the agent to invoke.
        - `retrieval` object — Contains configurations for a retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.
          - `serviceConfiguration` object, required — Contains configurations for the service to use for retrieving data to return as the output from the node.
            - `s3` object — Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.
              - …
        - `iterator` object — <p>Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.</p> <p>The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.</p>
        - `collector` object — Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.
        - `inlineCode` object — Contains configurations for an inline code node in your flow. Inline code nodes let you write and execute code directly within your flow, enabling data transformations, custom logic, and integrations without needing an external Lambda function.
          - `code` string, password, required — <p>The code that's executed in your inline code node. The code can access input data from previous nodes in the flow, perform operations on that data, and produce output that can be used by other nodes in your flow.</p> <p>The code must be valid in the programming <code>language</code> that you specify.</p>
          - `language` 'Python_3', required — <p>The programming language used by your inline code node.</p> <p>The code must be valid in the programming <code>language</code> that you specify. Currently, only Python 3 (<code>Python_3</code>) is supported.</p>
        - `loop` object — Contains configurations for a DoWhile loop in your flow.
          - `definition` object, required — The definition of the DoWhile loop nodes and connections between nodes in the flow.
            - `nodes` FlowNode[] — An array of node definitions in the flow.
            - `connections` FlowConnection[] — An array of connection definitions in the flow.
              - …
        - `loopInput` object — Contains input node configurations for a DoWhile loop in your flow.
        - `loopController` object — Contains controller node configurations for a DoWhile loop in your flow.
          - `continueCondition` object, required — Specifies the condition that determines when the flow exits the DoWhile loop. The loop executes until this condition evaluates to true.
            - `name` string, required — A name for the condition that you can reference.
            - `expression` string, password — Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes">Node types in prompt flows</a>.
          - `maxIterations` integer — Specifies the maximum number of times the DoWhile loop can iterate before the flow exits the loop.
      - `inputs` FlowNodeInput[] — An array of objects, each of which contains information about an input into the node.
        - `name` string, required — Specifies a name for the input that you can reference.
        - `type` 'String' | 'Number' | 'Boolean' | 'Object' | 'Array', required — Specifies the data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.
        - `expression` string, password, required — An expression that formats the input for the node. For an explanation of how to create expressions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-expressions.html">Expressions in Prompt flows in Amazon Bedrock</a>.
        - `category` 'LoopCondition' | 'ReturnValueToLoopStart' | 'ExitLoop' — <p>Specifies how input data flows between iterations in a DoWhile loop.</p> <ul> <li> <p> <code>LoopCondition</code> - Controls whether the loop continues by evaluating condition expressions against the input data. Use this category to define the condition that determines if the loop should continue. </p> </li> <li> <p> <code>ReturnValueToLoopStart</code> - Defines data to pass back to the start of the loop's next iteration. Use this category for variables that you want to update for each loop iteration.</p> </li> <li> <p> <code>ExitLoop</code> - Defines the value that's available once the loop ends. Use this category to expose loop results to nodes outside the loop.</p> </li> </ul>
      - `outputs` FlowNodeOutput[] — A list of objects, each of which contains information about an output from the node.
        - `name` string, required — A name for the output that you can reference.
        - `type` 'String' | 'Number' | 'Boolean' | 'Object' | 'Array', required — The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.
    - `connections` FlowConnection[] — An array of connection definitions in the flow.
      - `type` 'Data' | 'Conditional', required — Whether the source node that the connection begins from is a condition node (<code>Conditional</code>) or not (<code>Data</code>).
      - `name` string, required — A name for the connection that you can reference.
      - `source` string, required — The node that the connection starts at.
      - `target` string, required — The node that the connection ends at.
      - `configuration` object — The configuration of the connection.
        - `data` object — The configuration of a connection originating from a node that isn't a Condition node.
          - `sourceOutput` string, required — The name of the output in the source node that the connection begins from.
          - `targetInput` string, required — The name of the input in the target node that the connection ends at.
        - `conditional` object — The configuration of a connection originating from a Condition node.
          - `condition` string, required — The condition that triggers this connection. For more information about how to write conditions, see the <b>Condition</b> node type in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/node-types.html">Node types</a> topic in the Amazon Bedrock User Guide.

## Other responses

- `480` — ThrottlingException
- `481` — AccessDeniedException
- `482` — ValidationException
- `483` — InternalServerException
- `484` — ResourceNotFoundException
- `485` — ConflictException
- `486` — ServiceQuotaExceededException

---

[API](https://skmtc.net/aws/apis/bedrock-agent.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agent/versions/a3b2356f17da/schema)
