Skip to main content
Most interactive steps (Click, Type, etc.) cache the resolved element after a successful run. On the next run, Momentic replays from cache and only falls back to AI when the cache misses (see auto-heal). Module and auth-state caching are covered in Modules.

What gets cached

  • CSS selectors and HTML attributes
  • Accessibility roles and metadata
  • Screenshots and visual cues
  • Element location and dimensions

Cache saving eligibility

A run only saves cache when it passes and the run is eligible.
  • CI runs (CI=true) are always eligible.
  • Local runs are eligible when the current branch is not the main branch or a protected branch.
  • Pass --save-cache to force eligibility.

Never cached

  • AI-evaluated steps like AI check and AI extract
  • Steps whose variables change every run (e.g. {{ Date.now() }})
  • Steps with caching explicitly disabled

Disabling cache

Globally:
npx momentic run --disable-cache
Per step: toggle Disable cache in step options. Useful for inherently dynamic targets like last item in list.

Cache keys

A cache key is derived from:
  • The step’s ID
  • Parent module IDs
  • Resolved element description
  • Dynamic template values (e.g. {{ env.USERNAME }})
Any change invalidates the entry.

Storage

  • Stored per organization; only accessible to authenticated runs
  • Expires after 90 days of inactivity

Git-based isolation

Caches are scoped per branch so concurrent work doesn’t collide:
  • main stores per-commit caches so new branches can seed from the nearest ancestor
  • Non-main branches store the latest cache only
  • New branches seed from the latest cache at the merge base
  • On merge, the merged branch’s cache is combined with main’s previous commit so subsequent runs on main stay green