NF-7: Operator-authored flows (HTTP API) #328

Closed
opened 2026-04-24 11:29:51 +00:00 by code-lead · 0 comments
Collaborator

As an operator, I want to create, edit, enable, and disable custom flows through an authenticated HTTP API (without restarting the service) so that I can fork the default flow and tailor dispatch rules to my deployment.

Acceptance criteria

CRUD

  • POST /flows, PATCH /flows/:id, DELETE /flows/:id, POST /flows/:id/enable, POST /flows/:id/disable — all auth-gated against webhook-config.auth.operator_user.
  • source=default flows refuse mutation (operator forks them via POST /flows with a new id).

Validation

  • Graph-load-time checks: schema, registered node types, port-type compatibility, cycle detection, all inputs refs resolve, static-args match widget schemas.
  • priority + mutex_group honoured by the dispatcher.

Audit + budget

  • Every mutation writes a row in flow_audit (JSON diff before/after, timestamp, operator).
  • Per-flow rate-limit budget enforced on every run (default 20 mutating calls).

Dry-run endpoint

  • POST /flows/:id/dry-run with a synthetic event payload returns the full node trace without executing side effects.

CLI

  • just flows-apply <file.json> wraps POST / PATCH for shell-driven management.

Out of scope

  • UI editor — specs/node-flows-ui.md stories.
  • Legacy handler removal — NF-8.

References

As an operator, I want to create, edit, enable, and disable custom flows through an authenticated HTTP API (without restarting the service) so that I can fork the default flow and tailor dispatch rules to my deployment. ## Acceptance criteria ### CRUD - [ ] `POST /flows`, `PATCH /flows/:id`, `DELETE /flows/:id`, `POST /flows/:id/enable`, `POST /flows/:id/disable` — all auth-gated against `webhook-config.auth.operator_user`. - [ ] `source=default` flows refuse mutation (operator forks them via `POST /flows` with a new id). ### Validation - [ ] Graph-load-time checks: schema, registered node types, port-type compatibility, cycle detection, all `inputs` refs resolve, static-args match widget schemas. - [ ] `priority` + `mutex_group` honoured by the dispatcher. ### Audit + budget - [ ] Every mutation writes a row in `flow_audit` (JSON diff before/after, timestamp, operator). - [ ] Per-flow rate-limit budget enforced on every run (default 20 mutating calls). ### Dry-run endpoint - [ ] `POST /flows/:id/dry-run` with a synthetic event payload returns the full node trace without executing side effects. ### CLI - [ ] `just flows-apply <file.json>` wraps `POST` / `PATCH` for shell-driven management. ## Out of scope - UI editor — `specs/node-flows-ui.md` stories. - Legacy handler removal — NF-8. ## References - Spec: [`specs/node-flows.md`](../src/branch/main/specs/node-flows.md) § Security; Stories § NF-7. - Depends on NF-6 (#327).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#328
No description provided.