A demonstration of true multi-agent orchestration using Temporal workflows in Golang. This system showcases the difference between sequential skills (human-orchestrated) and autonomous multi-agent systems.
- 4 Parallel Review Agents: Security, Style, Logic, and Documentation agents run simultaneously
- 1 Synthesis Agent: Aggregates results after parallel agents complete
- Real-time Dashboard: Visualizes agent progress using Server-Sent Events (SSE)
- GitHub Webhook Integration: Autonomous workflow triggering
- Temporal Orchestration: No human intervention required
GitHub Webhook → Service → Temporal Workflow
↓
Event Bus (in-memory)
↓
Dashboard (SSE) ← Browser
Components:
- Temporal Workflow - Orchestrates parallel agents
- Activity Agents - Security, Style, Logic, Docs, Synthesis
- Dashboard - SSE-based real-time UI
- Webhook Handler - Receives PR events, starts workflows
- Event Bus - In-memory pub/sub for progress updates
- Docker & Docker Compose
- Go 1.22+
docker-compose upWait ~30 seconds for Temporal to initialize. You should see:
- Temporal UI: http://localhost:8080
- Dashboard: http://localhost:8081
- Webhook: http://localhost:8082
Using the demo script:
./trigger-demo.shOr manually:
curl -X POST http://localhost:8082/webhook/pr \
-H "Content-Type: application/json" \
-d '{
"action": "opened",
"number": 123,
"repository": {
"owner": {"login": "example"},
"name": "test-repo"
},
"pull_request": {
"number": 123,
"title": "Test PR",
"diff_url": "https://github.com/example/test-repo/pull/123.diff"
}
}'The response includes a dashboard_url. Open it to watch:
- 4 agents turn blue simultaneously (parallel execution)
- Progress bars animate 0→100%
- Agents turn green upon completion
- Synthesis agent starts after others complete
- Total time: ~15-20 seconds
Open http://localhost:8080 and navigate to the workflow to see:
- Activity timeline showing parallel execution
- 4 activities overlapping in time graph
temporal-code-reviewer/
├── activities/ # Agent implementations
│ ├── security_agent.go
│ ├── style_agent.go
│ ├── logic_agent.go
│ ├── docs_agent.go
│ └── synthesis_agent.go
├── dashboard/ # Real-time UI
│ ├── server.go
│ ├── templates/
│ │ └── index.html
│ └── static/
│ ├── app.js
│ └── style.css
├── events/ # Event bus
│ └── bus.go
├── types/ # Shared types
│ └── types.go
├── webhook/ # GitHub integration
│ └── handler.go
├── workflows/ # Temporal orchestration
│ └── pr_review.go
├── main.go # Service entry point
├── docker-compose.yml # Infrastructure
├── Dockerfile # Service container
└── trigger-demo.sh # Demo trigger script
- Webhook Trigger: GitHub sends PR event to
/webhook/pr - Workflow Start: the service starts a Temporal workflow
- Parallel Agents: 4 review agents execute simultaneously
- Security (5s): Checks for vulnerabilities
- Style (5-7s): Reviews code formatting
- Logic (8-10s): Validates correctness
- Documentation (6-8s): Checks docs
- Synthesis: Aggregates all results (3-5s)
- Complete: Final review summary generated
- Activities publish events to the event bus
- Dashboard subscribes via SSE
- Real-time updates stream to browser
- Progress tracked with heartbeats
go build -o temporal-code-reviewer .- Start Temporal (requires separate setup)
- Set environment variable:
export TEMPORAL_ADDRESS=localhost:7233 - Run the service:
./temporal-code-reviewer
go test ./...This implementation follows Temporal workflow determinism rules:
- ✅ Uses
workflow.Now(ctx)instead oftime.Now() - ✅ All external calls are activities
- ✅ Activities record heartbeats for long operations
- ✅ Proper timeout and retry configurations
- ✅ Event-driven progress tracking
- Docker Compose starts full stack
- Dashboard loads at http://localhost:8081
- Webhook triggers workflow successfully
- Dashboard shows 4 agents running in parallel
- Progress bars update smoothly in real-time
- Synthesis agent starts only after all 4 complete
- Temporal UI shows parallel activity execution
- Total execution time: 15-20 seconds
# Terminal 1: Start services
docker-compose up
# Terminal 2: Trigger review
./trigger-demo.sh
# Browser: Open dashboard URL (from trigger response)
# Watch: Parallel agents → synthesis → complete
# Temporal UI: http://localhost:8080
# Verify: Activity timeline shows parallelismEdit the sleep durations in activities/*_agent.go:
time.Sleep(1 * time.Second) // Adjust per agent- Create
activities/my_agent.go - Register in
main.go - Add to workflow parallel execution
- Update dashboard UI
- UI:
dashboard/templates/index.html - Styling:
dashboard/static/style.css - Logic:
dashboard/static/app.js
Temporal won't start:
- Wait 30 seconds for initialization
- Check PostgreSQL is running:
docker ps - Check logs:
docker-compose logs temporal
Dashboard not updating:
- Check browser console for SSE errors
- Verify workflow ID in URL matches running workflow
- Check event bus is receiving events
Activities not executing:
- Verify worker is registered: check logs
- Ensure activity names match workflow calls
- Check Temporal UI for activity failures
MIT
Built with:
- Temporal - Workflow orchestration
- Go - Backend language
- Server-Sent Events - Real-time updates