- 
                Notifications
    You must be signed in to change notification settings 
- Fork 14
# 🚀 Task Spawning for Map Steps #213
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
| 
 | 
| Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the  You can disable this status message by setting the  Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment  | 
| 
 | 
| Command | Status | Duration | Result | 
|---|---|---|---|
| nx affected -t lint typecheck test --parallel -... | ❌ Failed | 5m 56s | View ↗ | 
☁️ Nx Cloud last updated this comment at 2025-10-06 15:41:54 UTC
9bd624e    to
    66e3c3b      
    Compare
  
    ce696e8    to
    850de93      
    Compare
  
    850de93    to
    05e2388      
    Compare
  
    05e2388    to
    f462cf0      
    Compare
  
    c0fc2a1    to
    2e5052c      
    Compare
  
    2e5052c    to
    b813159      
    Compare
  
    f462cf0    to
    fc686ff      
    Compare
  
    b813159    to
    f02b6ae      
    Compare
  
    fc686ff    to
    cc142fb      
    Compare
  
    | 🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-213.pgflow.pages.dev 📝 Details: 
 _Last updated: _ | 
| 🔍 Preview Deployment: Playground✅ Deployment successful! 🔗 Preview URL: https://pr-213--pgflow-demo.netlify.app 📝 Details: 
 _Last updated: _ | 
…low management - Introduced collect_perf_data.sh for performance testing of large array handling - Updated start_ready_steps function to handle empty map steps and initialize task states - Added migration script to modify start_ready_steps for correct task spawning - Created tests for map step message queueing, delayed message scheduling, and task spawning - Ensured proper handling of initial_tasks, task indices, and step status transitions - Included tests for both map and single steps to verify correct task creation and message dispatching
f02b6ae    to
    025ae50      
    Compare
  
    cc142fb    to
    407d48d      
    Compare
  
    | Merge activity
 | 
## Summary Implements task spawning functionality for map steps, enabling parallel task creation based on array input length. This PR enhances `start_ready_steps()` to generate N tasks for map steps while maintaining backward compatibility with single steps. ## What's New - ✅ **Dynamic Task Spawning**: Map steps spawn N tasks based on `initial_tasks` count - ✅ **Empty Array Handling**: Zero-length arrays auto-complete with `[]` output - ✅ **Batch Operations**: Efficient task creation using `generate_series()` - ✅ **Task Indexing**: Proper task_index assignment (0 to N-1) for ordered execution ## Implementation Details - Enhanced `start_ready_steps()` to handle both single and map step types - Added `CROSS JOIN LATERAL generate_series()` for efficient batch task creation - Special handling for empty arrays - direct transition to completed state - Maintains existing behavior for single steps (1 task with index 0) ## Testing - Comprehensive test coverage for task spawning scenarios - Tests for empty array auto-completion - Validation of task_index values and message queue entries - Performance testing script for large arrays ## Next Steps This completes the task spawning phase. Next PRs will implement: - Array element extraction in `start_tasks()` - Dependent map support in `complete_task()` - Output aggregation in `maybe_complete_run()` Part of the map infrastructure implementation (PR #4 of 8)

Summary
Implements task spawning functionality for map steps, enabling parallel task creation based on array input length. This PR enhances
start_ready_steps()to generate N tasks for map steps while maintaining backward compatibility with single steps.What's New
initial_taskscount[]outputgenerate_series()Implementation Details
start_ready_steps()to handle both single and map step typesCROSS JOIN LATERAL generate_series()for efficient batch task creationTesting
Next Steps
This completes the task spawning phase. Next PRs will implement:
start_tasks()complete_task()maybe_complete_run()Part of the map infrastructure implementation (PR #4 of 8)