#Functions
Sandbox0 Functions publish a Sandbox Service behind a stable function domain. A function keeps its identity, slug, and host across revisions, so callers can keep using the same URL while you publish new sandbox-backed code.
Functions are created from Sandbox Services, not from uploaded ZIP files or container images. Publish starts from a sandbox_id and service_id; Sandbox0 snapshots the service configuration and restore mounts into an immutable revision.
Model#
| Object | Description |
|---|---|
| Sandbox Service | A named port, ingress routes, and restartable runtime inside a sandbox |
| Function | Stable function identity, slug, and host under the configured function domain |
| Revision | Immutable snapshot of the source service plus the SandboxVolume restore mounts needed to restore it |
| Alias | Mutable pointer from a name such as production to a revision |
| Runtime | Restored sandbox and process context currently serving a function revision, when the source sandbox is gone |
The production alias is the serving pointer used by the function host. Creating a function creates revision 1 and points production at it. Creating another revision can either promote it immediately or leave it available for a later alias update.
How Serving Works#
Function traffic is handled by function-gateway. The gateway resolves the host to a function, loads the production revision, enforces the revision's service route policy, and proxies the request to the service port.
If the source sandbox still exists, the gateway routes to that sandbox and resumes it when needed. If the source sandbox has been deleted, the gateway claims a new runtime sandbox from the revision's template, mounts the revision-owned volumes, starts the service runtime command or binds to the referenced warm process, and reuses that runtime for later requests.
Publishable Services#
Only publishable Sandbox Services can become function revisions. A service is publishable when it is public and has a restartable runtime:
| Blocker | Meaning |
|---|---|
not_public | The service does not expose public ingress routes |
missing_runtime | The service has no restartable runtime |
manual_runtime | The service runtime is manual and cannot be started by Function Gateway |
missing_command | A cmd runtime is missing its command |
missing_warm_process_name | A warm_process runtime is missing its warm process name |
For Functions, a warm_process runtime must reference an existing cmd warm process alias or context ID. REPL warm processes are interactive execution contexts and cannot serve HTTP traffic.
Use Sandbox Services route policy for path matching, allowed methods, bearer/header auth, CORS, rate limits, path rewrite, and upstream timeout. Functions reuse the same route model.
Next Steps#
Publish Functions
Configure a publishable service and create a function from it.
Revisions And Aliases
Publish new revisions, promote them, and roll back with aliases.
Runtime
Inspect, restart, disable, and delete function runtimes.