Pre-alpha. No tagged release and no upgrade path between versions. Use for evaluation and development only, not production.
Core DevPre-alpha

Events and cron

Event bus

Package: sumeru/core/event

In-process pub/sub for cross-module automation.

event.Subscribe("record.updated", func(ctx context.Context, ev event.Event) error {
    // ev.Payload["model"], ev.Payload["id"], ev.Payload["values"], …
    return nil
})
FieldMeaning
NameEvent name (e.g. record.created, record.updated, cron.tick)
PayloadModel name, record id, changed values, etc.
ActorUser id when applicable

ORM emits record.created and record.updated after successful commit (core/orm/crud_sideeffects.go).

Prefer runtime.Runtime for new code that publishes events in tests.

Transactional outbox

Package: sumeru/core/orm

CRUD mutations enqueue rows in sys.outbox.event in the same transaction. A background drain worker started from core/server/run.go (5s ticker) publishes pending events in batches of 100, marks them published, and publishes to the in-process queue (core/queue) for async consumers.

Use outbox events when downstream handlers must not run if the mutation rolls back.

Scheduler

Package: sumeru/core/scheduler

Started from core/server/run.go with a 1-minute default ticker.

  1. Selects due active sys.cron rows inside a transaction with FOR UPDATE SKIP LOCKED (safe for multiple Sumeru instances)
  2. Publishes cron.tick with cron metadata
  3. Publishes optional custom event_name from the cron row
  4. When sys.cron.code matches a handler registered via RegisterCronHandler, runs that Go function
  5. Updates next_call and last_call in the same transaction
scheduler.RegisterCronHandler("my_module.nightly_digest", func(ctx context.Context, payload map[string]interface{}) error {
    // payload includes cron row fields
    return nil
})

There is no Python/safe_eval — cron code must match a registered Go handler or serve as a lookup key only. CRM’s event.Subscribe("crm.cron_assign_leads") is not backed by a bundled sys.cron row; use Assign Leads on the team form, or seed your own cron if you need a schedule.

See Multi-instance cron for operational guidelines when running N replicas.

Automation addon

Path: sumeru/addons/automation/

Models:

ModelPurpose
sys.cronScheduled jobs
sys.server.actionEvent-triggered actions
sys.workflow.transitionWorkflow transitions (data model)

The automation subscriber listens to record.created, record.updated, and cron.tick. It matches active sys.server.action rows by event_name (and optional model filter), then executes declarative code:

Code prefixEffect
publish:Republish with the trigger event payload
write:ORM write on payload model/id (ACL bypass)

Unknown prefixes are logged at debug and skipped. See Events & automation for XML examples.

Example: business addon pattern

See sumeru_addons/sale_crm/init.go — subscribes to record.updated on crm.lead, creates a draft quotation when stage is Won.

See Events and hooks for addon conventions.

See also