How dimfeld/ergo works
Ergo is a low-code automation service: users configure tasks, triggers, inputs, and actions in the Svelte UI; incoming or scheduled events are queued, applied to task logic, and dispatched to actions, with execution logs and optional notifications. The backend also supports JavaScript, state-machine and DAG-style task logic, templates, HTTP and local-command actions, and account-linked actions. Paths and relationships are based on the supplied tree, README, and sampled excerpts; unsampled subsystem wiring is shown only where documented or evident from the runtime entry points.
Main entry points: lib.rs Apply task input · server.rs HTTP server · execute.rs Action executors · queue.rs Input queue
Components 23
Configuration UI
- Task editor
web/src/routes/tasks/+page.svelte - Workflow editors
web/src/lib/editors/dataflow/DataFlow.svelte - API client
web/src/lib/api.ts
API and triggers
- HTTP server
api/server.rs - Authentication
auth/lib.rs - Task routes
api/routes/tasks.rs - Input routes
api/routes/inputs.rs
Task execution
- Periodic triggers
tasks/periodic.rs - Input queue
tasks/inputs/queue.rs - Apply task input
tasks/lib.rs - State machines
tasks/state_machine.rs - DAG workflows
tasks/dataflow/run.rs - Action queue
tasks/actions/queue.rs - Action dispatch
tasks/actions/dequeue.rs - Action executors
tasks/actions/execute.rs
Runtime services
- JavaScript runtime
tasks/scripting/runtime.rs - V8 engine
js/lib.rs - PostgreSQL
database/pool.rs - Redis
database/redis.rs - Notifications
notifications/lib.rs
Other components
- Operator
- Event caller
- HTTP services
Connections 26
- Operator → Task editor: configures
- Task editor → Workflow editors: edits workflows
- Task editor → API client: requests data
- API client → HTTP server: calls API
- Event caller → HTTP server: sends event
- HTTP server → Authentication: authenticates
- HTTP server → Task routes: dispatches
- HTTP server → Input routes: dispatches
- Task routes → PostgreSQL: reads/writes
- Input routes → Input queue: enqueues input
- Periodic triggers → Input queue: enqueues scheduled
- Input queue → Redis: stores jobs
- Input queue → Apply task input: dequeues input
- Apply task input → PostgreSQL: loads and logs
- Apply task input → State machines: applies trigger
- Apply task input → DAG workflows: runs workflow
- Apply task input → Action queue: enqueues actions
- Action queue → Redis: stores jobs
- Action queue → Action dispatch: dequeues actions
- Action dispatch → Action executors: dispatches
- Action executors → JavaScript runtime: runs scripts
- JavaScript runtime → V8 engine: evaluates JavaScript
- Action executors → HTTP services: calls HTTP
- Action executors → PostgreSQL: records results
- Apply task input → Notifications: notifies outcomes
- Notifications → HTTP services: sends webhook