--- id: MAN-20 family: GR-MAN level: extended profiles: [storage-api] posture: normative-target added: "1.0" changed: "1.0" source: https://flowdrop.io/spec/rules/gr-man/man-20 specification: FlowDrop Workflow Specification 1.0 licence: CC BY 4.0 --- # MAN-20 — The API maps a client interface onto the stored manifest *GR-MAN (Part I) · level: extended · profiles: storage-api · added in 1.0* What an editor calls an interface entry and what the server stores as a manifest entry are the same thing under two vocabularies. This is the mapping, including what it deliberately ignores. ## The rule > **Normative.** This is the rule. > > 1. A workflow's API MUST accept an `interface` object. > > 2. It MUST map the object onto the stored input and output manifests. > > 3. An entry's client-side identifier MUST become the server-side input name; renaming either is a breaking change for callers. > > 4. An entry carries at most one binding, whose node and port identifiers MUST become the entry's `node_id` and `port`. > > 5. An entry carrying more than one binding MUST be refused with 400. > > 6. The request MUST store nothing. > > 7. An entry carrying no binding MUST be stored as an unbound entry (MAN-2), and MUST NOT be an error. > > 8. An entry's declared schema MUST be stored as the entry's `schema`, and its declared data type as that schema's `x-data- type`. > > 9. A default value and free-form metadata on an entry MUST be ignored on write, because they have no server representation. > > 10. Input-side author metadata (the entry's display name, description, examples and required flag) MUST round-trip as author- written manifest metadata does. > > 11. An output entry carries its name, its declared type and schema, and its binding where it has one, and none of the input-side metadata. > > 12. On read, an unbound entry MUST be published with an empty list of bindings. > > 13. The mapped manifests MUST be applied before the workflow is validated. > > 14. A bound entry naming a node or port that does not exist MUST be refused with 422 by workflow validation. > > 15. The API's own 400 refusals MUST cover the entry's shape only. ## What it means An `interface` entry names at most one binding. An entry naming two is refused outright, before anything else about it is even looked at — a shape failure, not a decision about whether the node or port it names exists. An entry naming none is not a failure either: it is an unbound entry, stored with the schema and data type it declares, and read back with an empty list of bindings. That is what lets an author publish the interface first and build the inside later. That shape check happens before the workflow is validated, so it answers a different question than validation does. A binding whose node or port is made up entirely is not caught here — it is caught by the same check that would catch it on a directly-stored port array, and answered with a different status. The API's own refusals stop at the entry's shape; whether what it points to is real is somebody else's answer. ## Example ```http title="An entry naming the same binding twice" verdict="400 refused" POST /api/flowdrop/workflows {"name": "Over-bound", "nodes": [ … ], "interface": {"inputs": [ {"id": "numbers", "bindings": [ {"nodeId": "calc1", "portId": "values"}, {"nodeId": "calc1", "portId": "values"} ]} ]}} ``` ```http title="An unbound entry, alongside one that is bound" verdict="201 stored" POST /api/flowdrop/workflows {"name": "Interface first", "nodes": [ … ], "interface": {"inputs": [ {"id": "topic", "dataType": "string", "schema": {"type": "string"}, "bindings": []}, {"id": "numbers", "bindings": [{"nodeId": "calc1", "portId": "values"}]} ]}} ``` ```http title="An entry whose binding names a node that does not exist" verdict="422 refused" PUT /api/flowdrop/workflows/{workflow} {"name": "Ghost", "interface": {"inputs": [ {"id": "numbers", "bindings": [{"nodeId": "ghost_node", "portId": "values"}]} ]}} ``` The unbound entry is stored: the response's `interface.inputs` names both `topic`, with `"bindings": []`, and `numbers`. ## Why Recorded under [OPEN-22](https://flowdrop.io/spec/rulings/open-22), [OPEN-25](https://flowdrop.io/spec/rulings/open-25), [OPEN-27](https://flowdrop.io/spec/rulings/open-27). ## Related rules - Names: MAN-2, MAN-3, MAN-21 - Referenced by: STORE-14, MAN-3, MAN-21 --- 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.