Skip to content
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

fix: stepwise execution breaks when steps do async work #17914

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

masci
Copy link
Member

@masci masci commented Feb 25, 2025

Description

Problem

In stepwise execution, every call to handler.run_step() checks if the workflow is done or if the next step should be unblocked for execution. Before this PR, unless workflow is not done, run_step assumes the previous step has returned, which is not true if the step itself awaits on something.

Solution

With this PR, a new functionality was added to the Context to keep track of step functions that have been called and are mid-flight (i.e. they haven't returned yet). Using this feature, run_step can now wait for a step to finish before moving on with the next step in line.

Fixes #17898

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files. topic:workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Llama Index Workflow: step-wise does not work
1 participant