Use a Function job for work that should start, run to completion, and produce a status, logs, and optional output files. Typical jobs include repository review, report generation, data extraction, evaluations, and agent workflows that exit after writing artifacts.
frontend -> your backend -> Nullspace Function run -> outputs or callback

Run From The CLI

nullspace functions deploy

nullspace functions run minimal-job-function \
  --input-json '{"subject":"functions"}' \
  --env EXAMPLE_FUNCTION_GREETING=hello \
  --retain-on-failure \
  --wait-seconds 60 \
  --json

nullspace functions logs minimal-job-function --run fnrun_123
nullspace functions outputs minimal-job-function --run fnrun_123
nullspace functions status minimal-job-function --run fnrun_123
Use run when you want to wait for completion and spawn when you want a detached run record to poll or stream later.
nullspace functions spawn minimal-job-function \
  --input-json '{"subject":"functions"}' \
  --json
Use --follow on run to fetch the first log page after creation, --detach to make run behave like spawn, and --idempotency-key when retrying a client request.
nullspace functions run minimal-job-function \
  --input-file request.json \
  --env-file .env.runtime \
  --follow

nullspace functions stop minimal-job-function \
  --run fnrun_123 \
  --reason "user cancelled"

Run From SDKs

Language is an invocation detail; the Function remains the same named platform primitive.
from pathlib import Path

from nullspace import Function

project = Path("examples/python/functions/minimal_job")
function, version, manifest = Function.deploy(path=project)
call = function.spawn(
    input={"subject": "functions"},
    envs={"EXAMPLE_FUNCTION_GREETING": "hello"},
    retain_on_failure=True,
)
run = call.get(timeout=60)
outputs = call.outputs()
print(run.status, len(outputs.outputs))

Outputs And Debugging

Declare output files or directories in function.py with nullspace.Outputs(paths=[...]). After the run exits, use functions outputs or the SDK to read output metadata. The output manifest is produced by the function runtime and should be treated as application-owned data. For failed runs, enable retain_on_failure or nullspace.Debug(retain_on_failure=True). Retained backing machines can be opened with commands, files, PTY, SSH, or desktop access for debugging. Related examples: Function Job, TypeScript Function Job, and Machine And Function Composition.