The following image shows a flow consisting of a single prompt, defined inline in the node. The prompt generates a playlist of songs from a JSON object input that includes the genre and the number of songs to include in the playlist.

To build and test this flow in the console
Create a flow by following the instructions at Create your first flow in Amazon Bedrock.
-
Set up the prompt node by doing the following:
-
Select the Prompt node in the center pane.
-
Select the Configure tab in the Flow builder pane.
-
Enter
MakePlaylist
as the Node name. -
Choose Define in node.
-
Set up the following configurations for the prompt:
-
Under Select model, select a model to run inference on the prompt.
-
In the Message text box, enter
Make me a {{genre}} playlist consisting of the following number of songs: {{number}}.
. This creates two variables that will appear as inputs into the node. -
(Optional) Modify the Inference configurations.
-
(Optional) If supported by the model, you can configure prompt Caching for the prompt message. For more information, see Create and design a flow in Amazon Bedrock.
-
-
Expand the Inputs section. The names for the inputs are prefilled by the variables in the prompt message. Configure the inputs as follows:
Name Type Expression genre String $.data.genre number Number $.data.number This configuration means that the prompt node expects a JSON object containing a field called
genre
that will be mapped to thegenre
input and a field callednumber
that will be mapped to thenumber
input. -
You can't modify the Output. It will be the response from the model, returned as a string.
-
-
Choose the Flow input node and select the Configure tab. Select Object as the Type. This means that flow invocation will expect to receive a JSON object.
-
Connect your nodes to complete the flow by doing the following:
-
Drag a connection from the output node of the Flow input node to the genre input in the MakePlaylist prompt node.
-
Drag a connection from the output node of the Flow input node to the number input in the MakePlaylist prompt node.
-
Drag a connection from the output node of the modelCompletion output in the MakePlaylist prompt node to the document input in the Flow output node.
-
-
Choose Save to save your flow. Your flow should now be prepared for testing.
-
Test your flow by entering the following JSON object is the Test flow pane on the right. Choose Run and the flow should return a model response.
{ "genre": "pop", "number": 3 }