--- id: CMP-3 family: RT-CMP level: core profiles: [runtime] posture: normative-target added: "1.0" changed: "1.0" source: https://flowdrop.io/spec/rules/rt-cmp/cmp-3 specification: FlowDrop Workflow Specification 1.0-draft licence: CC BY 4.0 --- # CMP-3 — Structure preconditions are checked before anything is planned *RT-CMP (Part II) · level: core · profiles: runtime · added in 1.0* The cheapest checks run first, so a workflow that cannot possibly execute is rejected before any graph work happens. ## The rule > **Normative.** This is the rule. > > 1. Before any graph is built, compilation checks, in order: the workflow has an identifier; it has at least one node; and then, per node in definition order, that the node has an identifier and that it has a type. > > 2. The first failure refuses compilation, and the failure names which precondition failed and, where the failure is a node's, which node. ## What it means The cheapest checks run first, and in a fixed order: the workflow's own identifier, then whether it has any node at all, then — per node, in definition order — that the node has an identifier and that it has a type. A workflow missing its own identifier is refused before any node is examined at all, whatever shape those nodes are in. Within the per-node pass, the first node in definition order that fails is the one named in the failure; a later node's problems are never reported instead. ## Example ```json title="A workflow with no identifier" verdict="given" { "nodes": [{ "id": "node1", "type": "text_input" }] } ``` ```json title="What compilation reports" verdict="refused" "Workflow must have an ID" ``` The same shape, with an identifier but a node missing its type: ```json title="A node with no declared type" verdict="given" { "id": "test_workflow", "nodes": [{ "id": "node1" }] } ``` ```json title="What compilation reports" verdict="refused" "Node node1 must have a type" ``` The message names the node — `node1` — not merely that some node failed. ## Related rules - Names: CMP-1 - Referenced by: CMP-1 --- Rule identifiers are permanent and are never renumbered. This specification carries no implementation status: each implementation publishes its own standing against these rules. Licensed CC BY 4.0.