Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Feature ID: FW-45
Status: ✅ Implemented
Spec: FW-45-decision-tables.md
Last Updated: 2026-03-16

Overview

FW-45 introduces configurable decision tables for workflow and rule evaluation use cases. The feature integrates with Platform Foundation tenancy and permissions, and with existing Forms & Workflow modules for condition evaluation, workflow execution, and version-safe runtime behavior.

Integration Points (from Spec)

DependencyPatternPurpose
PF-01 (Organizations)Platform dependencyEnforce tenant isolation through organization_id on all records and queries.
PF-02 (Auth/Permissions)Platform dependencyGate access with fw.decision_tables.view and fw.decision_tables.manage.
FW-17 (Advanced Condition Builder)Intra-core registry integrationRegister decision_table condition type for rule-based conditions.
FW-06 (Advanced Workflow Builder)Intra-core registry integrationRegister decision node type that evaluates table versions at runtime.
FW-03 (Automation Engine)Intra-core runtime integrationExecute table evaluation during automation sequences and record outputs.
FW-07 (Workflow Versioning)Intra-core snapshot integrationStore decision table version bindings in workflow version snapshots.

Scheduled Processing Contract

JobScheduleInputOutputNotes
fw-rule-evaluation-cleanup0 3 * * *organization_id, retention days from fw_module_settingsDeleted stale rows countCleanup is scoped by organization and uses configured retention limits.

Event / API Contracts

  • Edge Function: evaluate-decision-table — ✅ Implemented
    • Request: tableId, facts, optional versionId, optional evaluation_context (workflow_step | form_validation | api_request), optional source_execution_id, source_step_id.
    • Response: success, matched, matchedRuleCount, outputs, evaluationId, versionNumber, hitPolicy, correlationId, optional error.
    • Auth: validateAuth() + verifyOrgAccess() via _shared/auth.ts.
    • Audit: Writes via fw_log_decision_table_evaluation RPC under user auth context. Failures are non-fatal (logged, not returned as errors).
  • Persistence Contract:
    • Writes audit entries to fw_rule_evaluations for server-side evaluations only.
    • Client-side test mode does not write audit rows.

Security and Tenant Isolation

  • All mutations and reads are tenant-scoped with organization_id.
  • RLS is enabled on fw_decision_tables, fw_decision_table_versions, and fw_rule_evaluations.
  • Permission checks enforce least-privilege access for view/manage operations.