-
Notifications
You must be signed in to change notification settings - Fork 15
refactor: change step handler input to use asymmetric pattern for better type safety #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 12-23-add_flowinput_to_worker_context_from_task_record
Are you sure you want to change the base?
Conversation
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit b47e937
☁️ Nx Cloud last updated this comment at |
- Root steps receive flowInput directly (no run key wrapper) - Dependent steps receive deps object only, flowInput via context - Add flowInput to FlowContext type - Update all type tests and example flows - Update edge-worker and client packages for compatibility
86ca44b to
b47e937
Compare

Asymmetric Step Input Pattern for Improved Type Safety and Composition
This PR introduces a significant improvement to the step input pattern across the PgFlow DSL:
runwrapper)context.flowInput)This change enables better functional composition where subflows can receive typed inputs without the
runwrapper that previously blocked type matching. The asymmetric input pattern makes the API more intuitive while maintaining full type safety.Key Changes:
StepInpututility type to implement the asymmetric patternflowInputinstead ofinput.runflowInputto theFlowContextinterface for dependent stepsThis change is backward compatible at runtime but will require updating handler parameter names in client code. The improved type safety and composability are worth the minor migration effort.