Every surface that returns a workflow returns one object
List, create, read and update all publish the same workflow object. A client learns one shape, not four.
The rule
- Every surface that returns a workflow MUST carry the keys
id,name,description,nodes,edges,metadata,created,changedanduid. nodesMUST be enriched with each node's node-type metadata.metadataMUST be the value as published on read.- These keys MUST be spelled in lower case,
created,changedanduidincluded. interfaceMUST be present when the workflow declares at least one input or output port.interfaceMUST be absent when the workflow declares none, never emitted as an empty object or an empty array.- A workflow MUST have the same values for these keys on every surface that returns it, including any surface that embeds a workflow outside the API.
- A read of one workflow, on the route API-9 names
workflow, MUST answer404with the codeNOT_FOUNDfor a workflow that does not exist only to a caller holding blanket authority over workflows. - Every other identified caller MUST get
403with the codeACCESS_DENIED(a request without accepted credentials gets401, conventions), the same answer as for a workflow that exists but that the caller may not view, so that the read cannot be used to learn which workflows exist.
What it means
A client that has decoded a workflow from one surface can decode it from any other without a special case: same nine keys, spelled alike. That includes the list surface, where each row is a full workflow object rather than a thinner projection — a caller does not have to fetch a workflow a second time to learn a field the list already carried.
The nine keys are the ones every surface carries. An implementation can add keys of its own to a workflow, and a client ignores the ones it does not recognise.
interface is conditional on the workflow itself, not on
which surface answered. A workflow with no declared input or output lacks interface
everywhere, not just on the surfaces that happen to check; a
workflow with at least one declared port carries interface everywhere,
never as an empty placeholder. Absent and empty mean different things
elsewhere in this specification, and this is the case where the difference
is load-bearing: an author who removes every declared port sees the
key disappear, not turn into {}.
Example
Unfiltered, interface does not appear at all.
GET /api/flowdrop/workflows/{workflow_id}
{"id": "wf_no_ports", "name": "No ports", "description": "", "nodes": [ … ], "edges": [ … ], "metadata": { … }, "created": …, "changed": …, "uid": … }Declare one input, and the same nine keys gain interface, on create
as much as on read.
POST /api/flowdrop/workflows
{"id": "wf_shape_iface", "name": "Shape with interface", "nodes": [ … ], "interface": {"inputs": [{"id": "numbers", "bindings": [{"nodeId": "calc1", "portId": "values"}]}]}}GET /api/flowdrop/workflows/{workflow_id}
{"id": "wf_shape_iface", "name": "Shape with interface", "description": "", "nodes": [ … ], "edges": [ … ], "metadata": { … }, "created": …, "changed": …, "uid": …, "interface": {"inputs": [ … ]}}The list surface answers the same shape, row by row: a caller scanning
GET /api/flowdrop/workflows sees interface on exactly the rows that
declare a port, never on the rows that do not.
A read of a workflow that does not exist is 404 only for a caller with
authority over every workflow; anyone else gets the same 403 as for a workflow
they may not view, so the read reveals nothing about which identifiers are in use.