You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an n8n community node. It lets you use Browserbase cloud browsers in your n8n workflows.
3
+
This is an n8n community node. It lets you use Browserbase cloud browsers in your n8n workflows with both traditional browser automation and AI-powered operations.
4
4
5
5
Browserbase is a platform for running headless browsers in the cloud. It provides a simple API for controlling browsers, useful features for managing browser sessions, and scalable infrastructure for web automation tasks like scraping, testing, and user interaction simulation.
6
6
@@ -22,17 +22,25 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
22
22
This node supports two main resources:
23
23
24
24
### Browser Session Management
25
-
-**Create Session** - Create a new browser session with configurable options
25
+
-**Create Session** - Create a new browser session with configurable options (keep-alive, proxies, viewport settings)
26
26
-**Get Sessions** - List all browser sessions for your project
27
27
-**Get Session** - Get details of a specific session by ID
28
28
-**Delete Session** - Delete a browser session by ID
29
29
30
-
### Browser Actions (Coming Soon)
30
+
### Browser Actions
31
+
The node provides both traditional browser automation and AI-powered operations:
32
+
33
+
#### Traditional Browser Operations
31
34
-**Navigate** - Navigate to a specific URL within a session
32
-
-**Take Screenshot** - Capture screenshots of pages or elements
33
-
-**Get Page Content** - Extract text content from page elements
35
+
-**Take Screenshot** - Capture full page or element screenshots
36
+
-**Get Page Content** - Extract text content from page elements using CSS selectors
34
37
-**Click Element** - Click on page elements using CSS selectors
35
-
-**Type Text** - Type text into input fields
38
+
-**Type Text** - Type text into input fields using CSS selectors
-**Act** - Perform actions using natural language instructions (e.g., "click the login button", "fill out the contact form")
42
+
-**Observe** - Get insights about the page using natural language queries (e.g., "what products are available?", "is the user logged in?")
43
+
-**Extract** - Extract structured data using natural language instructions and Zod schemas
36
44
37
45
## Credentials
38
46
@@ -41,20 +49,22 @@ To use this node, you need:
41
49
1.**Browserbase Account**: Sign up at [browserbase.com](https://browserbase.com)
42
50
2.**API Key**: Get your API key from the Browserbase dashboard
43
51
3.**Project ID**: Create a project and note the Project ID
52
+
4.**AI API Key** (for Stagehand operations): OpenAI or Anthropic API key
44
53
45
54
### Setting up credentials in n8n:
46
55
1. In n8n, go to **Settings** → **Credentials**
47
56
2. Click **Add Credential** and search for "Browserbase"
48
57
3. Enter your:
49
58
-**Browserbase API Key**: Your API key from the dashboard
50
59
-**Browserbase Project ID**: Your project ID from the dashboard
60
+
-**AI API Key**: Your OpenAI or Anthropic API key (for AI operations)
51
61
4. Test the connection and save
52
62
53
63
## Compatibility
54
64
55
65
-**Minimum n8n version**: 0.227.0
56
66
-**Tested against**: n8n v1.0+
57
-
-**Node.js version**: 18+ (required for Browserbase SDK)
67
+
-**Node.js version**: 18+ (required for Playwright and Stagehand dependencies)
58
68
59
69
## Usage
60
70
@@ -67,7 +77,7 @@ To use this node, you need:
67
77
- Keep Alive: `true` to maintain the session
68
78
- Proxies: `true` to use rotating proxies
69
79
- Fingerprint: `true` for browser fingerprinting
70
-
- Viewport dimensions
80
+
- Viewport dimensions (width/height)
71
81
72
82
2.**List Sessions**
73
83
- Resource: `Browser Session`
@@ -84,63 +94,153 @@ To use this node, you need:
84
94
- Operation: `Delete Session`
85
95
- Session ID: `ses_1234567890`
86
96
87
-
### Advanced Configuration
88
-
89
-
When creating sessions, you can configure:
90
-
91
-
-**Keep Alive**: Whether to keep the session active after operations
92
-
-**Browser Settings**:
93
-
- Viewport Width/Height for consistent rendering
94
-
-**Proxies**: Enable rotating proxies for IP diversity
95
-
-**Fingerprinting**: Enable browser fingerprinting for stealth
96
-
97
-
### Browser Actions (Implementation Required)
98
-
99
-
The Browser Action resource provides operations that require additional implementation using the Browserbase SDK. Each operation returns instructions for executing the action:
100
-
101
-
1.**Navigate to URL**
102
-
- Session ID: Use an existing session
103
-
- URL: Target website
104
-
- Wait for Load: Optional page load waiting
105
-
106
-
2.**Take Screenshot**
107
-
- Session ID: Use an existing session
108
-
- Screenshot Options: Full page or element-specific
109
-
110
-
3.**Interact with Elements**
111
-
- Session ID: Use an existing session
112
-
- Selector: CSS selector for target elements
113
-
- Text: For typing operations
97
+
### Traditional Browser Automation
98
+
99
+
#### Navigate to a Page
100
+
```
101
+
Resource: Browser Action
102
+
Operation: Navigate
103
+
Session ID: ses_1234567890
104
+
URL: https://example.com
105
+
```
106
+
107
+
#### Take Screenshot
108
+
```
109
+
Resource: Browser Action
110
+
Operation: Screenshot
111
+
Session ID: ses_1234567890
112
+
Screenshot Options:
113
+
- Full Page: true/false
114
+
- Format: png/jpeg
115
+
```
116
+
117
+
#### Extract Content
118
+
```
119
+
Resource: Browser Action
120
+
Operation: Get Content
121
+
Session ID: ses_1234567890
122
+
Selector: .product-title (CSS selector)
123
+
```
124
+
125
+
#### Click Elements
126
+
```
127
+
Resource: Browser Action
128
+
Operation: Click
129
+
Session ID: ses_1234567890
130
+
Selector: button[type="submit"]
131
+
```
132
+
133
+
#### Type Text
134
+
```
135
+
Resource: Browser Action
136
+
Operation: Type
137
+
Session ID: ses_1234567890
138
+
Selector: input[name="email"]
139
+
Text: user@example.com
140
+
```
141
+
142
+
### AI-Powered Operations (Stagehand)
143
+
144
+
#### Act with Natural Language
145
+
```
146
+
Resource: Browser Action
147
+
Operation: Act
148
+
Session ID: ses_1234567890
149
+
Instructions: "Click the login button and fill in the email field with test@example.com"
150
+
AI Options:
151
+
- Model: gpt-4o
152
+
- API Key: (from credentials)
153
+
```
154
+
155
+
#### Observe Page State
156
+
```
157
+
Resource: Browser Action
158
+
Operation: Observe
159
+
Session ID: ses_1234567890
160
+
Instructions: "What products are currently displayed on this page?"
161
+
AI Options:
162
+
- Model: claude-3-5-sonnet-20241022
163
+
- API Key: (from credentials)
164
+
```
165
+
166
+
#### Extract Structured Data
167
+
```
168
+
Resource: Browser Action
169
+
Operation: Extract
170
+
Session ID: ses_1234567890
171
+
Instructions: "Extract all product information from this page"
172
+
Schema: {
173
+
"type": "object",
174
+
"properties": {
175
+
"products": {
176
+
"type": "array",
177
+
"items": {
178
+
"type": "object",
179
+
"properties": {
180
+
"name": {"type": "string"},
181
+
"price": {"type": "string"},
182
+
"description": {"type": "string"}
183
+
}
184
+
}
185
+
}
186
+
}
187
+
}
188
+
AI Options:
189
+
- Model: gpt-4o-mini
190
+
```
191
+
192
+
### Session Flow Between Operations
193
+
194
+
The node automatically handles session IDs between operations:
195
+
196
+
1.**Create Session** → Returns `sessionId`
197
+
2.**Use sessionId** in subsequent Browser Action operations
198
+
3.**Session persists** across multiple operations
199
+
4.**Delete Session** when workflow completes
200
+
201
+
### AI Model Support
202
+
203
+
Supported AI models for Stagehand operations:
204
+
-**OpenAI**: `gpt-4o`, `gpt-4o-mini`
205
+
-**Anthropic**: `claude-3-5-sonnet-20241022`
114
206
115
207
### Error Handling
116
208
117
-
The node provides detailed error information including:
118
-
- Status codes from the Browserbase API
119
-
- Error descriptions
120
-
- Additional debugging details
209
+
The node provides comprehensive error handling:
210
+
- Detailed error messages for API failures
211
+
- Browser automation error context
212
+
- AI operation error details
213
+
- Session management error handling
121
214
122
-
Enable "Continue on Error" in the node settings to handle failures gracefully.
215
+
Enable "Continue on Error" in node settings for graceful failure handling.
123
216
124
217
### Tips for Production Use
125
218
126
-
1.**Session Management**: Create sessions at the start of workflows and reuse them for multiple operations
127
-
2.**Error Handling**: Always implement error handling for network and browser issues
128
-
3.**Rate Limiting**: Be mindful of Browserbase rate limits for session creation
129
-
4.**Cleanup**: Delete sessions when workflows complete to manage costs
219
+
1.**Session Management**: Create sessions at workflow start and reuse across operations
220
+
2.**AI Operations**: Use specific, clear instructions for better AI performance
221
+
3.**Traditional vs AI**: Use traditional operations for precise control, AI operations for complex interactions
222
+
4.**Error Handling**: Always implement error handling for network and browser issues
223
+
5.**Rate Limiting**: Be mindful of both Browserbase and AI API rate limits
224
+
6.**Cleanup**: Delete sessions when workflows complete to manage costs
225
+
7.**Schema Design**: For extract operations, design clear Zod schemas for consistent data structure
130
226
131
-
## Declarative Style Implementation
227
+
## Implementation Architecture
132
228
133
-
This node follows n8n's declarative style pattern similar to the HttpBin node:
229
+
This node uses a programmatic approach with:
134
230
135
-
- Uses `requestDefaults` for base API configuration
136
-
- Leverages routing for API endpoint definitions
137
-
- Provides structured parameter validation
138
-
- Implements proper authentication flow
231
+
-**Playwright Integration**: Real browser automation via Chrome DevTools Protocol
232
+
-**Stagehand AI**: Natural language browser interactions
233
+
-**Session Management**: Automatic session ID flow between operations
234
+
-**Error Handling**: Comprehensive error catching and reporting
235
+
-**Flexible Configuration**: Support for various browser and AI options
139
236
140
237
## Resources
141
238
142
239
*[n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
0 commit comments