Amazon Bedrock

Invoke foundation models on AWS Bedrock including Claude, Llama, and Titan.

AI and MLCredentials form5 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (5)
  4. generate_content_from_image
  5. generate_embeddings
  6. generate_image
  7. send_prompt
  8. custom_api_call
  9. Details

Connect

Auth type: Credentials form (custom_auth). Pass the fields the provider needs (listed below) as the connection's credentials. They are sealed at rest.

FieldTypeDescription
accessKeyIdrequiredtextYour AWS access key ID
secretAccessKeyrequiredsecretYour AWS secret access key
regionrequiredtextAWS region (e.g. us-east-1)
  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("amazon_bedrock", action, input) resolves with the provider's answer and rejects when Amazon Bedrock isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "amazon_bedrock"} says whether yours can call it.

Workflow
// workflows/notify.ts: call Amazon Bedrock when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellAmazonBedrock = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Amazon Bedrock isn't connected.
  const output = await step.run("Amazon Bedrock", () =>
    step.ctx.integrations.invoke("amazon_bedrock", "generate_content_from_image", {
      "model": "<model>",
      "image": "<image>",
      "prompt": "<prompt>"
    }),
  );
  step.ctx.log("Amazon Bedrock answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "amazon_bedrock",
    "piece_action": "generate_content_from_image",
    "input": {
      "model": "<model>",
      "image": "<image>",
      "prompt": "<prompt>"
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/amazon_bedrock/generate_content_from_image" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"model":"<model>","image":"<image>","prompt":"<prompt>"}}'

Actions

generate_content_from_image

Generate Content from Image. Ask a Bedrock model a question about an image.

InputTypeDescription
modelrequiredid (picked from your account)The foundation model to use. Must support image input.
imagerequiredfileThe image to analyze (PNG, JPEG, GIF, or WebP).
promptrequiredlong textWhat do you want the model to tell you about the image?
systemPromptoptionallong textInstructions that guide the model behavior.
temperatureoptionalnumberControls randomness. Lower values produce more deterministic output.
maxTokensoptionalnumberThe maximum number of tokens to generate.

generate_embeddings

Generate Embeddings. Generate vector embeddings from text using Amazon Titan Embed, Cohere Embed, or Amazon Nova Multimodal Embeddings models.

InputTypeDescription
modelrequiredid (picked from your account)The embedding model to use.
inputTextrequiredlong textThe text to generate embeddings for.
embeddingPurposeoptionalone of "GENERIC_INDEX" | "GENERIC_RETRIEVAL" | "TEXT_RETRIEVAL" | "CLASSIFICATION" | "CLUSTERING"Optimize embeddings for your use case. Only used by Nova Multimodal Embeddings.
dimensionsoptionalnumberThe number of dimensions for the output embedding vector. Titan Embed v2: 256, 512, 1024. Nova Multimodal: 256, 384, 1024, 3072.
normalizeoptionalbooleanWhether to normalize the output embedding vector. Supported by Titan Embed v2.

generate_image

Generate Image. Generate an image from a text prompt using Amazon Titan Image Generator or Stability AI models.

InputTypeDescription
modelrequiredid (picked from your account)The image generation model to use.
promptrequiredlong textA text description of the image you want to generate.
negativePromptoptionallong textDescribe what you do NOT want in the image. Helps refine the output.
widthoptionalnumberImage width in pixels. Must be supported by the model.
heightoptionalnumberImage height in pixels. Must be supported by the model.
seedoptionalnumberA seed for reproducible results. Use the same seed and prompt to get the same image.

send_prompt

Ask Bedrock. Send a text prompt to an Amazon Bedrock model.

InputTypeDescription
modelrequiredid (picked from your account)The foundation model to use for generation.
promptrequiredlong textPrompt
systemPromptoptionallong textInstructions that guide the model behavior.
temperatureoptionalnumberControls randomness. Lower values produce more deterministic output.
maxTokensoptionalnumberThe maximum number of tokens to generate.
topPoptionalnumberNucleus sampling: the model considers tokens with top_p probability mass.
stopSequencesoptionalarraySequences that will cause the model to stop generating. Up to 4 sequences.
memoryKeyoptionaltextA memory key that will keep the chat history shared across runs and flows. Keep it empty to leave the model without memory of previous messages.

custom_api_call

Custom API Call. Make a custom API call to any AWS Bedrock endpoint. Requests are automatically signed with AWS Signature V4.

InputTypeDescription
servicerequiredone of "bedrock" | "bedrock-runtime" | "bedrock-agent" | "bedrock-agent-runtime"Select the AWS Bedrock service endpoint to call. Use "Bedrock" for control plane operations (e.g., ListFoundationModels) and "Bedrock Runtime" for inference operations (e.g., InvokeModel).
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
pathrequiredtextThe API path (e.g., /foundation-models, /model/{modelId}/invoke). See the AWS Bedrock API Reference for available endpoints.
headersoptionalobjectAdditional headers to include. Authorization headers are automatically added via AWS Signature V4.
queryParamsoptionalobjectQuery parameters to include in the request URL.
bodyoptionalJSONJSON body for POST/PUT requests.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)

Details

Id
amazon_bedrock
Category
AI and ML
Tags
ai, aws, bedrock, llm, enterprise
Package
@activepieces/piece-amazon-bedrock@0.0.4
Runs
Through the integration runner