Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openhands_automation-1.0.0a2.tar.gz (570.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openhands_automation-1.0.0a2-py3-none-any.whl (127.1 kB view details)

Uploaded Python 3

File details

Details for the file openhands_automation-1.0.0a2.tar.gz.

File metadata

  • Download URL: openhands_automation-1.0.0a2.tar.gz
  • Upload date:
  • Size: 570.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openhands_automation-1.0.0a2.tar.gz
Algorithm Hash digest
SHA256 c7b5e0222f58ab3108bc7e748bfc9f8785c1aac8dfdb2ba2d29c6b97d3b17231
MD5 2ce30bb9cfbcc6300e14fe680c437dd3
BLAKE2b-256 fe12083fe49f78dc15baa6fb518bac9f22ab7dd5df7448f9fe346e5f91345da9

See more details on using hashes here.

Provenance

The following attestation bundles were made for openhands_automation-1.0.0a2.tar.gz:

Publisher: pypi-release.yml on OpenHands/automation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openhands_automation-1.0.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for openhands_automation-1.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f521104356b63113740589d5931ce3f6f94088c15d84c9b41adf1b14bcf7c2a
MD5 1b0337e222aa74b34c0fcbde938af35b
BLAKE2b-256 aa7e30a54ae996d0709313ab135a61f66eab4e3d5c98ab6f4873c7f64b091de8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openhands_automation-1.0.0a2-py3-none-any.whl:

Publisher: pypi-release.yml on OpenHands/automation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page