Feature ID: FW-56Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Spec:
specs/fw/specs/FW-56-workflow-execution-replay-time-travel.mdStatus: π Planned
Owner Core: FW (Forms & Workflow)
Purpose
Defines integration contracts for read-only historical replay of workflow executions using FW-48 step checkpoints, what-if forks into FW-24 sandbox executions, comparison of two runs of the same workflow, and single-execution export (JSON/PDF) aligned with FW-43 retention posture.Integration Matrix
| Dependency | Type | Direction | Contract Summary |
|---|---|---|---|
| FW-22 Execution Monitoring | Intra-core UI | FW β FW | Execution detail shell, list entry points; replay mode/tab; replaces stub replay |
| FW-48 Step Checkpointing | Data | FW β FW | fw_execution_steps ordered timeline, input_data/output_data, gateway metadata |
| FW-24 Sandbox | Runtime / Data | FW β FW | fw_sandbox_executions extended with what_if + fork columns; sandbox-execute |
| FW-06 Workflow Builder | UI | FW β FW | Canvas read + node highlight by node_id |
| FW-18 Variables | Domain | FW β FW | Variable naming and merge semantics at fork |
| FW-43 Audit Trail | Compliance | FW β FW | Export/redaction alignment; retention messaging |
| PF-04 Audit | Platform | FW β PF | Optional logAuditEvent for replay open / export |
| PF-46 Data Retention | Platform | FW β PF | Block export when underlying rows purged |
Data Contracts
Replay bundle query
Inputs:execution_id, organization_idReads:
fw_workflow_executions(single row, tenant filter)fw_execution_stepsβSELECT * WHERE execution_id = ? AND organization_id = ? ORDER BY step_index ASC, attempt_number ASC- Optional
fw_execution_logsβ filterexecution_id, ascending time
execution,steps[],logs[]for UI layers
What-if fork write
Table:fw_sandbox_executionsRequired fields (minimum):
organization_id,rule_id(from source execution),execution_type = 'what_if'forked_from_execution_id,forked_from_step_idmodified_variables(JSON object)input_dataβ deterministic merge (spec FR-3.4): shallow copyfw_workflow_executions.variables; for eachfw_execution_stepsrow in order through the fork step (inclusive), shallow-merge that stepβsoutput_datainto the accumulator; then shallow-mergemodified_variables; result =input_datafor the sandbox row.
sandbox-execute edge function (or equivalent RPC) with sandbox row id after insert.
Comparison query
Inputs:execution_id_a, execution_id_b, organization_idPrecondition: Both rows share the same
rule_id (client + server validation).Reads: Two step lists; align by
step_index for divergence detection.
Export
MVP: Client-assembled JSON download from replay bundle; PDF via jsPDF.Redaction: Sanitize all
error_message fields via sanitizeErrorMessage before serialization; variable bodies match on-screen replay (spec FR-5.3).No new storage bucket required unless product later moves to signed URLs (defer).
Workflow definition for canvas
- If
fw_workflow_executions.workflow_versionis set: loadfw_workflow_definitionswhere(rule_id, version)matches. - If null: load the row with maximum
versionforrule_id+ org; show UI banner that layout may differ from run-time graph (spec FR-2.1).
API / Edge Contracts
| Endpoint / path | Role |
|---|---|
sandbox-execute | Existing FW-24 executor; extended payload may include fork metadata (verify function accepts execution_type / fork ids) |
| Supabase REST/RPC | Reads use standard client with RLS; inserts to fw_sandbox_executions respect fw_has_sandbox_access |
Security & Tenancy
- All queries:
.eq('organization_id', orgId)in application code in addition to RLS. - Permission:
fw.workflow-executions.replayfor replay UI, compare, what-if launch, single-execution export (see spec). - No PHI in audit payloads β identifiers only.
Consumer Notes
- FW-22: Remove or bypass client-only replay simulation in
ExecutionDetailDialog.handleReplayonce FW-56 ships. - FW-48: If step retention deletes rows, replay must show empty state with explanation (link to FW settings / retention doc).
Revision History
| Date | Change |
|---|---|
| 2026-03-22 | Initial integration doc from spec workflow |
| 2026-03-22 | Resolved: fork merge (FR-3.4), export redaction (FR-5.3), definition version selection (FR-2.1) |