Fix Flow Engine schema validation and improve Human Approval UX#229
Draft
esafwan wants to merge 1 commit into
Draft
Fix Flow Engine schema validation and improve Human Approval UX#229esafwan wants to merge 1 commit into
esafwan wants to merge 1 commit into
Conversation
… trigger modal - Add condition, http_request, transform, loop to ALLOWED_NODE_TYPES in flow_definition.py (flows using these 4 node types were rejected on save) - Remove Actions tab from trigger NodeSelectionModal (only triggers shown when editing start node); remove empty Apps/Utility sub-tabs - Human Approval: replace plain text approver_role with Combobox that auto-suggests Frappe roles; add approval_type selector (role/user), approver_users field, context_summary with VariablePicker, reference doctype/name fields for linked document context - Backend: update _exec_human_approval to interpolate and pass context_summary, reference_doctype, reference_name in waiting data - Fix tool-call config: NodeSelectionModal now uses nested output structure matching RightSidebar expectations - Update flow_api.py node schemas for human.approval with new fields - Update TypeScript types (HumanInLoopActionConfig, ToolCallActionConfig) - Add getRoles() API service for role auto-suggest - Add comprehensive test/workflow/FLOW_ANALYSIS.md with findings https://claude.ai/code/session_01VUxzR94VDLiL2Haj5ovyun
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.
Summary
This PR addresses critical schema validation gaps in the Flow Engine and significantly improves the Human Approval node's user experience and functionality. The changes ensure that all node types supported by the backend execution engine are properly validated, and add missing UI controls and context-linking features to the Human Approval workflow.
Key Changes
Schema & Validation Fixes
flow_definition.py:condition,http_request,transform, andloopare now properly recognized during flow validation (previously would fail validation despite being fully supported by the engine)Human Approval Node Enhancements
getRoles()APIcontext_summaryandreference_namefields so approvers see resolved valuesUI/UX Improvements
save_result_to_contextto use nestedoutputobject structure for consistency with sidebar expectationsAPI & Type Updates
getRoles()function inagentApi.tsto fetch disabled=0 roles from Frappeflow.types.tsto include optionaloutputobject inToolCallActionConfigflow_api.pyto include new Human Approval fields in config schemaImplementation Details
The Human Approval node now supports a complete approval workflow with:
The backend properly interpolates variables in context_summary and reference_name before storing in waiting_data, ensuring approvers see resolved values rather than template syntax.
All changes maintain backward compatibility—existing flows without the new fields will continue to work with sensible defaults.
https://claude.ai/code/session_01VUxzR94VDLiL2Haj5ovyun