agents o/agents • @owndev
·
13 days ago
·
2 years ago
N8N Pipeline
Last Updated
13 days ago
Created
2 years ago
Function
pipe
v2.3.1
Name
N8N Pipeline
Downloads
31K+
Saves
60+
Description
An optimized streaming-enabled pipeline for interacting with N8N workflows, consistent response handling for both streaming and non-streaming modes, robust error handling, and simplified status management. Supports Server-Sent Events (SSE) streaming and various N8N workflow formats. Now includes configurable AI Agent tool usage display with three verbosity levels (minimal, compact, detailed) and customizable length limits for tool inputs/outputs (non-streaming mode only).

N8N Pipeline

An optimized streaming-enabled pipeline for interacting with N8N workflows, consistent response handling for both streaming and non-streaming modes, robust error handling, and simplified status management. Supports Server-Sent Events (SSE) streaming and various N8N workflow formats. Now includes configurable AI Agent tool usage display with three verbosity levels (minimal, compact, detailed) and customizable length limits for tool inputs/outputs (non-streaming mode only).


Features

  • Integrates with N8N for seamless streaming communication.
  • Uses FastAPI StreamingResponse for real-time streaming.
  • Enables real-time interaction with N8N workflows.
  • Provides configurable status emissions and chunk streaming.
  • Cloudflare Access support for secure communication.
  • Encrypted storage of sensitive API keys.
  • Fallback support for non-streaming responses.
  • Compatible with Open WebUI streaming architecture.
  • Displays N8N AI Agent tool usage with configurable verbosity (non-streaming mode only).
  • Three display modes: minimal (tool names only), compact (names + preview), detailed (full collapsible sections).
  • Customizable length limits for tool inputs and outputs.
  • Shows tool calls, inputs, and results from intermediateSteps in non-streaming mode (N8N limitation - streaming responses do not include intermediateSteps).
  • Parses n8n native streaming (NDJSON), Server-Sent Events (data lines, [DONE], comments) and plain-text streams line by line without leaking SSE framing.
  • Forwards token usage from a non-streamed JSON reply of the workflow to Open WebUI, for streaming and non-streaming chats.
  • Sends Open WebUI tasks (title, tags, follow-ups, ...) without chat_id/message_id, so they stay out of the workflow's chat memory.
  • Final status on completion, on error or when the response is stopped.
  • Shows n8n stream error chunks as 'N8N Error: ...' and ends a failed or interrupted stream with an error status.
  • Parses large JSON objects streamed in small chunks in linear time, without blocking Open WebUI.
  • Here is an example N8N workflow for N8N Pipeline

Workflows for N8N Pipeline


GitHub

Open-WebUI-Functions

NOTE

For questions, problems, and feature requests, an issue must be created on GitHub.


License

Apache License 2.0


6