
OSAPI Orchestrator
A Go package for orchestrating operations across OSAPI-managed hosts --
typed operations, chaining, conditions, and result decoding built on top
of the osapi-sdk engine.
π¦ Install
go install github.com/osapi-io/osapi-orchestrator@latest
As a library dependency:
go get github.com/osapi-io/osapi-orchestrator
π― Targeting
Most operations accept a target parameter to control which agents receive
the request:
| Target |
Behavior |
_any |
Send to any available agent (load balanced) |
_all |
Broadcast to every agent |
hostname |
Send to a specific host |
key:value |
Send to agents matching a label |
βοΈ Operations
101 typed constructors across 23 domains:
β¨ Features
The orchestrator provides a declarative DSL for composing operations into
DAG-based plans with typed results, guards, retry, and discovery.
| Feature |
Description |
| Step Chaining |
Sequential and parallel DAG execution |
| Guards |
Conditional execution (When, OnlyIfChanged...) |
| Error Recovery |
Continue strategy with OnlyIfFailed cleanup |
| Broadcast |
Per-host results from _all/label targets |
| Host Status |
Skipped and failed detection per host |
| Retry |
Automatic retry with exponential backoff |
| Discovery |
Find agents by OS, arch, labels, conditions |
| File Workflow |
Upload, deploy, drift detection, undeploy |
| Result Decode |
Typed struct decoding from step results |
| TaskFunc |
Custom logic with access to prior results |
See the DSL reference for guards, predicates, error
strategies, and typed result tables.
π Documentation
See the package documentation on pkg.go.dev for API details.
π Examples
Runnable examples in examples/operations/ (per-domain
workflows) and examples/features/ (DSL features). Run
with:
OSAPI_TOKEN="<jwt>" go run examples/features/basic.go
π€ Contributing
See the Development guide for prerequisites, setup,
and conventions. See the Contributing guide before
submitting a PR.
π License
The MIT License.