--- title: Automation Events | Tabstack description: Complete reference for all Server-Sent Event (SSE) types emitted by the /v1/automate endpoint. --- The `/v1/automate` endpoint streams responses using Server-Sent Events (SSE). Each event follows this format: ``` event: data: ``` This reference documents all event types, their data structures, and when they are emitted. --- ## Task Events ### `start` Emitted when the task is initialized. ``` { task: string; // Task description url: string; // Target URL } ``` ### `task:setup` Emitted during the task configuration and setup phase. No data payload. ### `task:started` Emitted when task execution begins. ``` { task: string; // Task description url: string; // Target URL } ``` ### `task:completed` Emitted when the task finishes successfully. ``` { success: true; finalAnswer: string; // Human-readable result summary } ``` ### `task:aborted` Emitted when the task is terminated early. No data payload. ### `task:validated` Emitted when task completion validation passes. No data payload. ### `task:validation_error` Emitted when validation fails. No data payload. --- ## Agent Events ### `agent:processing` Emitted when the agent is thinking or planning. ``` { operation: string; // e.g., "Creating task plan", "Analyzing page content" hasScreenshot: boolean; // Whether a screenshot is being analyzed } ``` ### `agent:status` Emitted for status updates and plans. ``` { message: string; // Status message, e.g., "Task plan created" plan: string; // Description of the plan } ``` ### `agent:step` Emitted for processing step iterations. ``` { iterationId: string; // Unique iteration identifier currentIteration: number; // Current step number (0-indexed) } ``` ### `agent:action` Emitted when actions are being performed. ``` { action: string; // Action type, e.g., "extract" value: string; // Action description } ``` ### `agent:reasoned` Emitted for agent reasoning output. No data payload. ### `agent:extracted` Emitted when data extraction completes. ``` { extractedData: string; // JSON string of extracted data } ``` ### `agent:waiting` Emitted when the agent is waiting for operations to complete. No data payload. --- ## Browser Events ### `browser:navigated` Emitted when page navigation occurs. ``` { title: string; // Page title url: string; // Current URL } ``` ### `browser:action_started` Emitted when a browser action is initiated. No data payload. ### `browser:action_completed` Emitted when a browser action finishes. No data payload. ### `browser:screenshot_captured` Emitted when a screenshot is taken. No data payload. --- ## System Events ### `system:debug_compression` Emitted for debug compression information. Used for internal diagnostics. ### `system:debug_message` Emitted for debug messages. Used for internal diagnostics. --- ## Stream Control Events ### `complete` Emitted at the end of the stream with final results. ``` { success: boolean; result: { finalAnswer: string; // Human-readable result }; stats: { actions: number; // Total number of actions performed }; } ``` ### `done` Emitted as the stream termination signal. ``` {} ``` ### `error` Emitted when an error occurs during task execution. ``` { error: string; // Error message code?: string; // Error code (if available) } ```