Aller au contenu
SurfaceDocs
ENCommencer
DocsRéférence du Model

FlowComposition · types

Interfaces, valeurs et contrats nommés de FlowComposition.

Les types ci-dessous définissent les objets nommés et leurs relations. Les propriétés héritées sont incluses dans les tableaux. Les types dérivés d’un schéma renvoient à sa structure; une déclaration TypeScript ne remplace pas les contrôles sémantiques du compilateur.

FlowComposition

Explicit Model grammar for the existing canonical Flow engine’s composed extension.

export type FlowComposition = z.infer<typeof flowCompositionSchema>;

FlowCompositionStep

One referenced control or executable step, distinct from canonical parenthood and layout.

export type FlowCompositionStep = FlowComposition['steps'][number];
type FlowCompositionStep = { key: string; kind: "task"; workNodeKey: string; actionKey: string; inputs: Record<string, { kind: "input"; key: string; } | { kind: "input-node-id"; key: string; } | { kind: "field"; definitionPath: string; fieldKey: string; } | { kind: "literal"; value: string | number | boolean | null; } | { kind: "collection-item"; } | { kind: "collection-node-id"; } | { kind: "iteration-number"; } | { kind: "step-output"; stepKey: string; outputKey: string; }>; outputs: { key: string; type: "number" | "boolean" | "text" | "surface-reference" | "result-reference"; provenance: "caller" | "canonical" | "derived"; minimum: number; maximum: number; result: "outputs" | "reference" | "summary" | "decisions" | "nextSteps" | "blockers"; }[]; reservedCostUnits: number; maximumAttempts: number; } | { key: string; kind: "sequence"; steps: string[]; } | { key: string; kind: "choice"; mode: "exclusive" | "multiple"; branches: { key: string; stepKey: string; ruleKey: string; }[]; minimum: number; maximum: number; selection: "all-eligible" | "explicit"; confirmation: "required" | "not-required"; freshness: "captured" | "require-current"; join: { mode: "all"; remaining: "wait"; } | { mode: "quorum"; successes: number; remaining: "wait" | "request-cancel"; }; } | { key: string; kind: "parallel"; branches: { key: string; stepKey: string; }[]; maximumConcurrency: number; join: { mode: "all"; remaining: "wait"; } | { mode: "quorum"; successes: number; remaining: "wait" | "request-cancel"; }; } | { key: string; kind: "subflow"; blueprintKey: string; inputs: Record<string, { kind: "input"; key: string; } | { kind: "input-node-id"; key: string; } | { kind: "field"; definitionPath: string; fieldKey: string; } | { kind: "literal"; value: string | number | boolean | null; } | { kind: "collection-item"; } | { kind: "collection-node-id"; } | { kind: "iteration-number"; } | { kind: "step-output"; stepKey: string; outputKey: string; }>; } | { key: string; kind: "collection"; queryKey: string; parameters: Record<string, { kind: "input"; key: string; } | { kind: "input-node-id"; key: string; } | { kind: "field"; definitionPath: string; fieldKey: string; } | { kind: "literal"; value: string | number | boolean | null; } | { kind: "collection-item"; } | { kind: "collection-node-id"; } | { kind: "iteration-number"; } | { kind: "step-output"; stepKey: string; outputKey: string; }>; stepKey: string; maximumItems: number; maximumPages: number; maximumOutputBytes: number; maximumConcurrency: number; freshness: "captured" | "require-current"; join: { mode: "all"; remaining: "wait"; } | { mode: "quorum"; successes: number; remaining: "wait" | "request-cancel"; }; } | { key: string; kind: "iterate"; stepKey: string; stopRuleKey: string; maximumIterations: number; inputs: Record<string, { kind: "input"; key: string; } | { kind: "input-node-id"; key: string; } | { kind: "field"; definitionPath: string; fieldKey: string; } | { kind: "literal"; value: string | number | boolean | null; } | { kind: "collection-item"; } | { kind: "collection-node-id"; } | { kind: "iteration-number"; } | { kind: "step-output"; stepKey: string; outputKey: string; }>; } | { key: string; kind: "wait"; inputs: ({ key: string; minimum: number; maximum: number; type: "number" | "boolean" | "text"; provenance: "caller"; } | { key: string; minimum: number; maximum: number; type: "surface-reference" | "result-reference"; provenance: "canonical"; selector: { contract: "SurfaceFlowReferenceSelector@1"; queryKey: string; parameters: Record<string, { kind: "input"; key: string; } | { kind: "input-node-id"; key: string; } | { kind: "field"; definitionPath: string; fieldKey: string; } | { kind: "literal"; value: string | number | boolean | null; } | { kind: "collection-item"; } | { kind: "collection-node-id"; } | { kind: "iteration-number"; } | { kind: "step-output"; stepKey: string; outputKey: string; }>; }; })[]; arrival: "active-only"; ordering: "first-committed"; eventKey: string; recipient: "initiator"; timeoutMilliseconds: number; onExpiration: "fail" | "cancel"; } | { key: string; kind: "delay"; resume: { kind: "duration"; milliseconds: number; } | { kind: "instant"; at: number; }; };

FlowCompositionValueSource

Exact typed value mapping; arbitrary expressions, code and tool names are not admitted.

export type FlowCompositionValueSource = z.infer<typeof valueSource>;

FlowReferenceSelector

Exact Query and closed Flow bindings; the canonical Query service owns execution.

export type FlowReferenceSelector = z.infer<typeof referenceSelector>;

Toutes les références

Exemples appliqués : Préparer une soumission

Le Flow déclare les entrées Client et Besoin, une étape exécutable et un budget borné.

Configuration

Fragment à placer dans flowBlueprints[].composition. Propriétés et valeurs admises.

{
  "contract": "FlowComposition@1",
  "rootWorkNodeKey": "prepare-quote",
  "stateSurfaceDefinitionPath": "workspace/work/surface/preparation",
  "subflowLinkTypePath": null,
  "entryStepKey": "prepare",
  "inputs": [
    {
      "key": "client",
      "type": "surface-reference",
      "provenance": "caller",
      "minimum": 1,
      "maximum": 1
    },
    {
      "key": "need",
      "type": "text",
      "provenance": "caller",
      "minimum": 1,
      "maximum": 1
    }
  ],
  "contexts": [],
  "outputs": [],
  "steps": [
    {
      "key": "prepare",
      "kind": "task",
      "workNodeKey": "prepare",
      "actionKey": "prepare",
      "inputs": {},
      "outputs": [
        {
          "key": "proposal",
          "type": "result-reference",
          "provenance": "canonical",
          "minimum": 1,
          "maximum": 1,
          "result": "reference"
        }
      ],
      "reservedCostUnits": 1,
      "maximumAttempts": 1
    }
  ],
  "budgets": {
    "maximumDepth": 2,
    "maximumOccurrences": 20,
    "maximumConcurrency": 2,
    "maximumIterations": 3,
    "maximumDurationMilliseconds": 86400000,
    "maximumCostUnits": 100,
    "maximumStateBytes": 32000
  }
}

Variante et raccordement

Fragment à placer dans flowBlueprints[].composition.inputs. Propriétés et valeurs admises.

[
  {
    "key": "client",
    "type": "surface-reference",
    "provenance": "caller",
    "minimum": 1,
    "maximum": 1
  },
  {
    "key": "need",
    "type": "text",
    "provenance": "caller",
    "minimum": 1,
    "maximum": 1
  }
]

Exemple de disposition UI

La disposition illustrative ci-dessous situe cette configuration dans l’app Clients/Soumissions. Chaque fragment s’insère à l’emplacement indiqué; ses références aux Fields, Queries et Actions correspondent aux déclarations du Model.

  1. Qualifier le besoin
  2. Préparer la proposition
  3. Attendre la décision
  4. Conserver le résultat
DISPOSITION ILLUSTRATIVEApp Clients / Soumissions
SurfaceClients / Atelier NordExemple
FlowComposition · typesPréparer une soumission
Clients
✓
Qualifier le besoinTerminé
✓
Préparer la propositionTerminé
03
Attendre la décisionDécision requise
04
Conserver le résultatÀ venir
La préparation attend une décision

La proposition et ses sources restent accessibles pendant l’attente.

Revoir la proposition
Recherchez un concept, un champ ou une action.Esc