OpenHands automation service
Project description
OpenHands Automation Service
⚠️ Beta: This project is currently in beta. APIs and features may change without notice.
Scheduled and event-driven automation execution for OpenHands Cloud. This service allows users to create automations that run on a schedule (cron) or in response to events (webhooks).
Features
- Scheduled Automations: Run OpenHands conversations on a cron schedule
- Event-Driven: Trigger automations via webhooks (e.g., GitHub events)
- API Key Management: Per-user API keys for secure automation access
- Run History: Track automation runs with status and results
Development
Prerequisites
- Python 3.12+
- uv for dependency management
- PostgreSQL (or use testcontainers for testing)
Setup
# 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
Testing
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=openhands/automation --cov-report=term-missing
Code Quality
# Run pre-commit hooks
uv run pre-commit run --all-files
# Format code
uv run ruff format
# Lint code
uv run ruff check --fix
# Type check
uv run pyright
Database Migrations
# Create a new migration
uv run alembic revision --autogenerate -m "description"
# Apply migrations
uv run alembic upgrade head
Docker
# Build the image
docker build -t automation -f containers/Dockerfile .
# Run the container
docker run -p 8000:8000 automation
Project Structure
openhands/
└── automation/ # Main application package (openhands.automation namespace)
├── app.py # FastAPI application entry point
├── router.py # API routes for CRUD operations
├── scheduler.py # Background scheduler for cron jobs
├── dispatcher.py # Dispatches pending runs to OpenHands
├── models.py # SQLAlchemy models
├── schemas.py # Pydantic schemas for API
└── utils/ # Utility functions
migrations/ # Alembic database migrations
tests/ # Unit tests
containers/ # Docker configuration
Deployment
This service is deployed via the deploy repository. Docker images are automatically built and pushed to ghcr.io/openhands/automation on every push to main and on tags.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openhands_automation-1.0.0a3.tar.gz.
File metadata
- Download URL: openhands_automation-1.0.0a3.tar.gz
- Upload date:
- Size: 573.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6cd860de0603a8bd3269f90b9694a6c6af8a52821dcff5926c573f9816427b9
|
|
| MD5 |
676f55c935fde64e02d7ac6489db751a
|
|
| BLAKE2b-256 |
19b7378130034db91f2d1c68e778ed38c306ffc51ef63e80452af8e0e85da379
|
Provenance
The following attestation bundles were made for openhands_automation-1.0.0a3.tar.gz:
Publisher:
pypi-release.yml on OpenHands/automation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openhands_automation-1.0.0a3.tar.gz -
Subject digest:
d6cd860de0603a8bd3269f90b9694a6c6af8a52821dcff5926c573f9816427b9 - Sigstore transparency entry: 1549719661
- Sigstore integration time:
-
Permalink:
OpenHands/automation@56e61a05151c0a023b0bba2628f833343e903dbc -
Branch / Tag:
refs/tags/1.0.0a3 - Owner: https://github.com/OpenHands
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@56e61a05151c0a023b0bba2628f833343e903dbc -
Trigger Event:
push
-
Statement type:
File details
Details for the file openhands_automation-1.0.0a3-py3-none-any.whl.
File metadata
- Download URL: openhands_automation-1.0.0a3-py3-none-any.whl
- Upload date:
- Size: 127.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21540460bf6a5c6ccc45a98a1b8a3ddfe5e97c7170124e2b2b2d4d2d5699777a
|
|
| MD5 |
5dd533c16a410170fe4dd21a726a15df
|
|
| BLAKE2b-256 |
e30c6ff0b3702843454a1c7122991c0812aea394635f3d8cec20fac58b2a2118
|
Provenance
The following attestation bundles were made for openhands_automation-1.0.0a3-py3-none-any.whl:
Publisher:
pypi-release.yml on OpenHands/automation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openhands_automation-1.0.0a3-py3-none-any.whl -
Subject digest:
21540460bf6a5c6ccc45a98a1b8a3ddfe5e97c7170124e2b2b2d4d2d5699777a - Sigstore transparency entry: 1549719685
- Sigstore integration time:
-
Permalink:
OpenHands/automation@56e61a05151c0a023b0bba2628f833343e903dbc -
Branch / Tag:
refs/tags/1.0.0a3 - Owner: https://github.com/OpenHands
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@56e61a05151c0a023b0bba2628f833343e903dbc -
Trigger Event:
push
-
Statement type: