PSA/ee/docs/guides/workflows/workflow-import-export.md
Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

2.7 KiB
Raw Permalink Blame History

Workflow Import/Export (Workflow Bundle v1)

This guide documents Alga PSA Workflow Runtime V2s file-based import/export format for workflows: the workflow bundle.

Bundle file

  • Filename: workflow-bundle.json (convention)
  • Media type: application/json
  • Canonical encoding: see Canonical JSON

Format header

Top-level required fields:

  • format: must be exactly alga-psa.workflow-bundle
  • formatVersion: must be exactly 1 (no automatic migration)
  • exportedAt: ISO-8601 timestamp of when the bundle was generated
  • workflows: array of one or more workflow entries

Stable workflow identifier (key)

Each workflow entry has a required, portable identifier:

  • workflows[].key (string)
  • Recommended: DNS-like names (e.g. system.email-processing)
  • Expected pattern: ^[a-z0-9][a-z0-9._-]*$

This key is distinct from the database workflow_id and is the identity used for import create/upsert behavior.

Workflow entry shape

Each workflows[] entry contains:

  • metadata: name/description and operational settings required for behavioral fidelity
  • dependencies: derived summary of required actions/node types/schema refs
  • draft: draft version number + draft workflow definition JSON
  • publishedVersions: zero or more published versions (each includes definition JSON and a payload schema snapshot if present)

The machine-checkable schema lives at ee/docs/schemas/workflow-bundle.v1.schema.json.

Canonical JSON

Exports are written using canonical JSON rules to produce stable bytes suitable for diffs and round-trip tests:

  • Recursively sort all object keys lexicographically
  • Two-space indentation
  • Trailing newline at end of file

Dependencies

workflows[].dependencies is a best-effort summary derived from included workflow definitions. Import uses this to report missing runtime registrations (actions/node types/schema refs) in a structured way.

Import semantics (v1)

Import runs all database writes in a single transaction and rolls back on any error.

Create/upsert policies:

  • Create-only (default): if a workflow with the same key already exists, import fails.
  • Force overwrite (opt-in): if force=true, import overwrites the existing workflow (matched by key) in place, preserving workflow_id. Published versions are replaced to match the bundle.

Fidelity scope (v1)

Import/export aims to preserve functional workflow behavior and operational settings (draft + published versions + trigger + payload schema configuration + operational flags).

Not preserved:

  • Audit fields (created_at, updated_at, published_at, actor ids)
  • Database ids (including version ids); workflow_id is generated when creating new workflows (and preserved when overwriting by key)