# Repository Briefing: OpenHands/automation
> Source: https://repoforai.com/repo/OpenHands/automation (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/OpenHands/automation
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 20/20)
- **Latest Release**: 1.38.0 (2026-12-02) — https://github.com/OpenHands/automation/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, API
- **Momentum**: 51 ★ total (+0 24h / +1 7d) · 67 forks
- **When to Use**: Best for: Teams already running OpenHands that need an API to manage recurring or webhook-triggered conversations and track their outcomes. Skip if: You need a standalone agent runtime, a general cross-system workflow engine, or an API contract that is already stable beyond beta.

## Overview
```text
### Architecture & Core Mechanics
OpenHands Automation is the control plane for recurring and event-driven OpenHands conversations. `openhands.automation.app:app` is the FastAPI entry point; `router.py` exposes CRUD, `scheduler.py` handles cron, and webhooks provide a second trigger path. `dispatcher.py` submits pending runs to OpenHands. The service owns run history and sandbox lifecycle orchestration, while the Agent Server and software-agent SDK execute conversations and own tool behavior, workspaces, and agent events.

The Python 3.12+ stack uses Pydantic schemas, SQLAlchemy models, and Alembic migrations. The dependency manifest includes `croniter`, `asyncpg`, and `aiosqlite`. Integrations span inbound HTTP callbacks and an explicit `aiohttp` WebSocket transport dependency for Slack SDK's async Socket Mode client. These are integration paths into the service, not a model or agent-tool plugin interface.

### Key Capabilities & Differentiators
Automations can run on a cron schedule or respond to webhook events such as those from GitHub. Per-user API keys govern automation access, and run history records execution status and results. A direct Microsoft Teams outgoing webhook example covers source admission, API setup, and acknowledgements. This layer dispatches OpenHands conversations rather than selecting or serving model families itself.

Recent releases extend what can be recorded and filtered. Version 1.36.0 added persisted outcome values for analytics and factory-validated outcome parsers. Version 1.37.0 introduced outcome periods and dedupe keys and reserved the `platform.` outcome-key prefix. Version 1.38.0 added automation-list filtering by factory membership. Outcome deduplication should not be read as a guarantee that webhook deliveries or agent runs execute exactly once.

### Trade-offs & Limitations
The strongest reason to adopt this service is that a job is already an OpenHands conversation: definitions, triggers, dispatch, and history have one owner without duplicating execution logic. A CI scheduler is a better fit when the job lives entirely inside an existing repository pipeline. For multi-step dependencies across unrelated systems, evaluate a general workflow engine; this service's scope is OpenHands orchestration rather than general-purpose workflow execution.

Self-hosting the API leaves you responsible for database migrations, webhook reachability, API key handling, and connectivity to the execution layer. The advisory lock coordinates schema migrations, not scheduler failover or duplicate-run prevention. Because the service is in beta, pin a release and test integrations and upgrades before depending on stable behavior. Size the control plane by inbound event rate, dispatch concurrency, and retained history; model and sandbox costs belong to the execution side.

### Hardware & Deployment Guide
For local development, use Python 3.12+, `uv`, and PostgreSQL: install with `uv sync --group dev` and start `uv run uvicorn openhands.automation.app:app --host 0.0.0.0 --port 8000 --reload`. For container deployment, build from `containers/Dockerfile` or use images published to `ghcr.io/openhands/automation` on main-branch pushes and tags. Running the API container does not replace the OpenHands execution layer.

SQLite databases migrate on startup. PostgreSQL migrations can be applied separately with `uv run alembic upgrade head` or enabled at startup with `AUTOMATION_RUN_MIGRATIONS_ON_STARTUP=true`. On startup, an advisory lock serializes migration attempts across replicas, and a migration failure prevents the affected replica from starting. Optional database creation uses `AUTOMATION_CREATE_DATABASE_IF_MISSING=true` and requires `CREATEDB`. Release 1.38.0 also updated the container's Debian snapshot for krb5 and zstd security fixes.
```

## Key Capabilities
```text
- Triggering: Cron schedules and inbound webhooks launch OpenHands conversations.
- Execution boundary: The dispatcher submits pending runs to OpenHands; the Agent Server and SDK own tool and workspace behavior.
- API and tracking: FastAPI exposes automation CRUD, alongside per-user API keys and run history with status and results.
- Integrations: GitHub events are a webhook example; the Teams outgoing webhook guide covers source admission and acknowledgements.
- Migration safety: PostgreSQL startup migrations are opt-in and serialized across replicas via an advisory lock.
- Release progression: Versions 1.36–1.38 add outcome analytics data, dedupe keys, and factory-membership list filtering.
```

## Quick Start / Clone
```bash
# Install dependencies
uv sync --group dev

# Run the service locally (requires PostgreSQL)
uv run uvicorn openhands.automation.app:app --host 0.0.0.0 --port 8000 --reload
```
