Home / Reference

Robots, runs and agents

A robot is a Python automation you registered. The orchestrator stores how to run it, executes it on agents you control, and links every run to its logs, traces and incidents through the robot's service_name (OpenTelemetry service.name).

Create a robot

In the console: Orchestration → Robots → New robot is a five-step wizard (who, what to run, when, where, review). The last step shows the same robot as a terminal command and as robot.json, so you can script it.

From a terminal (the same API):

obskitpy login --url http://localhost:8600 --email admin@obskitpy.local     # stores an API token on this computer
obskitpy robot create --key SAP_PURCHASES --name "SAP Purchases" --team Procurement \
    --entrypoint main.py --service-name sap-purchases --env dev hmg \
    --var MODE=fast --credential SAP_PROD_USER
obskitpy robot list
obskitpy robot apply -f robot.json          # create or update from a file; running it twice changes nothing
obskitpy robot disable SAP_PURCHASES        # also: enable, archive

Run it

obskitpy agent run --capacity 4 --source-dir ./robots     # a worker on this machine
obskitpy robot run SAP_PURCHASES --env dev --follow        # trigger and watch; exit code 1 if it fails
obskitpy runs list                                        # runs logs RUN_ID | runs cancel RUN_ID

In the console, Run now on the robot page starts a run and shows its output as it arrives.

Agents

An agent is a process that pulls work from the portal (it only makes outbound HTTPS calls, so it can sit behind a firewall, on a VM, in a container or in the cloud: see Azure). It runs the entrypoint in a child process with a small allow-list of environment variables plus the robot's variables and credentials, and these values:

Variable Meaning
OBSKITPY_RUN_ID, OBSKITPY_ROBOT, OBSKITPY_ENV, OBSKITPY_ATTEMPT which run this is
OBSKITPY_RELEASE the version deployed in that environment (see CI/CD)
OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES link the telemetry to the robot, environment, run and version
OTEL_EXPORTER_OTLP_ENDPOINT from --otlp-endpoint / OBSKITPY_OTLP_ENDPOINT of the agent

A robot with a repository is cloned (shallow) into a temporary folder for each run; without one, the entrypoint is looked up in the agent's --source-dir. The agent does not install the robot's dependencies: use an environment that already has them (for containers, build your image FROM the agent image and pip install -r requirements.txt).

Schedules

Each robot can have cron schedules (5 fields, UTC, per environment): */15 * * * *, 0 8 * * 1-5. The wizard builds the expression from plain choices.

Lifecycle

QUEUED → ASSIGNED → RUNNING → SUCCEEDED | FAILED | TIMED_OUT | CANCELLED, or LOST when an agent stops reporting.

Tested limits

A load test (tests/load/load_test.py) drives the portal and agents as separate processes against PostgreSQL: 500 runs of 20 robots on 3 agents finished in about 25 s, each exactly once and within every robot's limit. See the architecture.

✎ Edit this page on GitHub