Skip to main content

Overview

This tutorial demonstrates how to:
  • Set up browser automation with Julep
  • Navigate web pages programmatically
  • Execute browser actions like clicking and typing
  • Process visual feedback through screenshots
  • Create goal-oriented browser automation tasks

Task Structure

Let’s break down the task into its core components:

1. Input Schema

First, we define what inputs our task expects:
This schema specifies that our task expects a goal string describing what the browser automation should accomplish.

2. Tools Configuration

Next, we define the external tools our task will use:

3. Main Workflow Steps

1

Create Julep Session

This step initializes a new Julep session for the AI agent. The session serves as a container for the conversation history and enables the agent to maintain context throughout the interaction.
2

Store Session ID

After creating the session, we store its unique identifier for future reference.
3

Create Browser Session

This step establishes a new browser session using BrowserBase. It creates an isolated, headless Chrome browser instance that the agent can control.
4

Store Browser Session Info

We store both the browser session ID and connect URL in a single evaluation step.
5

Get Session View URLs

This step retrieves various URLs associated with the browser session, including debugging interfaces and live view URLs.
6

Store Debugger URL

We specifically store the debugger URL, which provides access to Chrome DevTools Protocol debugging interface.
7

Initial Navigation

This step navigates to Google’s homepage to avoid sending a blank screenshot when computer use starts.
8

Start Browser Workflow

Finally, we initiate the interactive browser workflow with system capabilities and user goal.

4. Run Browser Subworkflow

The run_browser subworkflow is a crucial component that handles the interactive browser automation. It consists of three main parts:
1

Agent Interaction

This step engages the AI agent in conversation, allowing it to:
  • Process and understand the user’s goal
  • Plan appropriate browser actions
  • Generate responses based on the current browser state
  • Make decisions about next steps
2

Action Execution

This component:
  • Iterates through planned actions sequentially
  • Executes browser commands (navigation, clicking, typing)
  • Handles different types of interactions (text input, mouse clicks)
  • Captures screenshots for visual feedback
3

Goal Evaluation

This final part:
  • Assesses progress toward the user’s goal
  • Determines if additional actions are needed
  • Maintains conversation context
  • Decides whether to continue or conclude the workflow

5. Check Goal Status Subworkflow

The check_goal_status subworkflow is a recursive component that ensures continuous operation until the goal is achieved:
1

Check Goal Status

This workflow:
  • Checks if there are any messages to process (len(_.messages) > 0)
  • If messages exist, recursively calls the run_browser workflow
  • Passes along the current session context and connection details
  • Maintains the conversation flow until the goal is achieved
  • Automatically terminates when no more messages need processing
This recursive pattern ensures that the browser automation continues until either:
  • The goal is successfully achieved
  • No more actions are needed
  • An error occurs that prevents further progress
YAML

Usage

Here’s how to use this task with the Julep SDK:

Key Features

  • Browser Automation: Performs web interactions like navigation, clicking, and typing
  • Visual Feedback: Captures screenshots to verify actions and understand page state
  • Goal-Oriented: Continues executing actions until the user’s goal is achieved
  • Secure Sessions: Uses BrowserBase for isolated browser instances
  • Interactive Workflow: Uses run_browser subworkflow for continuous interaction

Next Steps

  • Try this task yourself, check out the full example, see the browser-use cookbook.
  • To learn more about the integrations used in this task, check out the integrations page.