feat(flow): PR #397 rebased on develop + flow_failed realtime forwarding + docs - #408
Closed
esafwan wants to merge 3 commits into
Closed
feat(flow): PR #397 rebased on develop + flow_failed realtime forwarding + docs#408esafwan wants to merge 3 commits into
esafwan wants to merge 3 commits into
Conversation
…oval routing/permissions; add approvals inbox bell - Engine: honor loop executor next_node_id; reject decisions no longer follow approval-path edges; approval_type 'user'/'users' treated as synonyms in notifications, permission checks, and pending-approvals API - Validation: allow trigger.schedule and trigger.doc-event node types - Permissions: Huf Manager can create Flow Runs; approve endpoint requires read + approver identity; agent tool handlers enforce permissions and approver identity; webhook runs execute as flow owner instead of Guest - Builder: edge editor writes edgeType/condition keys the serializer reads, adds priority and approval-outcome (meta.outcome) controls; trigger types round-trip through the serializer - New ApprovalsBell in the unified header: pending-approvals inbox with badge, realtime + polled refresh, inline approve/reject, run deep link
Adds 'flow_failed' to the forwarded flowEvents array so the ApprovalsBell updates immediately on flow rejection without waiting for the 60s poll. Mirrors existing flow_completed forwarding.
- Approval routing: rejection without a meta.outcome=rejected edge fails the run (was: fell through success path); loop nodes route body/done via executor next_node_id - Huf Manager role has create on Flow Run (bench migrate required) - Agent tool handlers (run/get/resume/approve flow) enforce the same permission checks as REST endpoints - Note user/users approval_type synonym handling
This was referenced Jul 20, 2026
Contributor
Author
|
Superseded by consolidated Flow execution PR #475: feat(flow): consolidate routing, approvals, and failure handling. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Supersedes/repairs #397 (head
746a2e22): flow-engine loop routing, edge serialization key mismatch, approval routing/permissions,trigger.schedule/trigger.doc-eventvalidation, approvals inbox — all defects verified live on develop. This PR is that change rebased onto current develop plus the two follow-ups identified in intake: theflow_failedrealtime event was not forwarded to the frontend (the new ApprovalsBell would wait up to 60s to notice a rejection), and the AGENTS.md Flow Engine section drifted.Scope
746a2e22(9 files, clean — zero overlap with develop's 8 newer commits).frontend/src/contexts/SocketContext.tsx: forwardflow_failed(one line, mirrorsflow_completed).AGENTS.md: approval-routing + loop-routing semantics, new trigger node types, Huf Manager create perm, tool-handler permission parity.Key decisions
approve_flow_run— see Risks).Agent contributions
Intake dossier + repair (cherry-pick,
flow_failedfix, typecheck, AGENTS.md update) by the release-orchestration pipeline, which also verified diffs and ran bench validation.Tests executed
py_compileon the 3 changed Python files;npx tsc -bgreen.bench migrateOK (Flow Run perm sync), console smoke:trigger.schedule/trigger.doc-eventnode schemas present, rejection-fails-run path present, loop dispatch present.Risks and limitations
meta.outcome=rejectededge now FAILS the run; loop nodes now actually iterate — flows authored against the buggy behavior will change.approve_flow_run's new rejection path must keep its commit semantics (_fail_flow_runself-commits today).Rollback
Revert the 3 commits;
flow_run.jsonperm change rolls back on migrate.Remaining work