Invocations
An invocation is hosted agent work BCTRL runs inside a runtime. Rather than driving the browser yourself over CDP, you describe what you want in natural language and BCTRL executes it: a single Stagehand action, a structured extraction, or a multi-step browser-use agent.
Invocations are durable, cancellable, and awaitable. You create them against a runtime (live control) and read their history from the run (observability).
Create and wait
createAndWait creates the invocation and polls until it finishes - the common case when you just want the result.
Pass a Zod schema as schema and the SDK converts it to JSON Schema on the wire and validates the output. The timeoutMs option is your client-side wait budget across long-poll requests.
Actions
Every invocation has an action. The lower-level create takes the action directly:
Typed helpers
Stagehand and browser-use actions have typed helpers so you do not write the action field by hand:
Helpers accept a saved AI provider (aiProviderId), toolsets (toolsetId, toolIds), and per-call knobs like model and temperature.
Create, then wait separately
For long-running agents, create now and await later - or cancel:
Read invocation history
Invocations belong to a run. Read them from the run side:
Next
- Hosted agents - Stagehand and browser-use in depth
- AI Providers - bring your own model keys
- Schema authoring - Zod and JSON Schema output

