Skip to content

fix: handle multiple begin/end blocks in n8n streaming#39

Merged
EuleMitKeule merged 1 commit into
EuleMitKeule:masterfrom
ruifung:master
May 2, 2026
Merged

fix: handle multiple begin/end blocks in n8n streaming#39
EuleMitKeule merged 1 commit into
EuleMitKeule:masterfrom
ruifung:master

Conversation

@ruifung

@ruifung ruifung commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Remove premature break on 'end' chunk type to support multi-step n8n agent workflows and add error chunk handling.

Seems to be working as intended now on my own HASS instance. n8n structuredChunk definition can be found in: https://github.com/n8n-io/n8n/blob/bb7d137cf735bcdf65bbcf8ff58fa911d83121f5/packages/workflow/src/interfaces.ts#L3612

Fixes #38

Remove premature break on 'end' chunk type to support multi-step n8n agent workflows and add error chunk handling.

Co-authored-by: opencode <opencode@opencode.ai>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the n8n streaming response handling in the Home Assistant webhook_conversation integration to correctly support multi-step agent workflows (multiple begin/end blocks) and to surface n8n-streamed errors.

Changes:

  • Stop treating the first "end" chunk as terminal so streaming can continue across multiple begin/end blocks.
  • Add handling for "error" chunks by raising a HomeAssistantError.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EuleMitKeule
EuleMitKeule merged commit aa955a8 into EuleMitKeule:master May 2, 2026
9 checks passed
@EuleMitKeule

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 1.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle multiple begin/end streaming responses

3 participants