Feature ID: FW-45Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
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)
| Dependency | Pattern | Purpose |
|---|---|---|
| PF-01 (Organizations) | Platform dependency | Enforce tenant isolation through organization_id on all records and queries. |
| PF-02 (Auth/Permissions) | Platform dependency | Gate access with fw.decision_tables.view and fw.decision_tables.manage. |
| FW-17 (Advanced Condition Builder) | Intra-core registry integration | Register decision_table condition type for rule-based conditions. |
| FW-06 (Advanced Workflow Builder) | Intra-core registry integration | Register decision node type that evaluates table versions at runtime. |
| FW-03 (Automation Engine) | Intra-core runtime integration | Execute table evaluation during automation sequences and record outputs. |
| FW-07 (Workflow Versioning) | Intra-core snapshot integration | Store decision table version bindings in workflow version snapshots. |
Scheduled Processing Contract
| Job | Schedule | Input | Output | Notes |
|---|---|---|---|---|
fw-rule-evaluation-cleanup | 0 3 * * * | organization_id, retention days from fw_module_settings | Deleted stale rows count | Cleanup is scoped by organization and uses configured retention limits. |
Event / API Contracts
- Edge Function:
evaluate-decision-table— ✅ Implemented- Request:
tableId,facts, optionalversionId, optionalevaluation_context(workflow_step|form_validation|api_request), optionalsource_execution_id,source_step_id. - Response:
success,matched,matchedRuleCount,outputs,evaluationId,versionNumber,hitPolicy,correlationId, optionalerror. - Auth:
validateAuth()+verifyOrgAccess()via_shared/auth.ts. - Audit: Writes via
fw_log_decision_table_evaluationRPC under user auth context. Failures are non-fatal (logged, not returned as errors).
- Request:
- Persistence Contract:
- Writes audit entries to
fw_rule_evaluationsfor server-side evaluations only. - Client-side test mode does not write audit rows.
- Writes audit entries to
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, andfw_rule_evaluations. - Permission checks enforce least-privilege access for view/manage operations.