Skip to content

Comments

feat(context): add on_workflow_yield hook#79

Open
xujustinj wants to merge 1 commit intomainfrom
on_workflow_yield
Open

feat(context): add on_workflow_yield hook#79
xujustinj wants to merge 1 commit intomainfrom
on_workflow_yield

Conversation

@xujustinj
Copy link
Contributor

Summary

  • Adds on_workflow_yield to Context, called when a workflow raises WorkflowYield (i.e. one or more nodes yielded and execution cannot complete)
  • Both TopologicalExecutionAlgorithm and ParallelExecutionAlgorithm call the hook before re-raising WorkflowYield
  • Adds TestOnWorkflowYield to tests/test_hooks.py with 4 cases × 2 algorithms (8 new tests)

Test plan

  • Hook is called when the workflow yields
  • Hook receives the correct workflow, input, and exception arguments (with exception.node_yields populated)
  • Hook is not called on successful completion
  • Hook is not called when the workflow errors

🤖 Generated with Claude Code

Adds a new Context lifecycle hook called when a workflow raises
WorkflowYield, mirroring the existing on_node_yield hook at the
workflow level. Includes tests for both execution algorithms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant