Skip to main content
Version: 1.28 (Current)

Aws AI Chat

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, Connectors

Sends a message to a chat model on Amazon Bedrock and stores the reply in a token. You pick the model family (Claude, Llama or Titan), can give the model instructions, pass the earlier messages of a conversation, and let Claude or Llama run your workflows as tools.

The AWS sign-in details come from an Amazon Bedrock AI connector.

note

This action is part of the PlantAnApp.OpenAi add-on. The add-on is installed separately and requires the AI feature package to be licensed. If it isn't licensed, the action fails with a not-licensed error. The Amazon Bedrock AI connector type needs the same license.

Typical Use Cases​

  • Answer users' questions with a model hosted in your own AWS account and region
  • Continue a conversation by passing the earlier messages back to the model
  • Let Claude run a workflow to look something up, for example an order status, before it answers
  • Stream the reply word by word to a Conversation View

Don't use it to​

  • Send data you aren't allowed to share with AWS or the model provider. Everything in the message, instructions and history leaves your server.
  • Make decisions that must always be correct, such as approvals or calculations. Check the reply, or use normal actions and SQL.
  • Get JSON replies with a schema, or control temperature and length. Use Chat instead.
  • Send images or files. The action sends text only.
Action NameDescription
ChatChats with OpenAI or Microsoft Azure OpenAI models.
VertexAI ChatChats with Google Vertex AI models.
Summarize ContentSummarizes long content with OpenAI.
Create ArticlesWrites articles with OpenAI.
Count TokensCounts the tokens in a text for an OpenAI model.
Speech to Text (Whisper)Turns an audio file into text with OpenAI.
Add ConnectorCreates a connector, for example an Amazon Bedrock AI connector.
Test ConnectorChecks that a connector's details work.
Execute ActionsCatches this action's errors with its On Error actions.

Comparing the chat actions​

ChatAws AI ChatVertexAI Chat
ProviderOpenAI or Microsoft Azure OpenAIAmazon BedrockGoogle Vertex AI
Connector typeOpenAI (openAi) or Microsoft Azure OpenAI (azure.openAi)Amazon Bedrock AI (plantanapp.aws.bedrock)Google VertexAI (vertexAi)
ModelsOpenAI: picked from PAA's model list. Azure: your deployment.Claude, Llama or Titan, in fixed versionsGemini and older PaLM models from PAA's list, or any model ID with an expression
Temperature and maximum lengthYesNo, fixed per modelYes
JSON or JSON Schema replyYesNoNo
Workflows as toolsYesClaude and Llama onlyNo
StreamingOptionalOptionalRequired for Gemini, not possible for PaLM
Ignore Errors and On ErrorYesNoYes

Connecting to Amazon Bedrock​

Create a connector first, in the Connectors area or with Add Connector. See Connectors.

Connector typeFieldDescription
Amazon Bedrock AI (plantanapp.aws.bedrock)AWS RegionThe AWS region to call, for example us-east-1. Required by this action.
Amazon Bedrock AI (plantanapp.aws.bedrock)Access Key IDThe access key ID of an AWS user that may call Bedrock.
Amazon Bedrock AI (plantanapp.aws.bedrock)Access Key SecretThe secret for that access key.

In your AWS account, the model you pick must be enabled for Bedrock in that region.

Test Connector checks the connector by asking AWS for the list of foundation models. A successful test doesn't prove that you have access to a specific model. The test also falls back to us-east-1 when the region is empty, but this action fails without a region.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
ConnectorThe Amazon Bedrock AI connector. You can also switch to an expression and use a token that holds the connector ID.YesemptyYes
AWS Model IdThe model family: Claude, Llama or Titan. With an expression, use one of these exact names. See Models.YesClaudeNo
MessageThe new user message, for example [Question].Yesempty stringYes
WorkflowsWorkflows the model may run as tools. Claude and Llama only. See Workflows as tools.YesemptyNo
Dynamic WorkflowsMore workflow IDs, separated by commas or new lines. They're added to Workflows.Yesempty stringNo
Stream ResponseStreams the reply to a Conversation View while it's being written. Not supported with Titan. See Streaming.NofalseNo
Live Stream NameThe name of the live stream. It must be unique across the site. Shown when Stream Response is on.Yesempty stringWith streaming
Message Stream IDThe ID of this message in the live stream. It must be unique within the live stream. Shown when Stream Response is on.Yesempty stringWith streaming
InstructionsThe system message. Tells the model how to behave, for example You are a helpful support assistant for [CompanyName].Yesempty stringNo
Previous Message JsonThe earlier messages of the conversation, as a JSON array. See Messages and history.Yesempty stringNo

Output Parameters Reference​

ParameterDescription
Store Output MessageThe token that gets the model's reply as text.
Store Entire Conversation JSONThe token that gets the whole conversation as a JSON array, including the new message and the reply. You can pass it back as Previous Message Json in the next call. The instructions aren't included.
Store Entire OutputMeant for the full JSON response from AWS. In 1.28 this token isn't filled. Use Store AI Debug Payloads JSON instead.
Store AI Debug Payloads JSONThe token that gets a JSON array with every request sent and every response received from Bedrock, with timestamps. Token counts are in the responses. Your AWS keys aren't included.

Models​

AWS Model Id picks a model family. Each family uses one fixed model version and fixed settings:

AWS Model IdBedrock modelTemperatureMaximum reply length
Claudeanthropic.claude-3-sonnet-20240229-v1:00.52,000 tokens
Llamameta.llama2-70b-chat-v10.5512 tokens
Titanamazon.titan-text-express-v10512 tokens

You can't change these values. AWS retires older model versions over time, so check that the model is still available in your region.

Messages and history​

Instructions, Previous Message Json and Message are combined in the format each model expects. For Claude, the instructions are the system prompt. For Llama and Titan, they're placed at the start of the prompt.

Previous Message Json is a JSON array of role and content pairs:

[
{ "role": "user", "content": "Hi, my printer won't print." },
{ "role": "assistant", "content": "Sorry to hear that. Is it showing an error light?" }
]

The history must follow these rules, or the action fails with The history json is invalid:

  • It starts with a user message.
  • Messages alternate: a user (or tool) message, then an assistant message. So there's always an even number of messages.
  • Every assistant message has content.
  • Roles aren't case-sensitive.

The easiest way to keep a conversation going is to store Store Entire Conversation JSON in a token and pass that token back as Previous Message Json next time. The stored JSON has the roles User, Assistant and, after workflow calls, Tool. You can pass it back unchanged.

Workflows as tools​

Add workflows in Workflows or Dynamic Workflows to let Claude or Llama run them. The model decides whether to run one, based on the question.

  • Use numeric workflow IDs. In 1.28, workflows given by GUID pass the check but aren't offered to the model.
  • PAA describes the workflows to the model in its instructions, with their names, descriptions, and input and output fields.
  • When the model asks for a workflow, PAA runs it in a new, separate context. The model's arguments become tokens named after the input fields. Tokens from the calling action aren't available.
  • Every output field must have a value when the workflow ends. The values go back to the model, which then writes its reply.
  • Each workflow call is another request to Bedrock and adds to the cost.
  • Titan doesn't use workflows. They're ignored.

See Workflows for how to set up input and output fields.

Streaming​

With Stream Response on, the reply is sent to a live stream while the model writes it. The action still waits for the full reply and stores it in Store Output Message.

Streaming is meant for the Conversation View:

  1. Fill in Live Stream Name and Message Stream ID, and use the same values in the Conversation View.
  2. Add a Status column in the Conversation View settings. It can be processing, done or error (not case-sensitive), or 0, 1 or 2.
  3. Set the status to processing before the chat action runs. Set it to done or error after it.

In 1.28, streaming works with Claude and Llama only. With Titan, the action fails.

Errors​

This action has no Ignore Errors or On Error settings. When something goes wrong, for example a wrong key, a missing region, a model you don't have access to or invalid history, the action fails and the remaining actions don't run.

To handle the error yourself, put the action inside Execute Actions and use its On Error actions. There, [ExceptionMessage] holds the error, for example Invoking the anthropic.claude-3-sonnet-20240229-v1:0 chat model threw exception.

Considerations​

  • Data privacy. The instructions, history, message and workflow results are sent to Amazon Bedrock in your AWS account. Check that your data rules allow it.
  • Cost. AWS bills you for every token sent and received. Long histories and workflow calls add up.
  • Replies can be wrong. Check important answers before you act on them.
  • AWS permissions. Use an AWS user with only the Bedrock permissions it needs, and keep its keys in the connector only.
  • Building JSON with tokens. Token values aren't escaped when they're placed in JSON. If you build Previous Message Json by hand, a quote or line break in a token value breaks the JSON. Prefer passing back Store Entire Conversation JSON unchanged.
  • No usage records. Unlike Chat, this action doesn't save PAA usage records.
  • Conditions. In the action's Condition, token values are placed in quotes, for example [Question] != "". See Common Parameters.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

Replace the connector ID 00000000-0000-0000-0000-000000000000 with the ID of your own connector, or select the connector after you import the action.

1. Answer a support question with Claude​

This action sends the user's question to Claude with short instructions and stores the answer in Answer. It runs only when Question has a value.

{
"Title": "Aws AI Chat",
"ActionType": "AwsAi.Chat",
"Description": "Answer the support question",
"Condition": "[Question] != \"\"",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"ModelId": "Claude",
"Instructions": "You are a helpful support assistant for [CompanyName]. Answer in one short paragraph.",
"Message": "[Question]",
"StoreMessage": "Answer"
}
}

2. Continue a conversation​

This action passes the stored conversation back as history, sends the new message, and saves the updated conversation in the same token.

{
"Title": "Aws AI Chat",
"ActionType": "AwsAi.Chat",
"Description": "Reply in the ongoing conversation",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"ModelId": "Claude",
"Instructions": "You are a friendly assistant for our booking site.",
"PreviousMessageJson": "[ConversationJson]",
"Message": "[UserMessage]",
"StoreMessage": "Answer",
"StoreEntireConversationJson": "ConversationJson"
}
}

3. Let Claude look up an order​

This action gives Claude a workflow it can run, for example one with an OrderNumber input and a Status output. OrderLookupWorkflowId holds the numeric workflow ID.

{
"Title": "Aws AI Chat",
"ActionType": "AwsAi.Chat",
"Description": "Answer order questions with the lookup workflow",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"ModelId": "Claude",
"Instructions": "You help customers with their orders. Use the tools to look up order details. Never guess an order status.",
"Message": "[Question]",
"DynamicWorkflows": "[OrderLookupWorkflowId]",
"StoreMessage": "Answer",
"StoreAiDebugPayloads": "ChatDebug"
}
}

Revised 09/27/2026