Skip to main content
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)


Scheduled Processing Contract


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.