Glink is a lightweight, event-bus-driven workflow orchestration engine designed for AI agent teams. Think of it as a conductor for your AI agents — each agent plays its part, and Glink ensures the symphony runs on time.
Most AI agents work in isolation. Glink breaks that pattern with a Main Bus shared-blackboard architecture — agents write results to a common bus, and the next agent reads, processes, and writes back. No direct agent-to-agent coupling, no single point of failure.
┌──────────────────────────────────────────────────┐
│ Glink Engine │
│ │
│ Agent A ──► Main Bus ──► Agent B ──► Agent C │
│ │
│ ┌──────────── Shared Checkpoint ────────────┐ │
│ │ Parallel / Sequential / Conditional Steps │ │
│ └────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────┘
# Clone
git clone https://github.com/opprime/glink
cd glink
# Start in serve-only mode (API only, no workflow execution)
python3 glink-daemon.py my-project --serve
# In another terminal, submit a workflow
curl -X POST http://127.0.0.1:8426/workflow/run \
-H "Content-Type: application/json" \
-H "X-API-Key: your-key" \
-d '{
"project": "hello-world",
"steps": [
{"step": 1, "agent": "agent-a", "task": "Say hello"}
]
}'
# Check workflow status
curl http://127.0.0.1:8426/status/project| Component | Role |
|---|---|
| Main Bus | Append-only JSONL event log. All agents read/write here |
| Daemon API | HTTP server — submit workflows, check status, read events |
| Core Engine | Step executor — sequential, parallel, review modes |
| Checkpoint | Crash recovery — track step progress with SHA256 checksums |
| Reporter | Optional notification — console, or webhook (e.g. Feishu) |
- ✅ Bus-driven orchestration — event bus as shared state, no direct agent coupling
- ✅ Sequential & parallel execution — DAG-based step resolution
- ✅ Crash recovery — SHA256-verified checkpoints, auto-restart from last completed step
- ✅ Path traversal protection —
_safe_project_path()prevents directory escape - ✅ Concurrency safety —
LOCK_SH/LOCK_EXon checkpoint files, ThreadingHTTPServer - ✅ Token authentication — Bearer token via
GLINK_API_TOKENenv var - ✅ Task enrichment — inject context from bus before dispatching to agents
- ✅ Reporter abstraction — console, feishu webhook, or custom reporter plugin
See glink-config.yaml for all options:
server:
host: "127.0.0.1"
port: 8426
bus:
dir: "bus"
retention_days: 30
reporting:
- type: consoleWorkflows are YAML files specifying agent steps. Example:
name: my-workflow
steps:
- step: 1
agent: search-agent
task: "Search for top-rated coffee shops in Shanghai"
- step: 2
agent: code-agent
task: "Convert search results to JSON"
- step: 3
agent: frontend-agent
task: "Build an HTML card page from JSON"
after: [1]| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /workflow/run |
Submit a workflow for execution |
| GET | /status |
Engine status |
| GET | /status/project |
Latest completed project status |
| GET | /projects |
List all known project names |
| POST | /write |
Write an event to the bus |
| GET | /events?project=X |
Stream events for a project |
- Token auth: Set
GLINK_API_TOKENenv var. All endpoints except/healthrequireAuthorization: Bearer <token>. - Path sanitization: All file paths are sanitized against directory traversal.
- Local binding: Defaults to
127.0.0.1— only accessible locally. - Checkpoint integrity: SHA256 checksums detect corrupted/incomplete writes.
- Safe file operations: Atomic
write-then-renamepattern, strict lock management.
# Install dev dependencies
pip install pytest
# Run tests
python3 -m pytest tests/
# Lint
pip install ruff
ruff check daemon/ bus/MIT
Built for agents, by agents. 🤖