Erp RFC 002 bpm workflow engine

ERPRFC002 — BPM / Workflow Engine

  • *tatus:*Stub
  • *ate:*20260412
  • *uthor:*Koder Team
  • *epends on:*erp-RFC-000-architecture-overview.md, kompass-RFC-001-identity-and-org-unification.md
  • *hase:*4 (BPM horizontal engine)
  • *locked by:*kompass-RFC-001 (identity must land first per the ERP track convention)
  • *locks:*fulllifecycle tramitação features in `erpRFC001 (licitação), erpRFC003 (travel), erpRFC004 (fiscal), erpRFC-005` (legal)

Summary

A dedicated Business Process Management engine with BPMN 2.0 process design, DMN decision tables, a workflow execution runtime, human task management with form rendering, SLA timers, escalation, digital signature integration, and tramitação — the "document and decision flowing between units with despachos and pareceres" pattern that defines Brazilian public and semi-public administration.

This is the horizontal engine that every vertical in the ERP track eventually consumes for its approval chains and long-running processes. Licitação uses it for the edital → proposta → contrato → execução flow. Travel uses it for solicitação → autorização → prestação de contas. Legal uses it for matter intake → triage → work → closing. HR uses it for admissão → onboarding → confirmation → offboarding. Fiscal uses it for closing cycles and audit workflows.

The engine is *istinct from platform/pipe* which orchestrates technical DAGbased data pipelines (DAG → cron → task → done). BPM is humanintheloop, stateful, multiday to multimonth, with forms and signatures. Pipe and BPM are complementary; neither substitutes the other.

Name decision

*eferred to the RFC itself when it is promoted from stub to draft.*Candidates to evaluate per meta/docs/stack/specs/naming/brand-score.kmd:

  • rumo (pt: "course, direction")
  • trama (pt: "weave, fabric of decisions")
  • loom (en: tear, weaves processes)
  • relay (en: hands off between stages)
  • cadere (latin: "to fall into place") — not to be confused with platform/cadence (music)
  • iter (latin: "path, journey")
  • via (latin: "way")

Hard filters: must not collide with platform/flow (git hosting), platform/pipe (data pipelines), platform/cadence (music), platform/orbit (social), platform/cron (scheduling). Must score Brand ≥ 60 (engine target). Must not read as a generic descriptor (so workflow, process, proc are out).

Scope

In scope (MVP)

  • *PMN 2.0 process designer*— visual diagrammer for pools, lanes, start/end events, user tasks, service tasks, exclusive and parallel gateways, intermediate events, timers, error boundary events. Webbased canvas. Output is standardscompliant BPMN XML that round-trips with external tools.
  • *xecution runtime*— stateful token-based engine that advances process instances through the diagram, persists state to KDB, handles retries and compensations.
  • *MN 1.3 decision tables*— declarative decision rules for automated branching. Decision tables are authored in a spreadsheet-like UI and invoked from service tasks or gateway conditions.
  • *ser task inbox*— per-person view of assigned tasks across all tenants, with filters (due soon, SLA risk, by process type, by tenant).
  • *orm rendering for user tasks*— tasks that need user input reference a Form from platform/form; the BPM engine embeds the rendered form and captures the response as task output.
  • *igital signature for tasks*— tasks that require formal approval delegate to platform/sign for ICP-Brasil or generic signature capture.
  • *LA timers and escalation*— declarative timers (duration or schedule) on any task; on timeout, the configured escalation action fires (reassign, notify, auto-decide per DMN).
  • *udit trail*— immutable event log of every state transition, input, output, and actor, per process instance.
  • *anban board view*— alternative presentation of workinprogress across process instances, grouped by stage, filtered by tenant and unit.
  • *ramitação primitive*— a document (any attached entity) moves between units with events: despacho, parecer, solicitação, deferimento, indeferimento. First-class modeling of the Brazilian administrative flow idiom.
  • *ulti-tenant isolation*— every process instance and definition is scoped to a Tenant from Kompass. User assignments resolve to Membership, not Person, so the same human can have different task queues in different tenants.

Out of scope (MVP)

  • *ata pipeline orchestration*— belongs to platform/pipe.
  • *gile issue tracking*(sprints, backlogs, velocity) — possibly a submodule of BPM later, possibly a separate module. Deferred.
  • *omplex event processing / CEP*— correlation of real-time events across many streams. Not part of BPM.
  • *obotic process automation (RPA)*— scripted UI automation against external web apps. A sibling tool, not BPM itself.
  • *MMN*(Case Management Model and Notation) — loose-flow case management as an alternative to BPMN's strict flow. Interesting but deferred; can be added later as a second process notation without rewriting the engine.

Dependencies

Dependency Used for Required day one
platform/kompass tenant, unit, role, membership — task assignment resolution yes
platform/id authentication yes
platform/kdb persistence of process definitions, instances, events, tasks yes
platform/form form rendering for user tasks yes
platform/sign signature capture on approval tasks yes for regulated processes
platform/kmail task notification yes
platform/cal SLA calendars and business-day calculations yes
platform/pipe optional systemtask delegation for technical subflows optional
`observe

Source: ../home/koder/dev/koder/meta/docs/stack/rfcs/erp-RFC-002-bpm-workflow-engine.md