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:
@@ -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"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user