Deploy a prompt flow in Amazon Bedrock - Amazon Bedrock

Deploy a prompt flow in Amazon Bedrock

Note

Prompt flows is in preview and is subject to change.

When you first create a prompt flow, a working draft version (DRAFT) and a test alias (TSTALIASID) that points to the working draft version are created. When you make changes to your prompt flow, the changes apply to the working draft, and so it is the latest version of your prompt flow. You iterate on your working draft until you're satisfied with the behavior of your prompt flow. Then, you can set up your prompt flow for deployment by creating versions of your prompt flow.

A version is a snapshot that preserves the resource as it exists at the time it was created. You can continue to modify the working draft and create versions of your prompt flow as necessary. Amazon Bedrock creates versions in numerical order, starting from 1. Versions are immutable because they act as a snapshot of your prompt flow at the time you created it. To make updates to a prompt flow that you've deployed to production, you must create a new version from the working draft and make calls to the alias that points to that version.

To deploy your prompt flow, you must create an alias that points to a version of your prompt flow. Then, you make InvokeFlow requests to that alias. With aliases, you can switch efficiently between different versions of your prompt flow without keeping track of the version. For example, you can change an alias to point to a previous version of your prompt flow if there are changes that you need to revert quickly.

To deploy your prompt flow

Create an alias and version of your prompt flow. Select the tab corresponding to your method of choice and follow the steps.

Console
To create a version of your Prompt flows
  1. Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at Getting Started with the AWS Management Console.

  2. Select Prompt flows from the left navigation pane. Then, choose a prompt flow in the Prompt flows section.

  3. In the Versions section, choose Publish version.

  4. After the version is published, a success banner appears at the top.

To create an alias for your Prompt flows
  1. Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at Getting Started with the AWS Management Console.

  2. Select Prompt flows from the left navigation pane. Then, choose a prompt flow in the Flows section.

  3. In the Aliases section, choose Create alias.

  4. Enter a unique name for the alias and provide an optional description.

  5. Choose one of the following options:

    • To create a new version, choose Create a new version and to associate it to this alias.

    • To use an existing version, choose Use an existing version to associate this alias. From the dropdown menu, choose the version that you want to associate the alias to.

  6. Select Create alias. A success banner appears at the top.

API

To create a version of your prompt flow, send a CreateFlowVersion request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint and specify the ARN or ID of the prompt flow as the flowIdentifier.

The response returns an ID and ARN for the version. Versions are created incrementally, starting from 1.

To create an alias to point to a version of your prompt flow, send a CreateFlowAlias request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint.

The following fields are required:

Field Basic description
flowIdentifier The ARN or ID of the prompt flow for which to create an alias.
name A name for the alias.
routingConfiguration Specify the version to map the alias to in the flowVersion field.

The following fields are optional:

Field Use-case
description To provide a description for the alias.
clientToken To prevent reduplication of the request.

To learn how to manage versions and aliases of prompt flows, select from the following topics.