Skip to content

Registry-correct flow management for off-box callers, bump to 1.5.0 - #50

Merged
pallaoro merged 1 commit into
mainfrom
flow-manage-api
Aug 3, 2026
Merged

Registry-correct flow management for off-box callers, bump to 1.5.0#50
pallaoro merged 1 commit into
mainfrom
flow-manage-api

Conversation

@pallaoro

@pallaoro pallaoro commented Aug 3, 2026

Copy link
Copy Markdown
Member

What

  • POST /flows/validate in the flow server — pure validateFlow() against the live in-process step registry. This is the one place an off-box caller can validate flows that use plugin-registered custom steps (clawnify_app, clawnify_action, send_email), which only exist in the gateway process. No state, no execution — safe unauthenticated like /health.
  • src/core/manage.ts — draft/version semantics (resolveFlowFile, versionsDir, listVersions, readVersion, readLatestVersion, publishDraft) extracted from the plugin's closures so out-of-process platform callers (the Clawnify hook server) import the same implementation instead of mirroring the .clawflow/versions/<name>/<N>.json layout. publishDraft deliberately does not validate — callers validate first with the registry they have.
  • flow_publish keeps its in-process validation and delegates the snapshot to publishDraftno behavior change.

Why

The Clawnify CLI gains flows create/edit/publish (clawnify/clawnify PR linked below). Validation must see the live registry or it falsely rejects our own documented steps; publishing must use the engine's layout or it drifts. Both are now imported from the engine, per the ADR (never a second parser).

Tests

  • 10 new tests in tests/manage.test.ts: publishDraft versioning/stamping/errors, resolveFlowFile conventions, and the validate route (valid, node-level errors, custom-step-aware via defaultRegistry, malformed bodies, run-route shadowing).
  • Full suite: 171 pass.
  • Also verified live on a Clawnify box (1.4.1 → this build): POST /flows/validate answers via the public tunnel; the hook's save/publish paths work end-to-end against it.

… bump to 1.5.0

serve.ts gains a pure validation endpoint that runs validateFlow against the
live in-process step registry — the one place off-box callers (Clawnify hook
server) can get registry-correct validation for flows using plugin-registered
custom steps (clawnify_app, clawnify_action, ...).

Draft/version semantics (resolveFlowFile, versionsDir, listVersions,
readVersion, readLatestVersion, publishDraft) move from plugin closures into
src/core/manage.ts so out-of-process callers import the same implementation
instead of mirroring it. flow_publish keeps its in-process validation and now
delegates the snapshot to publishDraft — no behavior change.
@pallaoro
pallaoro merged commit 3ff2945 into main Aug 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant