---
title: "POST /flows/validate-definition"
method: POST
path: "/flows/validate-definition"
---

# POST /flows/validate-definition

`POST /flows/validate-definition`

Validates the definition of a flow.

## Request body

- object
  - `definition` object, required — 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

- ValidateFlowDefinitionResponse
  - `validations` FlowValidation[], required — Contains an array of objects, each of which contains an error identified by validation.
    - `message` string, required — A message describing the validation error.
    - `severity` 'Warning' | 'Error', required — The severity of the issue described in the message.
    - `details` object — Specific details about the validation issue encountered in the flow.
      - `cyclicConnection` object — Details about a cyclic connection in the flow.
        - `connection` string, required — The name of the connection that causes the cycle in the flow.
      - `duplicateConnections` object — Details about duplicate connections between nodes.
        - `source` string, required — The name of the source node where the duplicate connection starts.
        - `target` string, required — The name of the target node where the duplicate connection ends.
      - `duplicateConditionExpression` object — Details about duplicate condition expressions in a node.
        - `node` string, required — The name of the node containing the duplicate condition expressions.
        - `expression` string, password, required — The duplicated condition expression.
      - `unreachableNode` object — Details about an unreachable node in the flow.
        - `node` string, required — The name of the unreachable node.
      - `unknownConnectionSource` object — Details about an unknown source node for a connection.
        - `connection` string, required — The name of the connection with the unknown source.
      - `unknownConnectionSourceOutput` object — Details about an unknown source output for a connection.
        - `connection` string, required — The name of the connection with the unknown source output.
      - `unknownConnectionTarget` object — Details about an unknown target node for a connection.
        - `connection` string, required — The name of the connection with the unknown target.
      - `unknownConnectionTargetInput` object — Details about an unknown target input for a connection.
        - `connection` string, required — The name of the connection with the unknown target input.
      - `unknownConnectionCondition` object — Details about an unknown condition for a connection.
        - `connection` string, required — The name of the connection with the unknown condition.
      - `malformedConditionExpression` object — Details about a malformed condition expression in a node.
        - `node` string, required — The name of the node containing the malformed condition expression.
        - `condition` string, required — The name of the malformed condition.
        - `cause` string, required — The error message describing why the condition expression is malformed.
      - `malformedNodeInputExpression` object — Details about a malformed input expression in a node.
        - `node` string, required — The name of the node containing the malformed input expression.
        - `input` string, required — The name of the input with the malformed expression.
        - `cause` string, required — The error message describing why the input expression is malformed.
      - `mismatchedNodeInputType` object — Details about mismatched input data types in a node.
        - `node` string, required — The name of the node containing the input with the mismatched data type.
        - `input` string, required — The name of the input with the mismatched data type.
        - `expectedType` 'String' | 'Number' | 'Boolean' | 'Object' | 'Array', required — The expected data type for the node input.
      - `mismatchedNodeOutputType` object — Details about mismatched output data types in a node.
        - `node` string, required — The name of the node containing the output with the mismatched data type.
        - `output` string, required — The name of the output with the mismatched data type.
        - `expectedType` 'String' | 'Number' | 'Boolean' | 'Object' | 'Array', required — The expected data type for the node output.
      - `incompatibleConnectionDataType` object — Details about incompatible data types in a connection.
        - `connection` string, required — The name of the connection with incompatible data types.
      - `missingConnectionConfiguration` object — Details about missing configuration for a connection.
        - `connection` string, required — The name of the connection missing configuration.
      - `missingDefaultCondition` object — Details about a missing default condition in a conditional node.
        - `node` string, required — The name of the node missing the default condition.
      - `missingEndingNodes` object — Details about missing ending nodes in the flow.
      - `missingNodeConfiguration` object — Details about missing configuration for a node.
        - `node` string, required — The name of the node missing a required configuration.
      - `missingNodeInput` object — Details about a missing required input in a node.
        - `node` string, required — The name of the node missing the required input.
        - `input` string, required — The name of the missing input.
      - `missingNodeOutput` object — Details about a missing required output in a node.
        - `node` string, required — The name of the node missing the required output.
        - `output` string, required — The name of the missing output.
      - `missingStartingNodes` object — Details about missing starting nodes in the flow.
      - `multipleNodeInputConnections` object — Details about multiple connections to a single node input.
        - `node` string, required — The name of the node containing the input with multiple connections.
        - `input` string, required — The name of the input with multiple connections to it.
      - `unfulfilledNodeInput` object — Details about an unfulfilled node input with no valid connections.
        - `node` string, required — The name of the node containing the unfulfilled input.
        - `input` string, required — The name of the unfulfilled input. An input is unfulfilled if there are no data connections to it.
      - `unsatisfiedConnectionConditions` object — Details about unsatisfied conditions for a connection.
        - `connection` string, required — The name of the connection with unsatisfied conditions.
      - `unspecified` object — Details about an unspecified validation.
      - `unknownNodeInput` object — Details about an unknown input for a node.
        - `node` string, required — The name of the unknown input.
        - `input` string, required — The name of the node with the unknown input.
      - `unknownNodeOutput` object — Details about an unknown output for a node.
        - `node` string, required — The name of the node with the unknown output.
        - `output` string, required — The name of the unknown output.
      - `missingLoopInputNode` object — Details about a flow that's missing a required <code>LoopInput</code> node in a DoWhile loop.
        - `loopNode` string, required — The DoWhile loop in a flow that's missing a required <code>LoopInput</code> node.
      - `missingLoopControllerNode` object — Details about a flow that's missing a required <code>LoopController</code> node in a DoWhile loop.
        - `loopNode` string, required — The DoWhile loop in a flow that's missing a required <code>LoopController</code> node.
      - `multipleLoopInputNodes` object — Details about a flow that contains multiple <code>LoopInput</code> nodes in a DoWhile loop.
        - `loopNode` string, required — The DoWhile loop in a flow that contains multiple <code>LoopInput</code> nodes.
      - `multipleLoopControllerNodes` object — Details about a flow that contains multiple <code>LoopController</code> nodes in a DoWhile loop.
        - `loopNode` string, required — The DoWhile loop in a flow that contains multiple <code>LoopController</code> nodes.
      - `loopIncompatibleNodeType` object — Details about a flow that includes incompatible node types in a DoWhile loop.
        - `node` string, required — The <code>Loop</code> container node that contains an incompatible node.
        - `incompatibleNodeType` 'Input' | 'Condition' | 'Iterator' | 'Collector', required — The node type of the incompatible node in the DoWhile loop. Some node types, like a condition node, aren't allowed in a DoWhile loop.
        - `incompatibleNodeName` string, required — The node that's incompatible in the DoWhile loop.
      - `invalidLoopBoundary` object — Details about a flow that includes connections that violate loop boundary rules.
        - `connection` string, required — The name of the connection that violates loop boundary rules.
        - `source` string, required — The source node of the connection that violates DoWhile loop boundary rules.
        - `target` string, required — The target node of the connection that violates DoWhile loop boundary rules.
    - `type` 'CyclicConnection' | 'DuplicateConnections' | 'DuplicateConditionExpression' | 'UnreachableNode' | 'UnknownConnectionSource' | 'UnknownConnectionSourceOutput' | 'UnknownConnectionTarget' | 'UnknownConnectionTargetInput' | 'UnknownConnectionCondition' | 'MalformedConditionExpression' | 'MalformedNodeInputExpression' | 'MismatchedNodeInputType' | 'MismatchedNodeOutputType' | 'IncompatibleConnectionDataType' | 'MissingConnectionConfiguration' | 'MissingDefaultCondition' | 'MissingEndingNodes' | 'MissingNodeConfiguration' | 'MissingNodeInput' | 'MissingNodeOutput' | 'MissingStartingNodes' | 'MultipleNodeInputConnections' | 'UnfulfilledNodeInput' | 'UnsatisfiedConnectionConditions' | 'Unspecified' | 'UnknownNodeInput' | 'UnknownNodeOutput' | 'MissingLoopInputNode' | 'MissingLoopControllerNode' | 'MultipleLoopInputNodes' | 'MultipleLoopControllerNodes' | 'LoopIncompatibleNodeType' | 'InvalidLoopBoundary' — The type of validation issue encountered in the flow.

## Other responses

- `480` — ThrottlingException
- `481` — AccessDeniedException
- `482` — ValidationException
- `483` — InternalServerException

---

[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)
