[Feature] Add scoped Workflow templates, reuse, and governed start triggers #6

Closed
opened 2026-07-28 14:03:00 +02:00 by zemion · 5 comments
Owner

Parent: #5

Apply the same governed definition and trigger model to Workflow while preserving Workflow-owned runtime and effect semantics.

Acceptance criteria:

  • definitions support system/tenant/group/user scope, flow/template kind, inheritance, reuse, and start grants
  • templates are reusable graph definitions but cannot be activated or started
  • derivation pins source revision/hash and exposes complete Policy provenance; ancestor changes require explicit review
  • start origins distinguish user, API, schedule, event, parent workflow, dependency, retry/replay, and backfill
  • scheduled/event triggers cannot start until an active runtime revision and current automation principal are available
  • inherited definitions are read-only unless derived into an editable local definition
  • runtime permission guards, action effects, correlation/causation, audit, and manual recovery remain owned by Workflow
  • module actions and nested workflows use versioned capabilities, never optional implementation imports
Parent: https://git.add-ideas.de/GovOPlaN/govoplan-workflow/issues/5 Apply the same governed definition and trigger model to Workflow while preserving Workflow-owned runtime and effect semantics. Acceptance criteria: - definitions support system/tenant/group/user scope, flow/template kind, inheritance, reuse, and start grants - templates are reusable graph definitions but cannot be activated or started - derivation pins source revision/hash and exposes complete Policy provenance; ancestor changes require explicit review - start origins distinguish user, API, schedule, event, parent workflow, dependency, retry/replay, and backfill - scheduled/event triggers cannot start until an active runtime revision and current automation principal are available - inherited definitions are read-only unless derived into an editable local definition - runtime permission guards, action effects, correlation/causation, audit, and manual recovery remain owned by Workflow - module actions and nested workflows use versioned capabilities, never optional implementation imports
Author
Owner

Governed definition slice implemented in govoplan-core@26ae034, govoplan-policy@d6e09fb, and govoplan-workflow@1ec8336.

Completed:

  • system/tenant/group/user scope and flow/template kind
  • reusable templates that cannot activate/start
  • pinned derivation with source revision/hash, node-library version, actor, Policy decision, and transitive ancestor limits
  • inherited read-only editor behavior and explainable provenance
  • user, API, schedule, event, and parent/dependency start-node contracts
  • UI explicitly reports that automatic instance dispatch is unavailable rather than implying execution

Remaining before closure:

  • Workflow instance runtime and durable start dispatch under govoplan-workflow#5
  • effect runner, retries/manual recovery/compensation under govoplan-workflow#1
  • current automation-principal and durable event integration before enabling scheduled/event starts

Verification: 13 Workflow tests, WebUI typecheck, migrations, and consolidated focused suite pass.

Governed definition slice implemented in govoplan-core@26ae034, govoplan-policy@d6e09fb, and govoplan-workflow@1ec8336. Completed: - system/tenant/group/user scope and flow/template kind - reusable templates that cannot activate/start - pinned derivation with source revision/hash, node-library version, actor, Policy decision, and transitive ancestor limits - inherited read-only editor behavior and explainable provenance - user, API, schedule, event, and parent/dependency start-node contracts - UI explicitly reports that automatic instance dispatch is unavailable rather than implying execution Remaining before closure: - Workflow instance runtime and durable start dispatch under govoplan-workflow#5 - effect runner, retries/manual recovery/compensation under govoplan-workflow#1 - current automation-principal and durable event integration before enabling scheduled/event starts Verification: 13 Workflow tests, WebUI typecheck, migrations, and consolidated focused suite pass.
Author
Owner

Codex State: progress

Scoped definitions, templates, inheritance/derivation, governed manual/API starts, immutable runtime revisions, and the automation principal contract are implemented. The new Core action/effect contract also removes the contract-design dependency.

Remaining before closure:

  • durable schedule and event trigger dispatch;
  • current automation-principal resolution at dispatch time;
  • parent/dependency/retry/backfill dispatch wiring;
  • generic action/effect runner integration and manual recovery under #5.

No product decision is needed; these are implementation slices.

## Codex State: progress Scoped definitions, templates, inheritance/derivation, governed manual/API starts, immutable runtime revisions, and the automation principal contract are implemented. The new Core action/effect contract also removes the contract-design dependency. Remaining before closure: - durable schedule and event trigger dispatch; - current automation-principal resolution at dispatch time; - parent/dependency/retry/backfill dispatch wiring; - generic action/effect runner integration and manual recovery under #5. No product decision is needed; these are implementation slices.
Author
Owner

Codex State: progress

Summary

  • Definitions now distinguish immutable execution mode from instance start origin (user, api, schedule, event, parent/dependency, retry/replay, and backfill).
  • Automated starts require explicit definition permission and an automation principal; guided definitions reject non-user starts.
  • Module actions use versioned capabilities with correlation, causation, previewed effects, idempotency, and manual recovery without optional implementation imports.
  • Scoped derivation preserves the pinned execution mode and Workflow View revision.

Next / Blocked

  • Persisted schedule/event trigger registrations and their dispatcher are still outstanding; the start-origin/runtime contract is ready for that slice.
## Codex State: progress ### Summary - Definitions now distinguish immutable execution mode from instance start origin (`user`, `api`, `schedule`, `event`, parent/dependency, retry/replay, and backfill). - Automated starts require explicit definition permission and an automation principal; guided definitions reject non-user starts. - Module actions use versioned capabilities with correlation, causation, previewed effects, idempotency, and manual recovery without optional implementation imports. - Scoped derivation preserves the pinned execution mode and Workflow View revision. ### Next / Blocked - Persisted schedule/event trigger registrations and their dispatcher are still outstanding; the start-origin/runtime contract is ready for that slice.
Author
Owner

Architecture update: scoped templates/reuse and governed starts become Workflow Engine behavior. Module-owned immutable baselines plus local override/update/reset semantics are tracked separately in #13. The optional Workflow module supplies their editor and visual provenance UI.

Architecture update: scoped templates/reuse and governed starts become Workflow Engine behavior. Module-owned immutable baselines plus local override/update/reset semantics are tracked separately in #13. The optional Workflow module supplies their editor and visual provenance UI.
Author
Owner

Codex State: done

Summary

  • Completed scoped templates/derivation and governed start behavior with pinned provenance, current automation-principal rechecks, durable one-time/interval and platform-event triggers, parent-workflow starts, and exact idempotent revisions. Dependency/retry/replay/backfill remain explicit governed start origins.
  • Pushed in Workflow Engine as GovOPlaN/govoplan-workflow-engine@a1cea1d.

Changed Files

  • ../govoplan-workflow-engine/src/govoplan_workflow_engine/backend/triggers.py
  • ../govoplan-workflow-engine/tests/test_triggers.py
  • ../govoplan-workflow-engine/docs/CONCEPT.md

Verification

  • Workflow Engine suite passed (61 tests), including schedule replay, event delivery, parent starts, authority loss, and durable waits.
  • All manifest, dependency-boundary, and module-permutation gates passed.
## Codex State: done ### Summary - Completed scoped templates/derivation and governed start behavior with pinned provenance, current automation-principal rechecks, durable one-time/interval and platform-event triggers, parent-workflow starts, and exact idempotent revisions. Dependency/retry/replay/backfill remain explicit governed start origins. - Pushed in Workflow Engine as GovOPlaN/govoplan-workflow-engine@a1cea1d. ### Changed Files - `../govoplan-workflow-engine/src/govoplan_workflow_engine/backend/triggers.py` - `../govoplan-workflow-engine/tests/test_triggers.py` - `../govoplan-workflow-engine/docs/CONCEPT.md` ### Verification - `Workflow Engine suite passed (61 tests), including schedule replay, event delivery, parent starts, authority loss, and durable waits.` - `All manifest, dependency-boundary, and module-permutation gates passed.`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-workflow#6