Quick Start
Deploying a Service
Only
tool and agent types (those with runtime.command or loop config) with a published code bundle are eligible for service deployment. prompt types (direct LLM) cannot be deployed as services.Example
How Deployment Works
- You publish an agent with
runtime.commandorloopconfig (orch publish) - You run
orch service deploy org/agent - The platform provisions infrastructure with your configured instance count
- A service runner container downloads your agent bundle, installs dependencies (pip or npm), detects the entrypoint, and starts the process
- Your service gets a public HTTPS URL (visible in
orch service info) - A health endpoint at
/healthreturns200when the service is ready - If the process crashes, the platform automatically restarts it
- The agent’s
required_secrets(plus any--secretextras) are resolved from the workspace vault and injected as environment variables
Managing Services
List Services
CRASH-LOOP badge.
Service Info
- Service ID, name, agent, and version
- Current state and health status
- Restart count and consecutive failure count
- Instance configuration (min/max)
- Public service URL
- Deploy and last restart timestamps
- Last error message (if any)
- Alert webhook URL (if configured)
- Recent events timeline
View Logs
The easiest way to view logs for an always-on service is throughorch logs:
orch logs automatically detects if the agent has an always-on service and shows its live logs alongside the run history.
For advanced options (time filtering, higher limits), use orch service logs directly:
Logs include timestamps and severity levels. Sensitive values (API keys, tokens, passwords) are automatically redacted.
Restart a Service
Delete a Service
HTTP Ingress (Receiving Webhooks)
Every always-on service gets a public HTTPS URL automatically. Useorch service info to find yours:
How It Works
The platform runs an HTTP gateway on port 8080 that:- Handles
GET /healthinternally (platform health checks) - Proxies all other HTTP requests to your app on port 3000
ORCHAGENT_HTTP_PORT env var for a different port). The PORT env var is also set to this value for framework compatibility (Express, Uvicorn, etc.).
Example — Telegram Webhook Receiver
Services That Don’t Need HTTP Ingress
Services that only make outbound connections (Discord bots using WebSocket, pollers, cron-triggered workers) don’t need to bind to any port — the gateway handles health checks automatically.Workspace Secrets
Secrets are automatically resolved from the agent’srequired_secrets field. If your agent declares what it needs in orchagent.json, you don’t need any --secret flags at deploy time:
- Reads
required_secretsfrom the agent - Validates that all secrets exist in the workspace vault
- Injects them as environment variables into the container
The --secret escape hatch
Use --secret to inject additional secrets not declared in required_secrets (e.g., operational tokens, debug credentials):
--secret flags are merged with required_secrets — you get both. On version updates and restarts, the platform re-merges to pick up any new required_secrets from the latest version.
Environment Variables
Pass non-sensitive configuration using the--env flag:
Updating Environment & Secrets
Update environment variables and secrets on a running service without redeploying. Changes trigger an automatic restart to apply the new values.Environment Variables
Secrets
API
You can also update env/secrets via the PATCH endpoint:The API uses full replacement semantics — whatever you send replaces the entire set. The CLI commands handle merge/unset logic for you. If the service is running, changes trigger an automatic restart (2-5 seconds of downtime). If the service is paused, changes are saved and apply on the next resume.
Crash Loop Detection & Alerts
The platform monitors your service for repeated restart failures and automatically intervenes to prevent runaway restarts.How It Works
- Each time a service restarts and fails again, the
consecutive_restart_failurescounter increments - When the counter reaches the halfway point of your threshold, a proactive warning alert fires
- When the counter reaches the
max_restart_failuresthreshold, the service is auto-paused and a crash loop alert fires - Auto-paused services show a
CRASH-LOOPbadge inorch service listandorch service info
Configuring Alerts
Set an alert webhook URL and customize the failure threshold via the API:Alerts fire at two points: a proactive warning at the halfway mark (e.g., 3 out of 5 failures) and a critical alert when the threshold is reached and the service is auto-paused.
Alert Payload
Recovering from a Crash Loop
- Check the logs:
orch service logs <service-id> - Check the events timeline:
orch service info <service-id> - Fix the underlying issue (code bug, missing secret, dependency failure)
- Restart the service:
orch service restart <service-id>
Entrypoint Detection
When you deploy a service without a--command flag, the runner automatically detects your entrypoint using the following priority:
--commandflag — explicit command overriderun_commandin orchagent.json — define arun_commandfield in your manifest- Auto-scan — the runner checks for common filenames in order:
Node.js (checked second):
Permissions
Examples
Discord Bot
Webhook Listener (Telegram, Stripe, etc.)
Background Worker
Custom Entrypoint with Arguments
Auto-Update on Publish
When you publish a new version of an agent (orch publish), any running services in the same workspace with auto_update enabled are automatically updated to the new version.
- Are you in the right workspace? Run
orch workspace listandorch service list --workspace <slug>to confirm - Is auto_update enabled? Services deployed with
--no-auto-updatewon’t be updated - Does the new version have a code bundle? Agents without
runtime.commandor a code bundle won’t trigger service updates
orch service restart does not update the version — it only restarts the existing code. Use orch service update to pull a new published version.Troubleshooting
Service stuck in provisioning?- Check the events timeline:
orch service info <service-id> - Verify your agent has a
runtime.commandorloopconfig and a published code bundle (prompttype agents cannot be deployed as services) - Check the logs for dependency installation failures:
orch service logs <service-id>
- Check the logs for crash output:
orch service logs <service-id> - Look at the last error:
orch service info <service-id> - Ensure all
required_secretsfrom the agent’s orchagent.json exist in your workspace vault - Verify your entrypoint process doesn’t exit immediately
- Your code must not bind to port 8080 — the platform health server uses it. Bind to port 3000 instead.
- New services may take up to 2 minutes for DNS to propagate
- Try a public DNS resolver to confirm:
nslookup <hostname> 1.1.1.1 - If your local machine cached a “not found” response, flush your DNS cache (
sudo dscacheutil -flushcacheon macOS) or wait ~30 minutes
- Confirm your app binds to port 3000 (not 8080):
--host 0.0.0.0 --port 3000 - Check that the webhook provider is using the full URL including the path (e.g.
https://<service-url>/webhook/telegram) - Test locally:
curl https://<service-url>/your-endpoint— you should see your app’s response, not a 404
- The service has been auto-paused after exceeding the failure threshold
- Fix the root cause, then restart:
orch service restart <service-id> - Check the events timeline for the failure pattern
- Add a
main.pyorindex.jsto your project root - Or set a
run_commandin yourorchagent.json - Or use
--commandwhen deploying
- Variables with names matching
secret,token,password,api_key,credential, orprivate_keymust use--secretinstead of--env - Store the value as a workspace secret first, then reference it by name
- Use
orch service restart <service-id>— this automatically refreshes the signed bundle URL
orch publish?
- Auto-update is workspace-scoped. If you published from a different workspace than where the service runs, it won’t auto-update
- Switch to the correct workspace first:
orch workspace use <slug>, thenorch publish - Or manually update:
orch service update <service-id> - Note:
orch service restartdoes NOT update the version — useorch service updateinstead
- The previous service’s infrastructure may not have fully cleaned up
- Wait 1-2 minutes and retry
- If it persists, try a different service name or contact support