Package Information
Documentation
n8n Streaming AI Agent Node
Streaming AI thinking and tool calls is something missing from n8n, so I created this node to help the community solve this issue. If you appreciate this work, please consider giving it a star on Github and buying me a coffee.
https://buymeacoffee.com/jasonrlee6w
The Streaming AI Agent node is a custom n8n community node that provides AI Agent functionality with real-time streaming capabilities via the AG-UI protocol (https://github.com/ag-ui-protocol/ag-ui). This node extends the standard AI Agent with the ability to stream tool calls, reasoning steps, and agent state by sending asynchronous HTTP calls. By sending streaming events via asynchronous HTTP calls, it allows users to send the streaming events directly to their front end or to send them to another n8n workflow for processing or storage.
Features
- Full AI Agent Compatibility: Works with any connected AI Language Model node
- Real-time Streaming: Stream AI agent operations via AG-UI protocol
- Universal AI Support: Compatible with OpenAI, Anthropic, Google Gemini, and other language models
- Configurable Events: Choose what events to stream (tool calls, reasoning, state changes)
- Webhook Delivery: Send events to external systems via HTTP webhooks
- Performance Optimized: Minimal overhead with intelligent batching
- Secure: Multiple authentication methods for webhook delivery
Installation
- Go to your n8n instance
- Navigate to Settings → Community Nodes
- Install
n8n-nodes-streaming-ai-agent
Configuration Options
AI Model
- Connected Model: The node automatically uses any connected AI Language Model node
- System Prompt: Define the agent's behavior and role
- Tools: Connect AI Tool nodes for additional capabilities
Streaming (Optional)
- Enable Streaming: Toggle real-time event streaming
- Webhook URL: Endpoint to receive AG-UI events
- Authentication: Bearer Token, Basic Auth, or Custom Headers
- Event Selection: Choose which events to stream
- Performance Settings: Batch size and timeout for optimization
Event Types
- Run Events: Execution start/finish
- Tool Events: Tool calls and results
- Message Events: AI responses and reasoning
- State Events: Agent state changes
🔗 Webhook Integration
Event Format
All events are delivered as HTTP POST requests:
{
"event": {
"type": "text_message_content",
"timestamp": "2024-01-15T10:30:00.000Z",
"data": {
"content": "I'll help you with that...",
"messageId": "msg_123"
}
},
"metadata": {
"nodeId": "node_456",
"workflowId": "workflow_789",
"executionId": "exec_012"
}
}
Performance Tips
For Real-time Chat (Low Latency)
- Batch Size: 1
- Batch Timeout: 100ms
- Events:
text_message_start
,text_message_content
,text_message_end
For Analytics (High Throughput)
- Batch Size: 50
- Batch Timeout: 2000ms
- Events:
run_started
,run_finished
,tool_call_start
,tool_call_end
License
MIT License
Github repository: