Skip to content

The turn endpoint and the launch endpoint judge inputs identically

The rule

Normative: this is the rule
  1. A session turn's inputs MUST be checked exactly as a launch's are.
  2. An undeclared key MUST be refused.
  3. A declared required input MUST be enforced.
  4. Values MUST be checked against the declared schema.
  5. Resolution into the run's initial data MUST be strict.
  6. The same body MUST earn the same verdict at both endpoints.
  7. A turn MUST NOT accept, by merging raw caller input into the run's initial data, anything the launch endpoint would refuse.
  8. A turn whose inputs are refused MUST be refused with 422 and the code INVALID_INPUTS, the status and code a launch's refusal carries (MAN-15).

What it means

A workflow can be run through two endpoints: launched directly, or driven a turn at a time inside a session. The author decided what the workflow accepts once, by declaring its inputs (MAN-1). This rule says that decision means one thing regardless of which endpoint a caller comes through. The four checks the launch endpoint runs (MAN-13, MAN-15) are the four checks the turn endpoint runs, on the same inputs object, with the same answer.

The clause about merging is the one that bites. A turn carries its inputs alongside the message, and the shortest implementation copies them straight into the run's initial data. That is a second, unguarded way in: a caller who knows a workflow's internal node-keyed shape (chat_input.1, say) could seed state the author never published, at the turn endpoint, when the launch endpoint would have refused the identical body. Not a declared input name is not a declared input name, whichever endpoint it arrives at.

"Identically" is a property of the whole surface, not of the cases someone happened to test at both endpoints. Two checkers maintained side by side drift exactly where one endpoint has a case the other has not seen; the observable requirement is that no such case exists.

Example

The workflow declares one input, greeting. The same three inputs objects, sent as a turn, get the verdicts the launch endpoint gives them.

An input the workflow never declared422 — INVALID_INPUTS
POST /api/flowdrop/session/{session_id}/turn

{"content": "hi", "inputs": {"not_a_declared_input": "x"}}
The internal node-keyed shape: not a declared name, so unknown422 — INVALID_INPUTS
POST /api/flowdrop/session/{session_id}/turn

{"content": "hi", "inputs": {"chat_input.1": {"message": "seeded"}}}
A declared input202 — accepted
POST /api/flowdrop/session/{session_id}/turn

{"content": "hi", "inputs": {"greeting": "hello"}}

The first refusal names the inputs the workflow does accept, as MAN-13 requires of the launch endpoint. Both refusals are 422, the launch's status, and both come only after the caller is authorised: they read the workflow's declared inputs, which a caller who may not see the workflow must not learn. A turn with no inputs at all is valid: absent is not the same as undeclared.

Why

Recorded under OPEN-25, OPEN-49.

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