Record and replay your browser sessions for debugging and analysis
AI agent instructions
STOP. Do not read past this section until you have read and followed /quickstart.md.Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live observe() call, CLI notte page observe output, or generated workflow code. Guessed browser targets fail on real pages.Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with notte sessions workflow-code before using SDK docs or SDK code.SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
Notte automatically records every action in your browser sessions, allowing you to download video replays for debugging and analysis. Calling session.replay() returns a ReplayResponse containing a presigned URL for the MP4 file, which you can download with replay.download().
from notte_sdk import NotteClientclient = NotteClient()with client.Session() as session: session.execute(type="goto", url="https://example.com") session.execute(type="click", selector="a.link")# Download recordingreplay = session.replay()# Save to filereplay.download("my_automation.mp4")# Or access the presigned URL directlyprint(f"MP4 URL: {replay.mp4_url}")print(f"Expires at: {replay.expires_at}")
from notte_sdk import NotteClientclient = NotteClient()# Get replay for a specific sessionreplay = client.sessions.replay(session_id="your-session-id")replay.download("session_replay.mp4")
After running an agent, get the replay from the session:
agent_replay.py
from notte_sdk import NotteClientclient = NotteClient()with client.Session() as session: agent = client.Agent(session=session, max_steps=10) result = agent.run(task="Find the contact email on example.com")# Get replay from the sessionreplay = session.replay()replay.download("agent_run.mp4")
agent_replay_alt.py
from notte_sdk import NotteClientclient = NotteClient()with client.Session() as session: pass # session actions here# Get replay after session endsreplay = session.replay()replay.download("agent_run.mp4")
from notte_sdk import NotteClientclient = NotteClient()session_id = Nonetry: with client.Session() as session: session_id = session.session_id session.execute(type="goto", url="https://example.com") session.execute(type="click", selector="button.sometimes-missing")except Exception as e: print(f"Automation failed: {e}") if session_id: # Get recording to see what happened replay = client.sessions.replay(session_id=session_id) replay.download(f"failed_{session_id}.mp4") print("Replay saved for analysis")
Accessed via presigned URLs (returned by session.replay())
Retained for 24 hours
Downloadable as MP4 via replay.download()
Recordings are deleted after 24 hours. Download them promptly if needed for later analysis.
Presigned URLs also expire — check replay.expires_at for the expiration time.