Skip to content

feat: ephemeral flows and accept full Flow on create API#479

Merged
srperens merged 5 commits intomainfrom
feat/ephemeral-flows-and-create-api
Apr 7, 2026
Merged

feat: ephemeral flows and accept full Flow on create API#479
srperens merged 5 commits intomainfrom
feat/ephemeral-flows-and-create-api

Conversation

@srperens
Copy link
Copy Markdown
Collaborator

@srperens srperens commented Apr 7, 2026

Summary

  • Unified create API: POST /api/flows now accepts a full Flow body instead of the limited CreateFlowRequest, eliminating the create-then-update two-step pattern in frontend import, copy, and gst-launch flows
  • Ephemeral flows: New ephemeral flag on FlowProperties — when true, the flow lives only in memory and is never persisted to storage, useful for temporary or API-created flows
  • Name validation: Restored the 1–255 character name length check that was lost when CreateFlowRequest was removed
  • Removes dead CreateFlowRequest type and simplifies frontend flow operations (net -57 lines)

Test plan

  • Create a flow via API with full Flow body — verify it is created with a new ID and cleared runtime state
  • Create a flow with empty or >255 char name — verify 400 response
  • Create an ephemeral flow — verify it works but does not appear after server restart
  • Toggle ephemeral off in properties dialog — verify flow is persisted on next save
  • Import, copy, and gst-launch import flows — verify single-step creation works
  • Run cargo test --test openapi_test — verify snapshot is up to date

🤖 Generated with Claude Code

Per Enstedt and others added 5 commits April 7, 2026 16:30
Add `ephemeral` boolean to FlowProperties — when true, the flow lives
only in memory and is never persisted to storage. Toggling from
non-ephemeral to ephemeral deletes the stored copy. Frontend exposes
this as a checkbox in the flow properties dialog.

Change POST /api/flows to accept a full Flow object instead of just
name+description. The backend assigns a new ID, clears runtime state,
and runs the same validation as update (endpoint trimming, pad
computation, link validation, auto-layout). This is extracted into a
shared prepare_flow() helper used by both create and update.

Simplify frontend import/copy operations from two API calls
(create + update) to a single create call.

Also removes colons from field labels in the flow properties dialog
for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…te OpenAPI snapshot

CreateFlowRequest is unused after the create API was changed to accept
a full Flow. Switched create_flow from bare Json to JsonBody for
consistent structured error responses. Regenerated openapi.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CreateFlowRequest removal dropped the garde length(1..255) check.
Restore equivalent validation directly in the handler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The create_flow endpoint now accepts a Flow instead of CreateFlowRequest,
so the test must send a valid Flow body.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that empty and >255 char names return 400, and that the backend
assigns a new ID and clears runtime state on creation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@srperens srperens merged commit 4aad57e into main Apr 7, 2026
7 checks passed
@srperens srperens deleted the feat/ephemeral-flows-and-create-api branch April 7, 2026 15:32
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