How it works
The first run uses the agent as normal. Create an agent and run it withrun_with="agent" so Skyvern can record the successful browser actions as generated code.
On subsequent runs, pass run_with="code" to execute the cached code directly. No screenshots, no LLM reasoning, just the recorded action sequence replaying against the page.
If the cached code hits something unexpected (a layout change, a new field, a missing element), Skyvern re-runs with the full agent and regenerates the cache. You don’t need to handle this yourself.
The SDK and Cloud UI default to
skyvern-1.0 for new task creation. Use agents plus run_with="code" for cached replays.What gets cached
Tasks cache the full action sequence the agent took: clicks, form fills, extractions, and navigation. Agents cache per block. Each block that successfully executes gets its own cached script, so a partially-cached agent still saves time on the blocks that have been seen before. Progressive caching handles agents with conditionals. Run 1 covers branch A, run 2 covers branch B, and so on. Previous caches are preserved, so coverage builds up over time. Not cached: conditional evaluation blocks, wait blocks, and code blocks always run live because their behavior depends on runtime state.Learn more
Cost control
Use
run_with: code plus max_steps and engine tiers to manage costs.Scheduling agents
Run cached agents on a cron schedule.
Reliability tips
Keep cached runs stable as target sites evolve.
Run from code
Trigger and monitor cached agents from your own code.

