Browserbase Integration
Overview
The Browserbase node runs a Browserbase Agent as a step in a Lamatic flow. You describe a task in plain words, and the agent does the task in a real browser. The node returns the answer as text, or as JSON in a shape that you define.
Use this node when a website has no API for what you need. For example, a flow can read a price from a product page, or download an invoice from a site that you sign in to.
The Browserbase node is an Action node. It runs as a step inside a flow and cannot start a flow. Each run uses the browser time of your Browserbase project.
Features
Key Functionalities
- Action - Run a task and wait: Starts a run and waits for the result, for up to 720 seconds.
- Action - Start a task: Starts a run and returns the Run ID at once, so that a later step can read the result.
- Action - Get run: Returns the status and the result of a run, and can wait until the run ends.
- Action - Stop run: Asks Browserbase to stop a run.
- Action - List files: Lists the files that the agent downloaded during a run.
Benefits
- Text or JSON results: The node returns the answer as text, or as JSON in a shape that you define.
- Stop on timeout: When a run outlasts Max wait (seconds), the node asks Browserbase to stop the run, so that the run stops using browser time. You can turn this off with Stop run on timeout.
- Saved logins: A Browserbase context starts the agent already signed in to a site.
- Long tasks: Start a task in one step, and read the result in a later step with Get run.
- Other Browserbase run fields: Pass fields such as a custom agent, variables, or proxies in Advanced options (JSON).
Prerequisites
Before you set up the Browserbase node, make sure that you have the following:
- Browserbase account: Runs use the browser time of your Browserbase project. For pricing, see Plans & pricing in the Browserbase docs.
- Browserbase API key: Copy the key from Browserbase under Settings.
You need this item only for some tasks:
- Browserbase context ID: For a site that needs a login, use a Browserbase context that is already signed in to the site. See Contexts in the Browserbase docs.
Setup
Step 1: Copy Your Browserbase API Key
- Open Settings in Browserbase.
- Copy the API key.
Step 2: Add the Credential in Lamatic
- Add the Browserbase node to your flow. The node is in the Apps section.
- In Credentials, add a new credential.
- Enter a Credential Name and your Browserbase API Key.
- Click Test & Save.
Studio sends a test request to Browserbase with the key. Studio saves the credential only if Browserbase accepts the key.
Step 3: Configure the Node
- Select the credential in Credentials.
- Select an Action. The default is Run a task and wait.
- Write the Task in plain words. For a first test, use a page with a known answer. For example,
Open https://example.com and tell me the title of the page. - To get JSON back, define the fields in Output shape (optional).
- Set Max wait (seconds) for the task, and keep Stop run on timeout on.
The Configuration Reference describes every field.
Step 4: Test the Flow
A test in Studio starts a real run on Browserbase. The run uses the browser time of your Browserbase project.
Run a test of the flow in Studio. When the run completes, Success is true and Answer holds the result as text. For the example task, Answer should name Example Domain, which is the title of that page. If you defined an Output shape (optional), read the result from Output.
Configuration Reference
Credential Configuration
| Parameter | Description | Required | Example |
|---|---|---|---|
| Credential Name | Name that identifies the credential in Lamatic | Yes | my-browserbase-key |
| Browserbase API Key | API key from Browserbase. Copy the key from Browserbase under Settings. | Yes | your-api-key |
Action Configuration
Every action has these fields:
| Parameter | Description | Required | Default |
|---|---|---|---|
| Name | Display name of the node in the flow | No | Browserbase |
| Credentials | The Browserbase credential to run with | Yes | None |
| Action | What the node does: Run a task and wait, Start a task, Get run, Stop run, or List files | Yes | Run a task and wait |
The other fields depend on the action.
Run a task and wait
This action starts a run. The node then waits until the run ends, the run pauses, or Max wait (seconds) passes.
| Parameter | Description | Required | Default |
|---|---|---|---|
| Task | What the agent should do, in plain words. For example, find the price of a product on a site. | Yes | None |
| Output shape (optional) | The JSON shape to get back in Output. Leave it empty to get a text Answer. See Output Shape. | No | Empty |
| Max wait (seconds) | How long the node waits for the run, from 10 to 720 seconds. The node moves a value outside this range to the nearest limit. | No | 600 |
| Stop run on timeout | When this option is on, the node asks Browserbase to stop the run when the wait ends, so that the run stops using browser time. Browserbase has no cost cap of its own. | No | On |
| Saved login (context ID) | The ID of a Browserbase context that is already signed in to the site, so that the agent starts signed in | No | Empty |
| Advanced options (JSON) | Other run fields that Browserbase accepts, such as {"agentId": "..."}, {"variables": {...}}, or {"browserSettings": {"proxies": true}}. See Advanced Options. | No | Empty |
Start a task
This action starts a run and returns at once. The run continues on Browserbase. Read the result later with Get run.
The node does not wait for this run and does not stop it. To end the run early, use Stop run.
| Parameter | Description | Required | Default |
|---|---|---|---|
| Task | What the agent should do, in plain words | Yes | None |
| Output shape (optional) | The JSON shape to get back in Output. Leave it empty to get a text Answer. | No | Empty |
| Saved login (context ID) | The ID of a Browserbase context that is already signed in to the site | No | Empty |
| Advanced options (JSON) | Other run fields that Browserbase accepts | No | Empty |
Get run
This action returns the current status and the result of a run. It never stops the run.
| Parameter | Description | Required | Default |
|---|---|---|---|
| Run ID | The Run ID output of a Start a task or Run a task and wait step | Yes | None |
| Wait until it ends | When this option is on, the node waits for the run to end before it returns. | No | Off |
| Max wait (seconds) | How long the node waits, from 10 to 720 seconds. The node uses this field only when Wait until it ends is on. | No | 600 |
Stop run
This action asks Browserbase to stop a run, and then returns the run. Stopped is true only when the status of the run is STOPPED.
| Parameter | Description | Required | Default |
|---|---|---|---|
| Run ID | The Run ID output of a Start a task or Run a task and wait step | Yes | None |
List files
This action lists the files that the agent downloaded in the browser session of a run. Each call returns up to 100 files.
The list holds the details of each file, not the content of the file. To get the content, see Managing files in the Browserbase docs.
| Parameter | Description | Required | Default |
|---|---|---|---|
| Run ID | The Run ID output of a Start a task or Run a task and wait step | Yes | None |
| Page cursor | The Next cursor output of an earlier List files step, to get the next page | No | Empty |
Output Shape
Output shape (optional) defines the JSON that the node returns in Output.
- Empty shape: The node asks the agent for a text answer. Answer holds the text, and Output holds
{"answer": "..."}. - Your own shape: Output holds JSON in your shape. Answer is empty, unless your shape has a text field named
answer. - In a flow config, the value is a JSON Schema object, written as text.
- The shape can be nested up to 64 levels deep.
Advanced Options
Advanced options (JSON) takes one JSON object. The node adds each key of the object to the request that it sends to Browserbase.
- A key that the node also sets replaces the value from the node. For example, a
resultSchemakey replaces Output shape (optional). - The node ignores a
taskkey. The node always sends the Task field. - The node merges a
browserSettingskey with its own browser settings. Its own settings are the context from Saved login (context ID),recordSession: false, andlogSession: false. - With an
agentIdkey and an empty Output shape (optional), the node sends no result schema of its own. Answer is then empty, unless the result has a text field namedanswer.
The node turns off session recording and session logs for each run. To turn them on, pass {"browserSettings": {"recordSession": true, "logSession": true}}.
The node sends only the ID of the context from Saved login (context ID). To set the persist option of the context, pass {"browserSettings": {"context": {"persist": true}}}. See Contexts in the Browserbase docs.
For the fields that Browserbase accepts, see Run an Agent in the Browserbase API reference.
Use Lamatic secrets for passwords. Do not type a password into Task or Advanced options (JSON).
Long Tasks
The node waits for 720 seconds at most, and a flow has a time limit of its own.
- A task that outlasts a sync flow: Set the response type of the trigger to async. See How long a flow can run.
- A task that takes more than 720 seconds: Use Start a task. Then read the result with Get run, in a later step or in another flow.
Paused Runs
A Browserbase run can pause to ask for input. A run pauses only when its request has a pauseWhen field, which you can set in Advanced options (JSON). See Pausing and resuming runs in the Browserbase docs.
- When a run pauses, the node stops waiting. The node returns the status
PAUSED,success: false, and a message in Error. - The node cannot resume a run. Resume the run with the Browserbase API. See Resume a Run in the Browserbase API reference.
- Browserbase cannot stop a paused run. Stop run on a paused run returns the status
PAUSED.
Low-Code Example
This example runs a task, waits for the result, and returns JSON.
nodes:
- nodeId: browserbaseNode_1
nodeType: browserbaseNode
nodeName: Browserbase
values:
credentials: my-browserbase-key
action: runTaskAndWait
task: 'Open {{triggerNode_1.output.url}} and find the name and the price of the product.'
outputSchema: |-
{
"type": "object",
"properties": {
"name": { "type": "string" },
"price": { "type": "number" }
},
"required": ["name", "price"]
}
maxWaitSeconds: 600
cancelOnTimeout: true
modes: {}
needs:
- triggerNode_1This example starts a task in one step and waits for the run in the next step.
nodes:
- nodeId: browserbaseNode_1
nodeType: browserbaseNode
nodeName: Start browser task
values:
credentials: my-browserbase-key
action: startTask
task: 'Open {{triggerNode_1.output.url}} and download the latest invoice.'
modes: {}
needs:
- triggerNode_1
- nodeId: browserbaseNode_2
nodeType: browserbaseNode
nodeName: Get browser run
values:
credentials: my-browserbase-key
action: getRun
runId: '{{browserbaseNode_1.output.runId}}'
waitUntilDone: true
maxWaitSeconds: 600
modes: {}
needs:
- browserbaseNode_1Get run can return before the run completes, for example when the run pauses or when Max wait (seconds) passes. Check Success before you list the downloaded files. After the Get run step, add a Condition node that checks that Success is true. On the path where the condition is true, add a List files step with these values:
values:
credentials: my-browserbase-key
action: listFiles
runId: '{{browserbaseNode_1.output.runId}}'Output
The outputs of the node depend on the action.
| Output | Key | Type | Description |
|---|---|---|---|
| Run ID | runId | Text | ID of the Browserbase run. Pass it to Get run, Stop run, or List files. |
| Session ID | sessionId | Text | ID of the browser session of the run. Empty when the run has no session. |
| Status | status | Text | Status of the run, as Browserbase reports it. The node knows PENDING, RUNNING, PAUSED, COMPLETED, FAILED, TIMED_OUT, and STOPPED. |
| Success | success | Boolean | true when the status is COMPLETED |
| Timed out | timedOut | Boolean | true when the wait of the node ended before the run ended. The status TIMED_OUT does not set this output. |
| Stopped | cancelled | Boolean | true when the status is STOPPED |
| Answer | answer | Text | The result of the task, as text. See Output Shape. |
| Output | output | Object | The result as JSON |
| Error | error | Text | The reason for a failed run or a paused run. Empty for other runs. |
| Files | files | Array | The downloaded files of the run, as Browserbase lists them. A file has fields such as id, filename, mimeType, size, and createdAt. |
| Next cursor | nextCursor | Text | Pass it as Page cursor to get the next page of files. Empty when no page is left. |
| Has more | hasMore | Boolean | true when more files are left to list |
| Run details | raw | Object | The full run, as Browserbase returns it |
Outputs by Action
| Action | Outputs |
|---|---|
| Run a task and wait | Run ID, Session ID, Status, Success, Timed out, Stopped, Answer, Output, Error, Run details |
| Start a task | Run ID, Session ID, Status |
| Get run | Run ID, Session ID, Status, Success, Timed out, Stopped, Answer, Output, Error, Run details |
| Stop run | Run ID, Session ID, Status, Success, Stopped, Answer, Output, Error, Run details |
| List files | Run ID, Session ID, Files, Next cursor, Has more |
Failed Runs and Timeouts
- Failed run: When Browserbase reports the status
FAILEDorTIMED_OUT, the node does not fail. The node returnssuccess: falseand the reason inerror. Check Success before you use Answer or Output. - Timeout: When the wait ends before the run ends, the node returns
timedOut: true. With Stop run on timeout on, the node asks Browserbase to stop the run. With the option off, the run continues, and you can read it later with Get run. - Run that ends as the wait ends: The node returns the result of the run, with
timedOut: false.
Example Output Reference
schema:
runId: string
sessionId: string
status: string
success: boolean
timedOut: boolean
cancelled: boolean
answer: string
output: object
error: string
files: array
nextCursor: string
hasMore: boolean
raw: objectTroubleshooting
Common Issues
Credential Errors
When the test of a credential fails, Studio shows Invalid credentials with the message from the test, such as one of the first three messages in this table. The last two messages appear when the node runs.
| Problem | Solution |
|---|---|
Enter your Browserbase API key. | Browserbase API Key is empty. Paste the key, then click Test & Save again. |
Browserbase rejected the API key. Check the key in the credential. | Check that you copied the whole key from Browserbase under Settings. |
Browserbase refused the request. The key may not have access to Agents. | Browserbase did not allow the request for this key. Any text after the message gives the reason. |
Select a Browserbase credential. | The node has no credential. Select one in Credentials. |
The Browserbase credential has no API key. | The saved credential has no key. Add a new credential with the key, and select it in Credentials. |
Field Errors
The node checks these fields before it calls Browserbase.
| Problem | Solution |
|---|---|
Select a valid browser action. | Action has a value that the node does not know. In a flow config, use runTaskAndWait, startTask, getRun, cancelRun, or listFiles. |
Task is required. or Run ID is required. | Fill in the field. If the field uses a variable, check that the earlier step returned a value. |
Output shape is not valid JSON. or Output shape must be a JSON object. | Correct the JSON in Output shape (optional). The value must be one JSON object. |
Output shape must not exceed 64 levels of nesting. | Use fewer levels of nesting in the shape. |
Advanced options is not valid JSON. or Advanced options must be a JSON object. | Enter one JSON object in Advanced options (JSON), for example {"browserSettings": {"proxies": true}}. |
Page cursor must be the Next cursor output of an earlier List files step. | Use the Next cursor output of a List files step in Page cursor, or leave the field empty. |
Run Errors
| Problem | Solution |
|---|---|
The Browserbase project has no browser time or credits left. | Check the usage and the plan of your Browserbase project. See Plans & pricing. |
Browserbase found no run with that ID. | Check Run ID. Use the Run ID output of a Start a task or Run a task and wait step. |
Browserbase rejected the request. or Browserbase rejected the request fields. | Browserbase did not accept a field. Any text after the message gives the reason. Check Output shape (optional) and Advanced options (JSON). |
Browserbase is at its rate limit or its limit of concurrent browsers. Try again shortly. | Run the step again after a short wait. If other runs are active, wait for them to end. See Concurrency management. |
Browserbase is unavailable right now (status 500). or Could not reach Browserbase. | The status number in the message can differ. For Get run, Stop run, or List files, run the step again later. For Run a task and wait or Start a task, a run can have started even though the message names no run. Look for the run in the Browserbase dashboard before you run the step again, because a second run uses browser time again. |
Browserbase did not answer in time. | If the message names a run, see Errors That Name a Run before you run the step again. If the message names no run and the step is Run a task and wait, the run still started. Look for it in the Browserbase dashboard before you run the step again. For a Get run step, run the step again. |
Browserbase sent a response this node cannot read | Contact Lamatic support and include the full message. |
Error starts with The run paused to ask for input. | The run waits for input. Resume the run with the Browserbase API, or let its browser session time out. See Paused Runs. |
Timed out is true | The wait ended before the run ended. Raise Max wait (seconds), or use Start a task and Get run. See Long Tasks. |
Success is false and Error has text | Browserbase reported that the run failed. Read Error for the reason. |
Errors That Name a Run
When a step fails after the run started, the message can end with the run and what happened to it. In this table, RUN_ID stands for the ID of the run.
| End of the message | Meaning |
|---|---|
Browserbase run RUN_ID was stopped. | The node stopped the run. |
Browserbase run RUN_ID was asked to stop. | Browserbase accepted the stop request. Check the status of the run with Get run. |
Browserbase run RUN_ID is paused and cannot be stopped until it resumes or its browser session times out. | The run waits for input. See Paused Runs. |
Browserbase run RUN_ID had already ended. | The run ended before the node could stop it. Read the result with Get run. |
Browserbase run RUN_ID may still be running. Stop it in the Browserbase dashboard. | The node could not stop the run. Try Stop run with that Run ID, or use the dashboard. |
Browserbase run RUN_ID is still running. | Stop run on timeout is off, so the node left the run. Stop the run with Stop run. |