Orchestration
Multi-region orchestration with Hono
This guide covers setting up and using multi-region orchestration with Hono (via Nitro).
Overview
The orchestrator allows you to:
- Run the same tests across multiple regions
- Execute tests in parallel
- Aggregate results from distributed runs
- Coordinate execution across multiple runner endpoints
Architecture
Setup
Installation
Add Orchestrator Module
Add the orchestrator module to your nitro.config.ts:
The orchestrator endpoints are automatically exposed at /api/orchestrator/* alongside your Hono routes.
Configure Runner Endpoints
Set the PLAYWRIGHT_RUNNERS environment variable:
Or configure in nitro.config.ts:
Usage
Submit a Run Request
Response:
Check Run Status
Response:
Get Run Results
Response:
API Endpoints
The orchestrator automatically provides:
POST /api/orchestrator- Submit a new run requestGET /api/orchestrator/{runId}/status- Get run statusGET /api/orchestrator/{runId}- Get run resultsGET /api/orchestrator/docs- Interactive API documentationGET /api/orchestrator/spec.json- OpenAPI specification
Run Modes
Remote Mode
Execute runners on remote endpoints:
Requirements:
- Each runner must specify a
region PLAYWRIGHT_RUNNERSmust be configured- Runner endpoints must be accessible
Local Mode
Execute runners locally (for testing):
Requirements:
- Runners must be available locally
- Each runner must specify a
urlin input
Concurrency Control
Control how many jobs run in parallel:
- Default: Unlimited (all jobs run in parallel)
- Limited: Set
concurrencyto limit parallel jobs - Sequential: Set
concurrency: 1to run one at a time
Timeouts
Set timeout for entire run:
- Timeout applies to entire run (all jobs)
- Individual job timeouts are handled by runner endpoints
- Run status becomes
"timed_out"if timeout exceeded
Best Practices
1. Use Consistent URLs
Group runners by URL to minimize job count:
2. Set Appropriate Timeouts
3. Monitor Run Status
Poll status endpoint for long-running runs:
4. Handle Failures Gracefully
See Also
- API Reference - Complete API documentation
- Deployment - Production deployment guide