The API maps a client interface onto the stored manifest
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
- A workflow's API MUST accept an
interfaceobject. - It MUST map the object onto the stored input and output manifests.
- An entry's client-side identifier MUST become the server-side input name; renaming either is a breaking change for callers.
- An entry carries at most one binding, whose node and port identifiers MUST become the entry's
node_idandport. - An entry carrying more than one binding MUST be refused with 422 and the code
INVALID_REQUEST_BODY. - The request MUST store nothing.
- An entry carrying no binding MUST be stored as an unbound entry (MAN-2), and MUST NOT be an error.
- An entry's declared schema MUST be stored as the entry's
schema, and its declared data type as that schema'sx-data-type. - A default value and free-form metadata on an entry MUST be ignored on write, because they have no server representation.
- Input-side author metadata (the entry's display name, description, examples and required flag) MUST round-trip as author-written manifest metadata does.
- 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.
- On read, an unbound entry MUST be published with an empty list of bindings.
- The mapped manifests MUST be applied before the workflow is validated.
- A bound entry naming a node or port that does not exist MUST be refused by workflow validation, with 422 and the code
VALIDATION_FAILED(STORE-5). - The API's own refusals, made before the workflow is validated, 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 reported as a validation
error with its locator (STORE-5). Both are 422: in each case the body was read
and its content refused. The API's own refusals stop at the entry's shape; whether
what it points to is real is validation's answer.
Example
POST /api/flowdrop/workflows
{"name": "Over-bound", "nodes": [ … ], "interface": {"inputs": [
{"id": "numbers", "bindings": [
{"nodeId": "calc1", "portId": "values"},
{"nodeId": "calc1", "portId": "values"}
]}
]}}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"}]}
]}}PUT /api/flowdrop/workflows/{workflow_id}
{"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.