SRVO Script
SRVO Script runs short, read-only JavaScript in an isolated runner. A script receives args, can read permitted SRVO data through srvo.*, and returns a JSON value. It runs with your current access, limited to read actions.
SRVO Script is being rolled out. It is available only to workspaces on the server’s allowlist. If it is not enabled for your workspace, a run returns NOT_AVAILABLE.
Write a first script
This script returns the message value from its input. The input object is available as the handler’s second argument.
export default (srvo, args) => {
return args.message;
};
Pass JSON such as {"message":"Hello"} as args. A script can also use supported reads such as srvo.records.query(...) or srvo.users.me(). See the SRVO Script SDK reference for available methods, inputs, and permissions.
Limits
Each run has these limits:
- 200 ms of guest CPU time.
- 80 MiB of WebAssembly memory.
- 10 seconds of wall time, including SDK calls.
- 20 SDK calls.
- 256 KiB of output.
The runner reports LIMIT_CPU when a script exceeds its CPU budget and LIMIT_MEMORY when it exceeds its memory limit. Other limits have their own error codes in the run result.
Run a script
You can start a run from the CLI, REST API, or MCP:
- CLI: run
srvo core scripts run --source 'export default (srvo, args) => args.message' --args '{"message":"Hello"}'. Usesrvo core scripts get --run-id <run-id>to read the result. - REST API: send
POST /api/v1/scripts/runswithsourceand optionalargs. PollGET /api/v1/scripts/runs/{runId}until the run finishes. - MCP: call
runScriptwithsourceand optionalargs, then callgetScriptRunwith the returnedrunId.
The first response contains a runId and a running status. The result includes the output or an error and usage details. Runs are read-only. See the API, MCP, and CLI references for full input and output shapes.