*** title: stagehand.agent.execute description: Run a long-form Stagehand agent flow against the current runtime. ------------------------------------------------------------------------------ `stagehand.agent.execute` is a browser runtime capability in the `stagehand.agent` namespace. ## Availability * Runtime: `browser` * Kind: `agent` * Category: `agents` * Supported drivers: Stagehand ## SDK Surface * SDK path: `runtime.stagehand.agent.execute` * Async: Yes ## HTTP Surface * Transport: `workspace.execute(...)` * Call: `stagehand.agent.execute` * Long-running: Yes ## Reference Semantics * Requires refs: `page` ## Arguments | Argument | Type | Required | Description | | ------------- | -------- | -------- | ------------------------------- | | `instruction` | `string` | Yes | Long-running agent instruction. | | `config` | `object` | No | Agent execution settings. | ## Result * Type: `operation | result` * Description: Immediate result or long-running operation metadata. ## SDK Example ```ts await runtime.stagehand.agent.execute('Export the latest invoices'); ``` ## HTTP Example ```json { "runtime": "crm", "steps": [ { "call": "stagehand.agent.execute", "args": [ "Export the latest invoices" ] } ] } ``` ## Related Capabilities * [`stagehand.act`](../agents/stagehand-act) * [`browserUse.agent.execute`](../agents/browser-use-agent-execute) ## Notes * This call may return an operation handle when the work runs asynchronously.