Output Structure

Browser steps fetch and process web pages, returning the content and status information.

interface BrowserStepOutput {
  ok: boolean; // Request success status
  status: number; // HTTP status code
  headers: {
    // Response headers
    [key: string]: string;
  };
  body: string; // Page content (HTML or stripped text)
}

Accessing Output

Let’s see how to access the output of a Browser step.

In code steps:

CODE_STEP
const { ok, status, body } = BROWSER_STEP.output;

In non-code steps like model messages, HTTP request URLs, request bodies, and other configuration fields:

{{BROWSER_STEP.output.body}}
{{BROWSER_STEP.output.status}}
{{BROWSER_STEP.output.ok}}

In model messages:

[
  {
    "role": "system",
    "content": "You are a helpful assistant that analyzes web pages. Provide clear and concise analysis."
  },
  {
    "role": "user",
    "content": "Analyze this page: {{BROWSER_STEP.output.body}}"
  }
]