Flow nodes available in Amazon Bedrock IDE - Amazon SageMaker Unified Studio

Amazon SageMaker Unified Studio is in preview release and is subject to change.

Flow nodes available in Amazon Bedrock IDE

Amazon Bedrock IDE provides the following node types to build your flow app. A node comprises of the following:

  • Name – The name for the node.

  • Type – the type of the node. For more information, see Flow nodes available in Amazon Bedrock IDE.

  • Inputs – Provide a name and data type for each input. Some nodes have pre-defined names or types that you must use. In the expression field, define the part of the whole input to use as the individual input. For more information, see Define inputs with expressions.

    In the flow builder, an input appears as a circle on the left edge of a node. Connect each input to an output of an upstream node.

  • Outputs – Provide a name and data type for each output. Some nodes have pre-defined names or types that you must use. In the flow builder, an output appears as a circle on the right edge of a node. Connect each output to at least one input in a downstream node. If an output from a node is sent to more than one node, or if a condition node is included, the path of a flow will split into multiple branches. Each branch can potentially yield another output in the flow response.

  • Configuration – You define node-specific fields at the top of the node.

Note

Amazon Bedrock IDE supports a subset of the nodes that are available in Amazon Bedrock. For more information, see Node types in flow.

Flow input

Every flow contains only one flow input node and must begin with it. When you run the flow, the input is fed into this node and the configured output is passed to the next step.

Configuration

  • Node name – N/A

  • Input field name – N/A

  • Input field types – N/A

  • Input expression – N/A

  • Output field name – document

  • Output field types – String, Number, Boolean, Object and Array.

  • Output expression – No

Flow output

A flow output node extracts the input data from the previous node, based on the defined expression, and returns it. A flow can have multiple flow output nodes if there are multiple branches in the flow.

  • Node name – Any

  • Input field name – document

  • Input field types – String, Number, Boolean, Object and Array.

  • Input expression – Yes

  • Output field name – N/A

  • Output field types – N/A

  • Output expression – N/A

Condition

A condition node sends data from the previous node to different nodes, depending on the conditions that are defined. A condition node can take multiple inputs.

  • Node name – Any

  • Input field name – Any

  • Input field types – String, Number, Boolean, Object and Array.

  • Input expression – Yes

  • Condition field name – Any

  • Output field types – String, Number, Boolean, Object and Array.

  • Output expression – Yes

Condition expressions

To define a condition, you refer to an input by its name and compare it to a value using any of the following relational operators:

Operator Meaning Supported data types Example usage Example meaning
== Equal to (the data type must also be equal) String, Number, Boolean A == B If A is equal to B
!= Not equal to String, Number, Boolean A != B If A isn't equal to B
> Greater than Number A > B If A is greater than B
>= Greater than or equal to Number A >= B If A is greater than or equal to B
< Less than Number A < B If A is less than B
<= Less than or equal to Number A <= B If A is less than or equal to B

You can compare inputs to other inputs or to a constant in a conditional expression. For example, if you have a numerical input called profit and another one called expenses, both profit > expenses or profit <= 1000 are valid expressions.

You can use the following logical operators to combine expressions for more complex conditions. We recommend that you use parentheses to resolve ambiguities in grouping of expressions:

Operator Meaning Example usage Example meaning
and Both expressions are true (A < B) and (C == 1) If both expressions are true:
  • A is less than B

  • C is equal to 1

or At least one expression is true (A != 2) or (B > C) If either expressions is true:
  • A isn't equal to B

  • B is greater than C

not The expression isn't true not (A > B) If A isn't greater than B (equivalent to A <= B)

Prompt node

A prompt node defines a prompt to use in the flow. The inputs to the prompt node are values to fill in the variables that you define for the prompt. The output is the generated response from the model. For more information, see Reuse and share prompts.

  • Node name – Any

  • Prompt – The prompt that the prompt node uses.

  • Version – The prompt the version of the prompt.

  • Input field name – The name of the prompt variable.

  • Input field types – String, Number, Boolean, Object and Array.

  • Input expression – Yes

  • Condition field name – modelCompletion

  • Output field types – String

  • Output expression – No

Knowledge Base node

A Knowledge Base node lets you send a query to a knowledge base. For more information, see Document data source.

  • Node name – Any

  • Knowledge base – The Knowledge Base that the node uses.

  • Response type – The model that the node uses to generate a response.

  • Input field name – retrievalQuery

  • Input field types – String

  • Input expression – Yes

  • Condition field name – outputText

  • Output field types – String

  • Output expression – No