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.5.2

Published

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

Readme

n8n-nodes-bedrock-advanced

Advanced n8n community nodes for AWS Bedrock, providing features not available in the official n8n Bedrock node. This package includes two nodes:

| Node | API | Best For | |------|-----|----------| | AWS Bedrock Chat Model (Advanced) | Converse API | Multi-model support (Claude, Nova, Titan) with prompt caching | | Bedrock Claude | InvokeModel API | Full access to Claude-specific features |

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.


Node 1: AWS Bedrock Chat Model (Advanced)

A drop-in replacement for the official n8n AWS Bedrock Chat Model node, adding granular prompt caching and accurate token usage metrics via the Bedrock Converse API.

Features

  • Granular prompt caching — independently cache the system prompt, tool definitions, and conversation history
  • Configurable cache TTL — 5 minutes or 1 hour (where supported)
  • Accurate token usage metrics including cache read/write breakdowns
  • Multi-model support — works with Claude, Amazon Nova, Titan, and any Converse API-compatible model
  • On-demand models and inference profiles
  • Debug logging toggle

Prompt Caching

When enabled, you can independently target three parts of the request for caching:

| Cache Target | Default | Description | |---|---|---| | Cache System Prompt | On | Injects a cachePoint after the system message | | Cache Tool Definitions | Off | Injects a cachePoint after the last tool definition. TTL is preserved accurately. | | Cache Conversation History | Off | Injects a cachePoint at the end of the most recent prior turn, reducing cost in multi-turn conversations as history grows |

Supported TTL options:

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

Note: Due to a LangChain limitation (#9014), the TTL field is stripped from system and conversation history cache points at the LangChain conversion layer. These always use the 5-minute default regardless of the TTL setting. Tool cache points preserve the TTL correctly.

Requirements:

  • 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)

Token Usage Metrics

Every execution reports accurate token counts in n8n's AI panel:

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

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 and select TTL
    • Enable Cache System Prompt, Cache Tool Definitions, and/or Cache Conversation History
    • Adjust temperature and max tokens
    • Toggle Debug Logs to see detailed request/response logs

Node 2: Bedrock Claude

A Claude-specific node that uses the Bedrock InvokeModel API with the native Anthropic Messages API format. This bypasses the Converse API abstraction layer, giving full access to Claude-specific features.

Features

  • Granular prompt caching — independently cache the system prompt, tool definitions, and conversation history, with full TTL control
  • Built-in Claude tools — web search, computer use, bash, text editor
  • Tool search — Claude dynamically discovers and loads tools on-demand from large tool sets
  • Programmatic tool calling — Claude calls tools from within code execution, reducing latency in multi-tool workflows
  • Extended 1M context window — for Claude Opus 4.6 and Sonnet 4.6
  • Context compaction — automatically summarizes older context when approaching the context window limit
  • Streaming support
  • Tool calling with full multi-turn conversation support
  • Debug logging toggle

Why use this instead of the Advanced node?

| Feature | Converse API (Advanced node) | InvokeModel (Bedrock Claude) | |---------|:---:|:---:| | Multi-model support | Yes | Claude only | | Standard tool calling | Yes | Yes | | Prompt caching — system prompt | Yes | Yes | | Prompt caching — tool definitions | Yes | Yes (full TTL control) | | Prompt caching — conversation history | Yes | Yes | | Web search tool | No | Yes | | Computer use tool | No | Yes | | Bash tool | No | Yes | | Text editor tool | No | Yes | | Tool search | No | Yes | | Programmatic tool calling | No | Yes | | 1M context window | No | Yes | | Context compaction | No | Yes |

Prompt Caching

When enabled, you can independently target three parts of the request:

| Cache Target | Default | Description | |---|---|---| | Cache System Prompt | On | Adds cache_control to the last system message block | | Cache Tool Definitions | Off | Adds cache_control to the last non-deferred tool. Safe to use alongside Tool Search — deferred tools are excluded from the cache prefix automatically. | | Cache Conversation History | Off | Adds cache_control at the end of the most recent prior turn |

Cache TTL (5m or 1h) is fully preserved for all three targets.

Built-in Claude Tools

Enable these directly in the node options — no external tool setup required:

  • Web Search — Claude can search the web during conversations
  • Computer Use — Claude can control mouse, keyboard, and take screenshots (configurable display dimensions)
  • Bash — Claude can execute shell commands
  • Text Editor — Claude can view and edit files

Tool Search

When enabled, agent tools are marked as defer_loading: true. Claude uses a search tool (regex or BM25) to discover and load only the tools relevant to each step — reducing prompt size and cost when working with large tool sets.

Tool caching and tool search are fully compatible: cache_control is placed on the last non-deferred tool (built-in tools), and deferred agent tools follow after. This means the cache prefix is stable across calls even as Claude selectively loads different agent tools.

Programmatic Tool Calling

Allows Claude to call tools from within code execution (via the code_execution tool), chaining multiple tool uses in a single server-side step. Reduces round-trips and token usage in multi-tool workflows.

Context Compaction

Automatically summarizes older parts of the conversation when the input approaches the configured token threshold, allowing effective conversations beyond 200K tokens without hitting context limits.

1M Context Window

Enables the extended 1M token context window (default is 200K). Supported on Claude Opus 4.6 and Sonnet 4.6.

Configuration

  1. Add the Bedrock Claude node to your workflow
  2. Select your AWS credentials
  3. Choose your Claude model (the dropdown filters to Claude inference profiles only)
  4. Under Options:
    • Set Max Tokens and Temperature
    • Toggle Prompt Caching and select TTL
    • Enable Cache System Prompt, Cache Tool Definitions, and/or Cache Conversation History
    • Enable any built-in tools (web search, computer use, bash, text editor)
    • Toggle Tool Search and choose variant (regex or BM25)
    • Toggle Programmatic Tool Calling
    • Toggle Enable 1M Context
    • Toggle Enable Compaction and set trigger token threshold
    • Toggle Debug Logs

AWS IAM Permissions

Both nodes require the following IAM permissions:

{
  "Effect": "Allow",
  "Action": [
    "bedrock:InvokeModel",
    "bedrock:InvokeModelWithResponseStream",
    "bedrock:ListFoundationModels",
    "bedrock:ListInferenceProfiles",
    "bedrock:GetInferenceProfile"
  ],
  "Resource": "*"
}

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

License

MIT