FlowDoc: the interchange format

A FlowDoc is one JSON file per flow or module. It is Amazon Connect Flow language, extended with tokens and tool metadata that Connect ignores-by-removal at materialization time.

Structure

{
          "flowdoc": "0.1",
          "kind": "flow | module",
          "name": "inbound-main",
          "connectType": "CONTACT_FLOW | CUSTOMER_QUEUE | ... | MODULE",
          "content": { "Version": "2019-10-30", "StartAction": "...", "Actions": [ ... ] },
          "layout": { "<actionId>": { "x": 0, "y": 0 } },
          "refs": [ { "token": "${cdref:queue:front-desk}", "type": "queue", "name": "front-desk" } ],
          "meta": { "generator": "core@0.1", "sourceHash": "sha256:..." }
        }
        

Invariants

  1. Deterministic: same inputs, byte-identical FlowDoc (stable key order, stable action ordering).
  2. Lossless for unknown blocks: any Action not modeled by the builder is preserved verbatim (GenericBlock) through studio edits and codegen.
  3. sourceHash ties the FlowDoc to the builder file it was generated from, for the watch-mode dirty guard and the studio's conflict check.
  4. A reference token occupies an entire field value and is never interpolated into a longer string. Connect requires the fields that hold references to be "either fully static or a single valid JSONPath identifier", so a partially substituted value is invalid. See conformance/flow-language/actions.md.
  5. No more than 250 Actions per flow, and Identifiers are unique, at most 50 characters, and exclude the characters Connect reserves. Enforced by conformance/schema/flowdoc-0.1.schema.json.

Versioning

flowdoc: "0.1" until the builder API stabilizes. There is no migration code yet; every version bump ships a migration in @flow-as-code/core plus fixtures.

Contract artifacts