Flows and dashboards are created by POST under an issued or superuser-pinned id; PUT only updates; deleted flows leave a tombstone with their key; the controller stores by id and runs by key, hooks live under /hooks/<flow id>; a key with state or queued work behind it is refused until cleared

This commit is contained in:
2026-11-02 17:41:23 +01:00
parent fae85f5ecb
commit 08a6376836
63 changed files with 2832 additions and 936 deletions
+3 -2
View File
@@ -89,9 +89,10 @@ def ensure_flow(api: Api) -> None:
try:
current = api.call("GET", f"/api/v1/flows/{BENCH_FLOW}")
definition["version"] = current["definition"]["version"]
api.call("PUT", f"/api/v1/flows/{BENCH_FLOW}", definition)
except urllib.error.HTTPError:
pass
api.call("PUT", f"/api/v1/flows/{BENCH_FLOW}", definition)
# Pinned to its key, so every path below can name it.
api.call("POST", "/api/v1/flows/", {**definition, "id": BENCH_FLOW})
api.call(
"PUT", f"/api/v1/flows/{BENCH_FLOW}/nodes/noop/source", {"code": NODE_SOURCE}
)
+6 -2
View File
@@ -354,9 +354,13 @@ def create_flow(
definition: dict[str, Any],
sources: dict[str, str] | None = None,
) -> None:
"""Draft, node source, publish — the sequence the editor uses."""
"""Draft, node source, publish — the sequence the editor uses.
Pinned to its key, which the superuser running this may, so the hooks and
paths below can name it.
"""
name = definition["name"]
response = client.put(f"/api/v1/flows/{name}", json=definition)
response = client.post("/api/v1/flows/", json={**definition, "id": name})
response.raise_for_status()
version = response.json()["definition"]["version"]