Runtime
The Runtime manages the full lifecycle of your agent's compute environment β container deployment, autoscaling, versioning, and endpoints.
Core Concepts
Runtime
A Runtime is the managed compute environment that runs your containerized agent. It abstracts container scheduling, health checks, autoscaling, and HTTP routing.
Runtime states:
CREATING
Runtime is being created; containers are starting
ACTIVE
All minimum replicas are healthy; endpoint is serving traffic
UPDATING
A new version deployment is in progress
ERROR
One or more required replicas could not start (check logs)
DELETING
Runtime is being deleted
Versions
Every time you deploy a new container image to a runtime, AgentBase creates a new Version. Versions are immutable β a version's image and configuration never change after creation.
Endpoint
An Endpoint is the URL that clients call to interact with your agent. A runtime can have multiple endpoints and multiple versions β these are independent concepts. The default endpoint automatically tracks the latest version whenever a new version is deployed. You can designate any endpoint as the default, and create additional endpoints pinned to specific versions (for example, for canary or staging traffic).
Compute Flavors
A Compute Flavor defines the CPU and RAM allocated to each replica of your agent.
Autoscaling
The Runtime Service supports autoscaling based on CPU or RAM utilization. You define:
minReplicas: The floor β always running (range: 1β10)maxReplicas: The ceiling β caps resource usage (range: 1β10)cpuUtilizationandmemoryUtilization: Thresholds (25β75%) that trigger scale-out
When load drops, AgentBase scales replicas back down to minReplicas.
Service Contract
Your agent container must satisfy these requirements to work correctly with the Runtime Service:
Listen on port 8080 β the required port;
app.run(host="0.0.0.0", port=8080)Health check endpoint:
GET /healthmust return HTTP 200 to pass readiness checksStateless: Do not store session state in process memory β use the Memory Service instead
Auto-injected environment variables (available in all deployed agent containers):
GREENNODE_CLIENT_ID
IAM service account client ID
GREENNODE_CLIENT_SECRET
IAM service account client secret
GREENNODE_AGENT_IDENTITY
Agent identity name
Overview
Runtime topology:
Key facts:
Each
PATCH /agent-runtimes/{id}creates a new version β versions and endpoints are independent concepts under a runtimeThe default endpoint automatically tracks the latest version whenever a new version is deployed
A runtime can have multiple endpoints β you choose which one is the default
You have full control over all endpoints β create, update, or delete
Manage Runtimes
Portal
Create a Runtime
Open https://aiplatform.console.vngcloud.vn/runtime
Click "Create Runtime"
Fill information
Name
my-order-agent
Unique, lowercase, hyphens allowed
Description
Production order agent
Optional
Image URL
vcr.vngcloud.vn/<repo>/my-agent:v1
Full image path including tag
Flavor
1x1-general
1 CPU, 1 GB RAM
Min Replicas
1
Range: 1β10
Max Replicas
1
Set >1 to enable autoscaling
CPU Threshold
50
Scale out when CPU exceeds this % (25β75)
Memory Threshold
50
Scale out when RAM exceeds this % (25β75)
Registry Auth
Enable if private
Username = robot account backendName (see Supporting Services β Robot Accounts)
Environment Variables
KEY=value
Non-sensitive config only
Click Create
Runtime appears with status
CREATING, then transitions toACTIVE
List Runtimes
All runtimes are shown in a paginated table with: Name, Status, Description, Last version, Last updated
Get Runtime Details
Click a runtime name to view: status, image, flavor, autoscaling, environment variables, endpoints

Update a Runtime
Open the runtime detail page β "Edit"
Modify image URL, flavor, autoscaling, or env vars β Save
Delete a Runtime
Warning: Deletion is irreversible. This permanently removes the runtime and all its endpoints.
In Runtime detail page, find the runtime β Delete β confirm
RESTful API
Prerequisite: All API examples below use
$TOKENβ an IAM bearer token. See Configure Authentication for how to obtain it.
Create a Runtime
Public registry image:
Private registry image (imageAuth required):
Poll until ACTIVE:
Possible statuses: CREATING β ACTIVE (success) or ERROR (failed)
List Runtimes
Response shape:
Get Runtime Details
Update a Runtime
Each update creates a new version. The DEFAULT endpoint automatically points to the latest version.
Note: All fields (except
imageAuth) are required in the PATCH body.
Delete a Runtime
Warning: Deletion is irreversible.
Reset Service Account
If IAM service account credentials are changed or revoked, reset them to recover the runtime:
Warning: This regenerates
GREENNODE_CLIENT_IDandGREENNODE_CLIENT_SECRET. The runtime restarts with new credentials.
Manage Endpoints
Each runtime has a DEFAULT endpoint created automatically. You can create additional endpoints pointing to specific versions.
Portal
List Endpoints
Open the runtime detail page β "Endpoints" tab
Create Endpoint
On the runtime detail page β "Endpoints" tab β "Create Endpoint"
Fill in Name and Version β Create
Update Endpoint Version
On the "Endpoints" tab β click an endpoint β "Edit"
Change Version β Save
RESTful API
List Endpoints
Endpoint fields: id, agentRuntimeId, name, version, url, status, createdAt, updatedAt
Create Endpoint
Update Endpoint Version
Delete Endpoint
Runtime Versions
Each PATCH on a runtime creates a new immutable version. Use versions to roll back by pointing an endpoint to an older version number.
Portal
Open the runtime detail page β "Versions" tab

RESTful API
List Versions
Version fields: agentRuntimeId, version (integer), imageUrl, flavorId, autoscaling, createdAt
Rollback
Point the DEFAULT endpoint to an older version:
Runtime Service Contract
Your agent container must fulfill these requirements:
Port and Health Check
Listen port
8080
Required β not configurable
Health check path
GET /health
Must return HTTP 200
Using the greennode-agentbase SDK (recommended):
Without the SDK (FastAPI example):
Auto-Injected Environment Variables
The Runtime automatically injects these into every container:
GREENNODE_CLIENT_ID
IAM service account client ID for the runtime
GREENNODE_CLIENT_SECRET
IAM service account client secret
GREENNODE_AGENT_IDENTITY
The agent identity name
Request Headers
Incoming requests to your agent include:
X-GreenNode-AgentBase-User-Id
End-user ID (use as actorId for memory operations)
X-GreenNode-AgentBase-Session-Id
Session ID (use as thread_id for LangGraph checkpointing)
Important: If your agent uses memory, validate that these headers are present and return an error if missing. Do not fall back to default values β silent defaults cause data mixing between users.
Last updated

