Skip to content

Launch inputs are checked in one fixed order and answered once

A caller gets one problem to fix at a time, in the order that makes the next attempt useful: what you sent that does not exist, then what you did not send, then what is wrong with what you sent.

The rule

Normative: this is the rule
  1. Launch inputs MUST be checked in three stages (keys that are not declared inputs, then required inputs that are absent, then the values themselves).
  2. The check MUST stop at the first stage that fails, and return one message.
  3. A refusal at any stage MUST be answered with 422 and the code INVALID_INPUTS.
  4. Every message MUST end by naming the inputs the workflow does accept, or by stating that it accepts none.
  5. An input MUST count as required when its manifest entry says so, or when its name appears in the published contract's top-level array of required names; either source is sufficient.
  6. A manifest written before the contract was last rebuilt is therefore still enforced.

What it means

A launch can be wrong in more than one way at once, and the three stages are ordered so a caller is never told about a problem fixing the first one would have made moot. A key that is not a declared input name is checked before whether a required input is missing, which is checked before the values themselves — and the check stops the moment a stage fails. A caller who both misspelled an input's name and left a required one out only hears about the misspelling: the missing-required message would be about a state the caller has not actually reached yet, since fixing the typo might supply it.

Every message, at whichever stage it stops, ends the same way: it names the inputs the workflow accepts, or says it accepts none. And "required" has two sources, not one — a manifest entry can say so directly, or the input's name can simply appear in the published contract's top-level required array. Either is enough on its own, so a manifest written before that contract was last rebuilt is still enforced through the newer source.

Example

The workflow declares one input, message, required.

A misspelled key, sent alongside a missing required input422 — INVALID_INPUTS
{ "mesage": "typo" }
No unknown keys, but the required input never arrives422 — INVALID_INPUTS
{}

The first refusal reports only the unknown key and the inputs the workflow accepts; it says nothing about message being missing, even though it is. The second, sent once the typo is gone, is the first point at which the missing-required stage gets to speak.

Why

Recorded under OPEN-16, OPEN-25, OPEN-49.

Fixtures

Test cases whose outcome this rule decides. A case compares absent, null and empty members exactly; the fixtures README defines each operation. Where a case and the rule disagree, the rule is right.

  • A null meets required at launch, then fails a string type resolve-launch-inputs
    {
      "given": {
        "inputs": [
          {
            "name": "topic",
            "node_id": "n1",
            "port": "text",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "supplied": {
          "topic": null
        }
      },
      "expect": {
        "refused": {
          "stage": "value",
          "inputs": [
            "topic"
          ]
        }
      }
    }

    fixtures/presence/in-null-meets-required-fails-type.json

  • An unbound required input is still required resolve-launch-inputs
    {
      "given": {
        "inputs": [
          {
            "name": "topic",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "supplied": {}
      },
      "expect": {
        "refused": {
          "stage": "missing",
          "inputs": [
            "topic"
          ]
        }
      }
    }

    fixtures/presence/in-unbound-required-missing.json

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · MAN-15 · changed in spec 1.1