stagehand.agent.execute

View as Markdown

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

ArgumentTypeRequiredDescription
instructionstringYesLong-running agent instruction.
configobjectNoAgent execution settings.

Result

  • Type: operation | result
  • Description: Immediate result or long-running operation metadata.

SDK Example

1await runtime.stagehand.agent.execute('Export the latest invoices');

HTTP Example

1{
2 "runtime": "crm",
3 "steps": [
4 {
5 "call": "stagehand.agent.execute",
6 "args": [
7 "Export the latest invoices"
8 ]
9 }
10 ]
11}

Notes

  • This call may return an operation handle when the work runs asynchronously.