Documentation

Workflow Cache

When a workflow gets a request it has already answered, ModelRiver can return the saved response instead of calling the provider again.

Why workflow caching?

Users often send the same request more than once, or trigger the same workflow with the same input. Sending each of these to the provider again costs tokens and time.

The workflow cache saves successful responses from live, non-streaming requests and returns the saved response when the same request comes in again.

How it works

  1. Save: When caching is on and a live, non-streaming request succeeds, ModelRiver saves the request and its response.
  2. Reuse: When a later request matches a saved one exactly, ModelRiver returns the saved response without calling the provider.
  3. Track: The workflow's Cache page in the console shows cache hits, money saved, reused responses and average saved per hit for the selected time range.

Enabling the cache

  1. Navigate to the Workflows section and open the settings for a specific workflow.
  2. Locate the Caching (optional) section.
  3. Select your desired Cache window (e.g., 15m, 1h, or 1d). Cached responses older than this window are ignored.
  4. To turn caching off, click Clear next to the current window and save the workflow. This removes the cache window only. It does not delete responses that were already saved.

What you save

  • No provider cost on hits: A cache hit doesn't call the provider (like OpenAI or Anthropic), so it uses no provider tokens.
  • Faster responses: The saved response is returned without waiting for the model to generate text.

Note: Cache hits still count as requests toward your ModelRiver plan limits.

Cache hit criteria

A cache hit only happens when:

  • The request goes to the same workflow (and the same workflow version).
  • The request body is identical, including messages, model settings such as temperature and top P, and any attachments. Fields such as request_id, timestamp and session_id are ignored.

If anything differs, the request skips the cache and runs normally.

Playground and streaming requests always bypass the workflow cache so tests and streamed provider behavior stay fresh.

Next steps