Workflows

Pick Prompt Caching in the n8n Anthropic Node to Match How Often It Runs

Key Takeaway

Since n8n 2.42 (2026-09-29), the Anthropic node's Text → Message operation offers Prompt Caching: Disabled, 5 Minutes, or 1 Hour. Pick the value by how often the same long instructions are resent.

A brass-framed hourglass with falling sand on an oak table, a clipped stack of plain cards, and a sage mug

The arithmetic points to 5 Minutes for reuse within 5 minutes, 1 Hour for a few reuses within an hour, and off for anything rarer.

What changes when you turn on prompt caching?

The Anthropic documentation says the beginning of a prompt is stored in a cache, and when the next request starts with exactly the same content, the stored part is read back. The comparison runs from the front in the order tools → system → messages, and text and images must match exactly.

First call (cache write) → call with the same prefix within the lifetime (cache read) → lifetime restarts on every read

The n8n side is thin. The 2.42 release notes give only the option name and its three values, and as of the date checked the Anthropic node page has no Prompt Caching section. The n8n documentation does not say where in the instructions the node places the cache point.

How do 5 Minutes and 1 Hour differ in cost?

The multipliers in the Anthropic documentation treat the base input price as 1. Date checked: 2026-10-17.

ItemMultiplier
5-minute cache write1.25x
1-hour cache write2x
Cache read0.1x for most models, 0.05x for Claude Opus 5.5 and Sonnet 5.5

These multipliers tell you how many times you need to send the same prefix to come out ahead. Looking only at the cached part, the 5-minute cache is cheaper by the second call: 1.25 + 0.1 = 1.35 versus 2 without caching. The 1-hour cache costs more for two calls (2 + 0.1 = 2.1) and starts paying off from the third call (2.2 versus 3). These figures use the 0.1x rate that applies to most models and leave out output tokens and input after the cache point.

Which value fits your workflow?

Choose by how far apart the calls are.

  • If a Loop sends many items to the Anthropic node one after another, the calls are close together and 5 Minutes is enough.
  • If a schedule runs every 15 or 30 minutes, past 5 minutes but several times an hour, 1 Hour is worth considering.
  • If it runs only a few times a day, you would just pay the cache write cost each time, so Disabled is better.

The lifetime is measured from when the request starts. The documentation notes that time spent streaming the response also counts against it.

When does the cache fail to apply?

The most common reason is length. The minimum in the Anthropic documentation depends on the model: 512 tokens for Claude Opus 5.5, Sonnet 5.5, and Haiku 5.5, 1,024 tokens for Claude Sonnet 4.5, and 4,096 tokens for Claude Haiku 4.5. Anything shorter is simply not cached, with no error.

Another is a prefix that changes every time. If you put n8n expressions such as today's date or the input item near the start of the instructions, the text differs on every call and no longer counts as the same prefix. Keep fixed instructions at the front and put changing values later or in the user message. The documentation also says changing tool definitions invalidates the system and messages caches that follow.

How do you check that it works after turning it on?

Run the workflow twice in a row with the same input and look at the usage values in the response. Caching worked if cache_creation_input_tokens is above 0 on the first run and cache_read_input_tokens is above 0 on the second. If both are 0, check the instruction length and any changing expressions near the front. If the execution results don't show usage, compare the requests from the same time on the usage screen in the Anthropic Console.

Sources: n8n Release notes, n8n Anthropic node, Anthropic Prompt caching. Date checked: 2026-10-17.

Frequently Asked Questions

Do I get an error if I turn on caching for a prompt that is too short to cache?

No. The Anthropic documentation says prompts shorter than the minimum are simply not cached, with no error. If `cache_creation_input_tokens` and `cache_read_input_tokens` in the response are both 0, nothing was cached.

Does a 5-minute cache always disappear 5 minutes after it is first written?

No. The Anthropic documentation says each use of the cache restarts its lifetime at no extra cost. As long as the next call keeps arriving within 5 minutes, the cache stays.

Does the n8n documentation say which part of the prompt is cached?

No. As of the date checked, the n8n 2.42 release notes list only the option values, and the Anthropic node page has no Prompt Caching section. Check the usage values in the execution results yourself.

Sources & Verification Date

  1. n8n docs: Release notes (2.42) · Verified
  2. n8n docs: Anthropic node · Verified
  3. Anthropic docs: Prompt caching · Verified

All materials have been verified from official announcements and may have changed since verification.