--- id: STORE-1 family: GR-STORE level: core profiles: [storage-api] posture: normative-target added: "1.0" changed: "1.0" source: https://flowdrop.io/spec/rules/gr-store/store-1 specification: FlowDrop Workflow Specification 1.0 licence: CC BY 4.0 --- # STORE-1 — A request body is bounded before anything is parsed *GR-STORE (Part I) · level: core · profiles: storage-api · added in 1.0* The cheapest refusals come first. A body that is too large, too deeply nested, or not JSON at all is turned away before any workflow-level meaning is read out of it. ## The rule > **Normative.** This is the rule. > > 1. A request body MUST be JSON whose top level is an object or an array. > > 2. A body that is empty, is not well-formed JSON, decodes to a scalar (`null` included), exceeds 8 MiB of octets, or nests 64 levels or deeper MUST be refused with 400. > > 3. Nothing is stored when a body is refused. > > 4. An implementation MUST accept a document nested 63 levels deep. ## What it means This is the storage endpoints' own copy of the gate API-1 describes: the same checks, with the numbers fixed. A body over 8 MiB, nested 64 levels or deeper, malformed, or not an object or array at its top level never reaches workflow-level meaning. The depth bound is easy to get off by one. The bound is a maximum *depth*, so a document nested 64 levels deep is already one level past what is accepted; every implementation accepts a document nested 63 levels deep, and no deeper is promised. The other clause that bites is the one API-1 states in general and this rule makes concrete: an endpoint whose body is optional is not an endpoint the gate skips. An absent body is fine, but a body that is present and malformed is refused like any other — the gate does not degrade "nothing to check" into "nothing checked". ## Example An endpoint whose body is optional still runs whatever is actually sent through the same gate as any other endpoint. ```http title="A scalar, not a shape the gate can work with" verdict="400 refused" POST /api/flowdrop/workflows/{workflow}/playground/sessions 5 ``` ```http title="Well-formed on the outside, broken underneath" verdict="400 refused" POST /api/flowdrop/workflows/{workflow}/playground/sessions {"name": "unterminated ``` Sending nothing at all to this same endpoint is still accepted — the gate's bounds apply to what is sent, not to whether something was sent. ## Why Recorded under [OPEN-25](https://flowdrop.io/spec/rulings/open-25). ## Related rules - Names: API-1 - Referenced by: API-1 --- 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.