Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

kausmeows
Copy link
Contributor

@kausmeows kausmeows commented Oct 8, 2025

Summary

  • from sdk we pass workflow_context in case of streaming (step.py) when we do self.active_executor.run . This workflow context consists of things like step id, step name, step index etc which is then put in RunOutputEvent used by FE.
  • Now in case of a custom function step, which does agent.run() inside it. this agent run is completely unanimous and not in the flow of our execution. like the user decides to trigger it. and we cant directly inject that workflow_context into this run, so - in case of this step even if we yield events the FE wont know about which step it belongs to because it doesn't have access to that step_id etc info.

Now we inspect all events that are yielded during the workflow run, and set the workflow context variables on them before yielding upwards.

  • Also updates parallel step event streaming logic to immediately yield events as they come so that FE can catch and display in real time.
    • Old approach - collect all, yield at end
    • New approach - stream immediately (used queues as we cant yield directly from async running tasks)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

Add any important context (deployment instructions, screenshots, security considerations, etc.)

@kausmeows kausmeows requested a review from a team as a code owner October 8, 2025 15:37
@kausmeows kausmeows added the WIP work in progress label Oct 8, 2025
@kausmeows kausmeows removed the WIP work in progress label Oct 8, 2025
@kausmeows kausmeows changed the title chore: [WIP] update workflow context while yielding events chore: update workflow context while yielding events Oct 8, 2025
@kausmeows kausmeows changed the title chore: update workflow context while yielding events chore: update parallel and custom function step events streaming logic Oct 8, 2025
libs/agno/agno/utils/print_response/workflow.py Outdated Show resolved Hide resolved
libs/agno/agno/workflow/step.py Outdated Show resolved Hide resolved
libs/agno/agno/workflow/step.py Show resolved Hide resolved
@kausmeows kausmeows merged commit 02af061 into main Oct 10, 2025
5 checks passed
@kausmeows kausmeows deleted the fix/workflow-context-inject branch October 10, 2025 08:26
kausmeows added a commit to agno-agi/agno-docs that referenced this pull request Oct 10, 2025
## Description

Add details about how to stream agent and team events from within the
custom function step so they are caught properly in the chat page and
streams the info.

## Type of Change
- [ ] Bug fix (errors, broken links, outdated info)
- [ ] New content
- [x] Content improvement
- [ ] Other: ____

## Related Issues/PRs (if applicable)
- Related SDK PR: agno-agi/agno#4954

## Checklist
- [ ] Content is accurate and up-to-date
- [ ] All links tested and working
- [ ] Code examples verified (if applicable)
- [ ] Spelling and grammar checked
- [ ] Screenshots updated (if applicable)

---------

Co-authored-by: manu <manuhortet@gmail.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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.