Skip to main content
The runtime passes each function a client scoped to its Attempt, whose run creates child Calls in the current Run instead of new Runs.

run_id

property
The Run this client is scoped to, or None outside a Run.

me

method
Fetch the authenticated user’s profile and native user ID.

create_secret

method
Store a typed secret value and return its metadata.

get_secret

method
Fetch secret metadata without accessing its value.

list_secrets

method
List accessible secret metadata, following pagination automatically.

update_secret

method
Update a secret; omitting its value preserves the current version.

delete_secret

method
Delete a secret and its stored value.

access_secret

method
Access a secret’s stored value and version with read permission.

create_volume

method
Create a Volume, using OuterProduct storage by default.

get_volume

method
Fetch a volume and open read access to its storage.

list_nodes

method
List the nodes that can run Calls now.

list_volumes

method
List all accessible volumes, following pagination automatically.

update_volume

method
Rename a volume or update its description without changing its identity.

delete_volume

method
Delete the volume, and the files of an OuterProduct-managed one; external storage keeps its files.

generate_temporary_volume_credentials

method
Vend volume credentials and their expiration in Unix milliseconds.

run

method
Start fn without waiting and return its handle. Outside a Run this creates a Run; a client scoped to an Attempt creates a child Call of it instead. memory_bytes defaults to 2 GiB per CPU, gpu to one when gpu_type is set, and retry_strategy to three attempts. env_vars values are literals or stored Secrets. name labels the Run or child Call. port is a port fn serves while it runs, which its URL (Run.get_url, or Call.get_url for a child Call) serves to anyone. timeout is how many seconds each Attempt may run, up to 24 hours, the default. Volume mounts stop working an hour after an Attempt starts, so run warns when it mounts volumes without a timeout of an hour or less. Each Attempt imports fn by name from a file mount of its top-level package, or else its module’s file, so fn must be defined at module level, and its module must not call run when imported. A Run also publishes the local files of every module-level Image in fn’s module, which its Attempts then submit child Calls with by name; other Images upload their local files when submitted. Children from the current source package reuse its published snapshot. Volumes accept VolumeHandle objects, volume names, or UUIDs.

create_sandbox

method
Start a sandbox running args in image, once it runs. It lives until terminated, or for timeout seconds. name, such as "dev", must be unique in the deployment; without one, the sandbox is named for its id. memory_bytes defaults to 2 GiB per CPU, and gpu to one when gpu_type is set. Volumes accept VolumeHandle objects, volume names, or UUIDs. With port, the sandbox’s url serves that port to anyone, and it runs once the port answers.

get_sandbox

method

list_sandboxes

method

map

method
Run fn concurrently and yield results in input order. Input iterables supply positional arguments, paired by position until the shortest iterable ends. First iteration submits every paired invocation before yielding. Outside a Run these are independent Runs; inside an Attempt they are child Calls. Terminal failures raise when their input is reached. Closing the iterator leaves submitted work running, subject to the Attempt’s usual child cleanup. name is a shared display label for every submitted Run or Call, and timeout applies to each, as in run.

close

method
Cancel this Attempt’s child Calls still running.

get_run

method
Get one Run available to this user.

list_runs

method
List Runs available to this user.

cancel_run

method
Request cancellation of one active Run available to this user.

get_call

method
Get one Call by canonical resource name.

list_calls

method
List Calls in a Run, optionally restricted to direct children.

cancel_call

method
Request cancellation of one Call and unfinished descendants.

get_attempt

method
Get one Attempt by canonical resource name.

list_attempts

method
List the dispatch Attempts of one Call.