Skip to content

Conversation

@myml
Copy link
Contributor

@myml myml commented Nov 17, 2025

概述 / Overview

请在此部分填写你实现/解决/优化的内容:
Summary of what you implemented/solved/optimized:

Add streaming support detection and proper message type handling for n8n service API runner. Previously, when streaming was enabled, n8n integration would fail due to incorrect message type usage.

  1. Added streaming capability detection by checking adapter's is_stream_output_supported method
  2. Implemented conditional message generation using MessageChunk for streaming mode and Message for non-streaming mode
  3. Added proper error handling for adapters that don't support streaming detection

Fixed #1777

检查清单 / Checklist

PR 作者完成 / For PR author

请在方括号间写x以打勾 / Please tick the box with x

  • 阅读仓库贡献指引了吗? / Have you read the contribution guide?
  • 与项目所有者沟通过了吗? / Have you communicated with the project maintainer?
  • 我确定已自行测试所作的更改,确保功能符合预期。 / I have tested the changes and ensured they work as expected.

项目维护者完成 / For project maintainer

  • 相关 issues 链接了吗? / Have you linked the related issues?
  • 配置项写好了吗?迁移写好了吗?生效了吗? / Have you written the configuration items? Have you written the migration? Has it taken effect?
  • 依赖加到 pyproject.toml 和 core/bootutils/deps.py 了吗 / Have you added the dependencies to pyproject.toml and core/bootutils/deps.py?
  • 文档编写了吗? / Have you written the documentation?

Add streaming support detection and proper message type handling for
n8n service API runner. Previously, when streaming was enabled, n8n
integration would fail due to incorrect message type usage.

1. Added streaming capability detection by checking adapter's
is_stream_output_supported method
2. Implemented conditional message generation using MessageChunk for
streaming mode and Message for non-streaming mode
3. Added proper error handling for adapters that don't support streaming
detection
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug? Bug或Bug修复相关 / maybe a bug eh: Feature enhance: 新功能添加 / add new features labels Nov 17, 2025
@RockChinQ RockChinQ requested review from Copilot and fdc310 November 17, 2025 07:05
Copilot finished reviewing on behalf of RockChinQ November 17, 2025 07:07
Copy link
Contributor

Copilot AI left a comment

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 adds streaming support detection and proper message type handling for the n8n service API runner to prevent failures when streaming is enabled.

  • Implemented streaming capability detection using the adapter's is_stream_output_supported() method
  • Added conditional message generation using MessageChunk for streaming mode and Message for non-streaming mode
  • Included error handling for adapters that don't support streaming detection

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

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Nov 21, 2025
@fdc310
Copy link
Member

fdc310 commented Nov 21, 2025

@myml 我这边针对n8n的流式工作流做了一部分的修改,你看一下(我不知道为啥用不了原非流式的那种,你可以看看测一下有没有影响),关于流式工作流的配置可以参考一下langbot_wiki的分支n8n_docs

@RockChinQ RockChinQ merged commit 31b4835 into langbot-app:master Nov 22, 2025
@RockChinQ
Copy link
Member

https://docs.langbot.app/zh/deploy/pipelines/n8n.html master已更新,可以按照这个文档配置一下n8n流式

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

Labels

bug? Bug或Bug修复相关 / maybe a bug eh: Feature enhance: 新功能添加 / add new features size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: n8n error

3 participants