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-p1

v0.5.4

Published

People1 fork of n8n-nodes-bedrock-advanced — cache metrics in output, coexists with original

Readme

@people1/n8n-nodes-bedrock-advanced

People1 fork of [email protected] by Amir Souchami.

Why this fork?

The original node extracts Bedrock prompt cache metrics (cacheReadInputTokens, cacheWriteInputTokens) from the API response but does not propagate them to the N8N node output. They are only written to container debug logs, which requires admin SSH access to read.

This fork fixes that: cache metrics now appear in the standard N8N execution output and can be queried via the REST API (GET /api/v1/executions/{id}) by any developer.

Coexistence with the original

This fork uses different internal node type names so it can be installed alongside the original:

| | Original | Fork (P1) | |---|---|---| | Converse API node | AWS Bedrock Chat Model (Advanced) | AWS Bedrock Chat Model (Advanced P1) | | InvokeModel node | Bedrock Claude | Bedrock Claude (P1) | | Internal type | lmChatAwsBedrockAdvanced | lmChatAwsBedrockAdvancedP1 | | Internal type | lmChatBedrockClaude | lmChatBedrockClaudeP1 |

Both appear in the N8N node picker. Developers choose which to use per workflow.

What changed

Patches applied to both nodes:

  1. Added cache fields to llmOutput.tokenUsage — so cache metrics travel through LangChain's callback chain
  2. Custom tokensUsageParser for N8nLlmTracing — so N8N's tracing callback preserves cache fields instead of stripping them
  3. Streaming path fix (BedrockClaude only) — reads cache metrics from response_metadata.usage for the streaming aggregation path
  4. Renamed node typesP1 suffix to coexist with the original package

Output format (after fix)

{
  "tokenUsage": {
    "completionTokens": 500,
    "promptTokens": 150,
    "totalTokens": 650,
    "cacheReadInputTokens": 120,
    "cacheWriteInputTokens": 0
  }
}

When cache is disabled or not applicable, cacheReadInputTokens and cacheWriteInputTokens are 0.

Installation

On the N8N server (admin only)

# 1. Find the N8N main container
docker ps --format '{{.Names}}' | grep n8n

# 2. Install the fork alongside the original (replace CONTAINER)
docker exec CONTAINER sh -c "cd /home/node/.n8n/nodes && npm install github:franlealp1/n8n-nodes-bedrock-advanced-p1"

# 3. Restart N8N to pick up the new nodes
docker restart CONTAINER

Both the original and P1 nodes will appear in the node picker.

Persisting across Coolify deploys

Add to the N8N service's Custom Start Command in Coolify:

cd /home/node/.n8n/nodes && npm install github:franlealp1/n8n-nodes-bedrock-advanced-p1 && cd / && n8n start

Or in a post-deploy script if available.

Querying cache metrics (developers)

After installation, any developer with N8N API access can query cache metrics:

# Get execution details (replace ID with execution ID)
curl -s "$N8N_BASE_URL/api/v1/executions/724002" \
  -H "X-N8N-API-KEY: $N8N_API_KEY" | \
  python3 -c "
import json, sys
data = json.load(sys.stdin)
for node_name, node_data in data.get('data', {}).get('resultData', {}).get('runData', {}).items():
    for run in node_data:
        for output in run.get('data', {}).get('ai_languageModel', []):
            for item in output:
                tu = item.get('json', {}).get('tokenUsage', {})
                if tu.get('cacheReadInputTokens', 0) > 0 or tu.get('cacheWriteInputTokens', 0) > 0:
                    print(f'{node_name}: read={tu[\"cacheReadInputTokens\"]}, write={tu[\"cacheWriteInputTokens\"]}')
"

Original features (unchanged)

All features from the original node are preserved:

  • AWS Bedrock Chat Model (Advanced P1) — Converse API, multi-model, prompt caching (system/tools/history), configurable TTL
  • Bedrock Claude (P1) — InvokeModel API, Claude-specific features (web search, computer use, bash, text editor, tool search, programmatic tool calling, 1M context, context compaction)

License

MIT (same as original)