sessionId that persists until you terminate it or it times out due to inactivity (sessions expire after 5 minutes of inactivity).
Sessions run completely isolated—no shared cookies, no shared state. This lets you run multiple concurrent sessions without interference. Run tasks sequentially within the same session: navigate to a site, authenticate, then execute your workflow. Terminate when done, or you’ll pay for the full timeout window.
Session Lifecycle
Sessions progress through these states: Pending → Browser instance initializing Active → Task currently executing Completed → Session ended successfully Terminated → Ended by user or timeout Failed → Session ended due to error Orphaned → Instance disconnected unexpectedly (reconnection window available) Orphaned sessions are rare. If a browser instance loses connection, the session waits for reconnection. If it doesn’t reconnect within the grace period, the session fails.Configuration Parameters
Configure sessions when creating them:- mode: Session mode (currently only
"default"is supported). - initialTask: Contains all task-specific parameters.
- taskDetails: Can be empty if you plan to send tasks later via
/send-message. - startingPoint: Saves tokens and time by skipping navigation.
- maxDuration: Maximum time a task can run before automatic termination (default: 5 minutes). Note: Session inactivity timeout is fixed at 5 minutes.
- terminateOnCompletion: Automatically
truefor/start/run-taskendpoint. - avoidDomains: Prevents accidental navigation to unwanted domains.
- secrets: Provide credentials upfront so the agent can authenticate without guardrail interruptions. Secrets are never stored and are discarded when the session ends. See Secrets guide.
- profileId: Attach a browser profile to reuse saved cookies, local storage, and other browser data. The profile ID is a top-level parameter, not nested inside
initialTask.