Skip to content
Get started

Automation Events

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: <type>
data: <JSON>

This reference documents all event types, their data structures, and when they are emitted.


Emitted when the task is initialized.

{
task: string; // Task description
url: string; // Target URL
}

Emitted during the task configuration and setup phase. No data payload.

Emitted when task execution begins.

{
task: string; // Task description
url: string; // Target URL
}

Emitted when the task finishes successfully.

{
success: true;
finalAnswer: string; // Human-readable result summary
}

Emitted when the task is terminated early. No data payload.

Emitted when task completion validation passes. No data payload.

Emitted when validation fails. No data payload.


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
}

Emitted for status updates and plans.

{
message: string; // Status message, e.g., "Task plan created"
plan: string; // Description of the plan
}

Emitted for processing step iterations.

{
iterationId: string; // Unique iteration identifier
currentIteration: number; // Current step number (0-indexed)
}

Emitted when actions are being performed.

{
action: string; // Action type, e.g., "extract"
value: string; // Action description
}

Emitted for agent reasoning output. No data payload.

Emitted when data extraction completes.

{
extractedData: string; // JSON string of extracted data
}

Emitted when the agent is waiting for operations to complete. No data payload.


Emitted when page navigation occurs.

{
title: string; // Page title
url: string; // Current URL
}

Emitted when a browser action is initiated. No data payload.

Emitted when a browser action finishes. No data payload.

Emitted when a screenshot is taken. No data payload.


These events are only emitted when interactive: true is set on the automate request. See the Interactive Mode guide for full usage details.

Emitted when the agent encounters a form requiring user data and needs input from the caller.

{
requestId: string; // Unique ID for this request (use when submitting response)
pageUrl: string; // URL of the page containing the form
pageTitle: string; // Page title
formDescription: string; // Human-readable description of the form
fields: Array<{
ref: string; // Element reference ID (e.g., "E42")
label: string; // Field's visible label
fieldType: string; // "text" | "email" | "phone" | "date" | "number" | "select" | "checkbox" | "radio" | "textarea" | "password" | "other"
required: boolean; // Whether the field must be filled
options?: string[]; // Available options (for select/radio fields)
currentValue?: string; // Current value if already partially filled
description?: string; // Additional context or hints
}>;
}

Respond by submitting field values to POST /v1/automate/{requestId}/input. Input requests expire after 2 minutes.

Emitted when form submission fails validation after user-provided data was entered. Contains the same structure as interactive:form_data:request, plus per-field error details.

{
requestId: string;
pageUrl: string;
pageTitle: string;
formDescription: string;
fields: Array<{
ref: string;
label: string;
fieldType: string;
required: boolean;
options?: string[];
currentValue?: string;
description?: string; // May contain the validation error message
}>;
fieldErrors: Record<string, string>; // Map of ref -> error message (e.g., { "E42": "Invalid email address" })
}

Handle this the same way as the initial request: collect corrected values and submit them to the input endpoint using the new requestId.


Emitted for debug compression information. Used for internal diagnostics.

Emitted for debug messages. Used for internal diagnostics.


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
};
}

Emitted as the stream termination signal.

{}

Emitted when an error occurs during task execution.

{
error: string; // Error message
code?: string; // Error code (if available)
}