-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(workflow-in-workflow): variables not accessible in child workflow #783
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
| logger.error(`[${requestId}] Failed to parse workflow variables: ${workflowId}`, error) | ||
| // Continue execution even if variables can't be parsed | ||
| } | ||
| // Get workflow variables - they are stored as JSON objects in the database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove useless fallback logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR fixes a critical bug where workflow variables were not being passed correctly to child workflows in the workflow-in-workflow block feature. The changes address two key areas:
-
WorkflowBlockHandler Enhancement: The
workflow-handler.tsfile now properly extracts workflow variables from the API response and passes them to child workflow executors. Previously, only environment variables were passed, leaving workflow-specific variables inaccessible in nested executions. -
Variable Handling Simplification: The execute route in
route.tsremoves complex JSON parsing logic for workflow variables, instead directly casting them asRecord<string, any>. This assumes variables are already stored as JSON objects in the database, eliminating potential parsing errors.
The fix leverages the existing Executor constructor interface that already supports a workflowVariables parameter, making this a straightforward integration. The changes ensure that when a workflow calls another workflow (nested execution), all parent workflow variables are properly accessible in the child context, which is essential for variable resolution throughout the execution chain.
Confidence score: 4/5
- This appears to be a well-targeted bug fix that addresses a specific functionality gap in workflow variable inheritance
- The implementation uses existing infrastructure correctly and maintains the established patterns
- The execute route file needs careful attention due to the removal of error handling for JSON parsing, which could be problematic if the database format assumptions are incorrect
2 files reviewed, 1 comment
…simstudioai#783) * fix(workflow-in-workflow): child workflow must be able to access vars * simplify
Description
Pass child workflow variables in correctly for workflow in workflow block.
Type of change
How Has This Been Tested?
Screen.Recording.2025-07-24.at.4.12.09.PM.mov
Checklist:
bun run test)Security Considerations: