How work-frame/goflow works
GoFlow is a background-job platform. Users submit and manage jobs through the CLI or web dashboard; the API persists them, relays queued work to Redis, and workers claim and execute jobs, recording completion, retry, or dead-letter outcomes. Separate capabilities include account/session management, live status events, metrics, and signed webhook delivery with recorded attempts. The README documents these product flows; sampled entry points and the source index support the service wiring, but several internal API and storage details were not sampled.
Main entry points: api.go HTTP API · worker.go Worker pool · deliver.go Webhook delivery · jobs.go Job storage
Components 22
User access
- CLI
internal/cli/cli.go - API client
internal/client/client.go - Dashboard
internal/web/static/app.js - Web host
internal/web/web.go
API service
- HTTP API
internal/api/api.go - Accounts and sessions
internal/api/auth.go
Job lifecycle
- Job model
internal/job/job.go - Job storage
internal/database/jobs.go - Outbox relay
internal/relay/relay.go - Redis queue
internal/queue/queue.go - Worker pool
internal/worker/worker.go - Work and leases
internal/database/work.go
Live operations
- Live events
internal/events/publisher.go - Event streams
internal/events/hub.go - Metrics
internal/metrics/metrics.go
Webhook delivery
- Webhook secrets
internal/database/webhooks.go - Webhook delivery
internal/webhook/deliver.go - Egress policy
internal/egress/policy.go
Other components
- User
- Webhook receiver
cmd/receiver/main.go - PostgreSQL
- Redis
Connections 27
- User → CLI: runs
- CLI → API client: calls
internal/cli/cli.go - User → Dashboard: uses
README.md - Dashboard → Web host: served by
README.md - API client → HTTP API: HTTP requests
internal/client/client.go - Web host → HTTP API: accesses
- HTTP API → Accounts and sessions: handles auth
- HTTP API → Job model: manages jobs
- HTTP API → Job storage: persists jobs
README.md - Job storage → PostgreSQL: reads and writes
README.md - HTTP API → Outbox relay: wakes relay
README.md - Outbox relay → Redis queue: enqueues IDs
README.md - Redis queue → Redis: stores work
README.md - Worker pool → Redis queue: takes jobs
internal/worker/worker.go - Worker pool → Work and leases: claims and records
README.md - Work and leases → PostgreSQL: leases jobs
README.md - Worker pool → Job model: routes job types
internal/worker/worker.go - Worker pool → Webhook delivery: runs webhook jobs
README.md - HTTP API → Live events: publishes changes
- Live events → Event streams: feeds streams
- HTTP API → Metrics: exposes metrics
README.md - Webhook delivery → Egress policy: checks destinations
README.md - Webhook delivery → Webhook secrets: uses signing secrets
internal/database/webhooks.go - Webhook delivery → Webhook receiver: sends signed POST
README.md - HTTP API → Webhook secrets: rotates secrets
- HTTP API → Job storage: lists attempts
- Webhook secrets → PostgreSQL: stores encrypted data
internal/database/webhooks.go