npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-bedrock-advanced

v0.2.8

Published

n8n community node for AWS Bedrock Chat Model with prompt caching support

Readme

n8n-nodes-bedrock-advanced

An advanced version of the official n8n AWS Bedrock Chat Model node, adding prompt caching and detailed token usage metrics including cache hit/miss reporting.

Why this node?

The official n8n Bedrock node does not support AWS Bedrock's prompt caching feature. When building AI agents with long system prompts or repeated tool definitions, prompt caching can significantly reduce both latency and cost by reusing previously processed tokens across requests.

This node is a drop-in replacement that adds:

  • Prompt caching with configurable TTL
  • Token usage metrics including cache read/write breakdowns visible in n8n's execution data

Features

Prompt Caching

Enable prompt caching to automatically inject cache points into system messages before they reach the Bedrock Converse API. Bedrock will cache the system prompt prefix and reuse it across subsequent requests within the TTL window.

Supported TTL options:

| TTL | Supported Models | |-----|-----------------| | 5 minutes | All cacheable models (Claude 3.5 Sonnet v2, 3.7 Sonnet, Amazon Nova, etc.) | | 1 hour | Claude 4.5 Opus, Sonnet 4.5, Haiku 4.5 |

Token Usage Metrics

Every execution reports detailed token usage in the node's output data:

{
  "tokenUsage": {
    "inputTokens": 150,
    "outputTokens": 500,
    "totalTokens": 650,
    "cacheReadInputTokens": 120,
    "cacheWriteInputTokens": 0
  }
}

| Field | Description | |-------|-------------| | inputTokens | Total input tokens processed | | outputTokens | Tokens generated in the response | | totalTokens | Combined input + output tokens | | cacheReadInputTokens | Tokens served from cache (cache hit) | | cacheWriteInputTokens | Tokens written to cache (cache miss / first call) |

Metrics work for both streaming and non-streaming invocations.

All Original Features

Everything from the official node is preserved:

  • On-demand models and inference profiles
  • Dynamic model listing from your AWS account
  • Temperature and max tokens configuration
  • AWS credential support (access key, secret key, session token)

Installation

In n8n (community node)

  1. Go to Settings > Community Nodes
  2. Enter n8n-nodes-bedrock-advanced
  3. Click Install

Manual installation

cd ~/.n8n
npm install n8n-nodes-bedrock-advanced

Then restart n8n.

Configuration

  1. Add the AWS Bedrock Chat Model (Advanced) node to your workflow
  2. Select your AWS credentials
  3. Choose your model (on-demand or inference profile)
  4. Under Options:
    • Toggle Prompt Caching to enable
    • Select Cache TTL (5 minutes or 1 hour)
    • Adjust temperature and max tokens as needed

How Prompt Caching Works

When enabled, the node automatically appends a cachePoint marker after the system message content before sending the request to Bedrock. On the first call, Bedrock caches the system prompt tokens (cacheWriteInputTokens > 0). On subsequent calls within the TTL window, Bedrock reuses the cached tokens (cacheReadInputTokens > 0), reducing processing time and cost.

Requirements:

  • The cached content must remain identical across requests for cache hits
  • Minimum token thresholds apply per model (1,024 for Sonnet/Nova, 4,096 for Opus/Haiku)
  • Maximum 4 cache checkpoints per request (this node uses 1 for the system prompt)

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

License

MIT