Skip to content
Dashboard

Execute multiple actions

client.computers.batch(stringid, ComputerBatchParams { actions } body, RequestOptionsoptions?): ComputerBatchResponse
POST/computers/{id}/batch

Execute a batch of actions in sequence, stopping on first error

ParametersExpand Collapse
id: string
body: ComputerBatchParams { actions }
actions?: Array<ComputerAction { auto_detect_encoding, base64, button, 22 more } >
auto_detect_encoding?: boolean

For get_html_content

base64?: boolean

For screenshot

button?: string
debug?: Debug { command, cwd, env, 4 more }
command?: string
cwd?: string
env?: Record<string, string>
max_output_length?: number
request_id?: string
stream?: boolean
timeout_seconds?: number
dx?: number

For scrolling

dy?: number
height?: number
include_context?: boolean

Include page context in response

key?: string

For key_down/key_up

keys?: Array<string>
ms?: number
proxy_url?: string
request_id?: string

RequestId is used for correlating streaming output to the originating request. Set on ActionRequest, not individual action types.

scale_factor?: number
tab_id?: string

For tab management (browser sessions only)

text?: string
type?: string

click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up

url?: string
width?: number

For set_viewport

x?: number
x1?: number

For dragging/scrolling

x2?: number

For dragging

y?: number
y1?: number
y2?: number
ReturnsExpand Collapse
ComputerBatchResponse = Record<string, unknown>

Execute multiple actions

import Lightcone from '@tzafon/lightcone';

const client = new Lightcone({
  apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});

const response = await client.computers.batch('id');

console.log(response);
{
  "foo": "bar"
}
Returns Examples
{
  "foo": "bar"
}