How the cache works
A cached step stores more than one way to find its target: where the element sits on screen, what it looks like, what text it contains, and the accessibility and structural attributes around it. The runner infers which of those signals matters for a given step from the step’s natural-language description. “The red Cancel button below the Order Summary header” uses visual and positional signals; “the Sign in button” uses accessibility and text. On replay, the runner matches the stored signals against the live page or screen; when there’s a match, it runs the action without invoking the LLM. When the signals no longer match, locator auto-healing re-resolves the description against the current UI and updates the entry in place. Open a step in the run viewer to see its cache status in the step detail pane. The Cache section tells you whether the step hit cache, missed cache, busted cache before use, or had no cache, plus the reason or resolution method when Momentic recorded one. It also lets you read the stored value and clear the entry when it is wrong.AI action caches
An AI action caches the steps the agent resolved for your goal, not a single element, and replays them on the next run instead of planning again. The cache holds a branch when the flow itself branches. If the agent handled UI that appears on some runs and not others, it recordsIf <condition> with the
steps for that case and an optional else branch. Later runs evaluate the
condition against the live UI and replay only the branch that applies, so both
paths stay cached. A cache written before conditionals existed is a flat list of
actions and keeps replaying unchanged, and a linear flow still caches that way.
A cache that contains a branch needs
momentic 3.48.0 or momentic-mobile
1.24.0 to replay. An older CLI cannot read the entry.cache: false on the step.
Momentic replays nothing and writes nothing, so the agent plans the flow on
every run. Use this for flows whose content changes between runs.
Element checks with long timeouts
Element checks such ascheckElementVisible and checkElementExists poll until their condition holds
or timeout elapses. A cached check replays its steps on each poll while the
page loads. If the cached locator is stale, the check periodically re-resolves
the element description with AI. Short timeouts use a more frequent cadence than
long ones. A cache hit does not necessarily pass the check. Successful checks
stop polling; if polling ends unsuccessfully, a final attempt bypasses the
locator cache and may invoke AI.
Cache saving eligibility
A run only saves cache when it both passes and is eligible. Cancelled or timed-out runs discard caches by default; enableadvanced.saveCacheOnCancel
to preserve partial caches from steps that completed before the interruption.
- 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-cacheto 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
Disable caching for a whole run from the CLI:last item in list.
Cache invalidation
Cache entries are scoped per step. Changing a step’s natural-language description or the variable values it depends on (e.g. a different{{ env.USERNAME }}) changes the cache key. Re-rendering siblings, mutating
unrelated attributes, or animating background content does not.
Storage
- Stored per organization; only accessible to authenticated runs
- Entries expire 14 days after they were last saved
Git-based isolation
Caches are scoped per branch so concurrent work doesn’t collide:mainkeeps per-commit caches; new branches seed from the cache at their merge base.- Non-main branches store only the latest cache.
- On merge, the merged branch’s cache is combined with
main’s previous commit so subsequent runs onmainstill hit the cache.
Environment isolation
By default, branch-scoped caches are shared across environments in the same project. To keep separate caches fordev, staging, production, or any
other environment selected with --env, enable
advanced.isolateCachesByEnvironment.