Feature ID: FW-52Documentation 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: π Specification
Spec Reference: FW-52-workflow-import-export-portability.md
Last Updated: 2026-03-22
Overview
FW-52 adds portable JSON/YAML packages for workflow definitions with optional bundled forms (FW-01) and decision tables (FW-45). Export strips tenant UUIDs; import performs validation, dry-run analysis, conflict resolution, and transactional apply via a SECURITY DEFINER RPC. Automation rules are not bundled in Phase 1.Integration Points (from Spec)
| Dependency | Type | Purpose |
|---|---|---|
| FW-06 | FW | fw_workflow_definitions JSONB graph |
| FW-07 | FW | Version metadata for filenames / compatibility notes |
| FW-01 / PF-08 | Platform / FW | Form definitions in bundle |
| FW-45 | FW | Decision tables in bundle |
| PF-04 | Platform | logAuditEvent on successful import apply (workflow_import_applied) |
API / Edge Functions
| Slug | Method | Purpose |
|---|---|---|
fw-workflow-export | POST | Build export package; bundle?: boolean |
fw-workflow-import | POST | mode: 'dry_run' | 'apply' + payload + resolution map |
getCorsHeaders, verifyOrgAccess, createLogger; verify_jwt: true.
AuthZ: fw.workflows.export (export), fw.workflows.import (import/dry-run/apply).
Platform Integration Layer
| Layer | Usage |
|---|---|
@/platform/permissions | useHasPermission('fw.workflows.export') / import |
@/platform/audit | logAuditEvent after successful apply (see Β§Audit) |
Security and Tenant Isolation
- No PHI in packages or logs (definitions only).
- All DB writes scoped to
organization_id; RPC runs as SECURITY DEFINER with explicitp_organization_idchecks. - RLS on
fw_import_logsviafw_has_org_access+pf_has_permission.
UI Routes (canonical)
| Path | Permission | Purpose |
|---|---|---|
/fw/workflows/import | fw.workflows.import | Import wizard (upload β dry-run β resolve β apply) |
/fw/workflows/import/history | fw.workflows.view | Import history (fw_import_logs) |
src/routes/fw.tsx; labels in src/platform/navigation/route-labels.ts. Workflow export remains in-context on /fw/automations/:id/workflow (and other existing workflow surfaces).
Audit (PF-04)
On successful apply (client after RPC returns, or edge after RPC succeeds):logAuditEvent with action: 'workflow_import_applied', resource: 'fw_import_logs', module: 'fw', and count-only metadata (see spec FR-8.1). No cross-core event required for MVP.
Event Contracts
- None required for MVP (audit via
pf_audit_logsthroughlogAuditEvent).