Skip to main content
A key-value store scoped to the current attempt. Use it to pass initialized dependencies from hooks to your automation code, or to share data between different parts of your automation. The store is cleared when the attempt ends. Unlike persistentStore, which persists across runs, attemptStore is temporary and only available during the current execution. It can store any JavaScript object, not just JSON-serializable data—making it ideal for sharing initialized objects, clients, or context across your automation.

Common use cases

Sharing context — Store initialized dependencies, loggers, API clients, or configuration objects that you want to access from multiple functions without passing them as arguments. Set them up in a hook and retrieve them in your automation—useful for libraries like Stagehand or Browser Use. Sharing data within an automation — Store intermediate results that you need to access later in the same execution.

Store

Method reference

get

Retrieve a value from the attempt store. Parameters
string
required
The key to retrieve the value for.
Returns Returns the value associated with the key, or undefined if not found.

set

Store a value in the attempt store. Parameters
string
required
The key to set the value for.
any
required
The value to store.
Returns Returns void.