This is an n8n community node. It lets you use sipgate AI Flow in your n8n workflows.
sipgate AI Flow is a voice assistant platform for building AI-powered voice applications with real-time speech processing. It supports event-driven architecture with built-in speech-to-text and text-to-speech capabilities.
n8n is a fair-code licensed workflow automation platform.
Installation Operations Credentials Compatibility Usage Testing Resources
Follow the installation guide in the n8n community nodes documentation.
npm install @sipgate/n8n-nodes-ai-flowThis package provides two nodes for working with sipgate AI Flow:
A webhook trigger node that receives events from sipgate AI Flow and automatically routes them to dedicated outputs.
The trigger provides automatic event routing to 9 separate outputs, eliminating the need for IF or Switch nodes:
- Session Start - Call begins
- User Speak - User speaks (includes speech-to-text result)
- Assistant Speak - Assistant starts speaking
- Assistant Speech Ended - Assistant finishes speaking
- User Input Timeout - Timeout waiting for user input
- Session End - Call ends
- Fallback - Unknown event types or catch-all
- DTMF Received - Keypad digit pressed during the call
- SMS Failed - An SMS sent via the Send SMS action could not be delivered
The Fallback output can be configured with two modes:
- Unknown Events Only (default): Routes only unknown/unrecognized event types to the fallback output
- All Events: Routes all events through the fallback output, ignoring specific outputs (useful for simple workflows)
- Authentication: None (development) or Header Auth (production)
- Barge-In Flag: Optional inclusion of barge-in indicator in user_speak events
A unified action node with 8 operations for controlling AI Flow calls. This is a final node (no output connections) that generates the action JSON.
Make the assistant speak text or SSML with advanced options:
- Content Type: Plain text or SSML markup
- User Input Timeout: Configure timeout for user response (seconds)
- TTS Provider: Default, Azure, or ElevenLabs
- Azure: Language and voice configuration
- ElevenLabs: Voice ID configuration
- Barge-In Options: Strategy (immediate, minimum characters, manual, none) and timing
Play pre-recorded audio files:
- Audio Source: Base64 string or binary data from previous node
- Format: WAV (16kHz, mono, 16-bit PCM recommended)
- Barge-In Options: Configure interruption behavior
Transfer the call to another phone number:
- Target Phone Number: E.164 format recommended
- Caller ID Name: Name displayed to recipient
- Caller ID Number: Phone number displayed to recipient
- Ring Timeout: Optional 5–120 s ring timeout
End the call immediately:
- Simple session-based hangup
- No additional configuration needed
Manually interrupt current playback:
- Programmatic interruption control
- Useful for stopping long audio/speech
Loop a background audio track underneath speech (e.g. hold music, ambient bed):
- Mode: Start/replace the loop or stop it
- Audio Source: Base64 string or binary data
- Volume: 0.0–1.0 (default 0.5)
Change speech-to-text behavior mid-call:
- Provider: Azure, Deepgram, ElevenLabs, or keep current
- Languages: Comma-separated BCP-47 codes (1–4)
- Custom Vocabulary: Up to 100 phrases (≤ 200 chars each) to bias recognition
Send an SMS during the call (fire-and-forget; failures arrive on the SMS Failed trigger output):
- Recipient Phone Number: E.164 without leading
+ - Message: SMS body
The sipgate AI Flow Trigger node supports two authentication methods:
No authentication required. Only use this for local testing!
Authenticate incoming webhook requests using a shared secret in HTTP headers.
Setup:
- In the AI Flow Trigger node, select "Header Auth"
- Configure the header name (default:
X-API-TOKEN) - Generate a secure random token and set it as the header value
- Configure the same token in your sipgate AI Flow settings
Security Best Practices:
- Use a cryptographically secure random token
- Store the token securely (environment variables, secret manager)
- Use HTTPS for webhook URLs in production
- Rotate tokens regularly
- Minimum n8n version: 1.0.0
- Tested against: n8n 1.x
- Node.js: >= 18.x
-
Add the Trigger Node
- Add "sipgate AI Flow Trigger" to your workflow
- Configure authentication (recommended: Header Auth)
- Connect different nodes to different outputs based on event type
-
Add Action Nodes
- Use the "sipgate AI Flow" action node to respond to events
- Select the desired operation (Speak, Play Audio, Transfer, Hangup, Barge-In)
- Configure operation-specific parameters
-
Activate Workflow
- Activate your workflow to get the Production webhook URL
- Copy the webhook URL
-
Configure sipgate AI Flow
- Add the webhook URL to your AI Flow configuration
- Set the shared secret (if using Header Auth)
AI Flow Trigger
├─ [Output 1: Session Start]
│ └─ AI Flow → Operation: Speak
│ └─ Text: "Welcome! How can I help?"
│
└─ [Output 2: User Speak]
└─ AI Flow → Operation: Speak
└─ Text: "You said: {{$json.transcript}}"
AI Flow Trigger
├─ [Output 1: Session Start]
│ └─ AI Flow → Speak: "Hello! Say 'booking' or 'support'"
│
├─ [Output 2: User Speak]
│ └─ IF ({{$json.transcript}} contains "booking")
│ ├─ True → AI Flow → Speak: "Processing your booking..."
│ └─ False → IF ({{$json.transcript}} contains "support")
│ ├─ True → AI Flow → Operation: Transfer Call
│ │ └─ Target: +491234567890
│ └─ False → AI Flow → Speak: "Sorry, I didn't understand"
│
├─ [Output 5: User Input Timeout]
│ └─ Function (Count timeouts)
│ └─ IF (count >= 3)
│ ├─ True → AI Flow → Operation: Hangup
│ └─ False → AI Flow → Speak: "Are you there?"
│
└─ [Output 6: Session End]
└─ Database → Log conversation
AI Flow Trigger
├─ [Output 1: Session Start]
│ └─ Read Binary File (hold-music.wav)
│ └─ AI Flow → Operation: Play Audio
│ - Audio Source: Binary Data
│ - Binary Property: data
│
└─ [Output 7: Fallback]
└─ Function → Log Unknown Event
AI Flow Trigger
└─ [Output 2: User Speak]
└─ AI Flow → Operation: Speak
- Text: "Hello in a different voice!"
- TTS Provider: ElevenLabs
- Voice: 21m00Tcm4TlvDq8ikWAM
AI Flow Trigger (Fallback Behavior: All Events)
└─ [Output 7: Fallback]
└─ Switch ({{$json.type}})
├─ case "session_start" → AI Flow → Speak: "Welcome"
├─ case "user_speak" → OpenAI → AI Flow → Speak
└─ default → Function → Log Event
All events include the following session information:
{
"type": "user_speak",
"text": "Hello",
"barged_in": false,
"session": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"account_id": "account-123",
"phone_number": "+491234567890",
"direction": "inbound",
"from_phone_number": "+499876543210",
"to_phone_number": "+491234567890"
}
}Note: Earlier sipgate AI Flow versions delivered the recognized speech as
transcript. The current API usestext. The trigger forwards whatever the API sends, so update workflow expressions accordingly.
The action node generates properly formatted action objects ready for sipgate AI Flow:
{
"type": "speak",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"text": "Hello! How can I help you?",
"user_input_timeout_seconds": 8
}For more details on actions and advanced features, see the sipgate AI Flow API Documentation.
This package includes comprehensive test coverage using Jest.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage report
npm run test:coverage- 42 test cases covering both nodes
- 94%+ statement coverage
- Tests include:
- Node definitions and configurations
- All operations and event types
- Authentication flows
- Event routing logic
- Error handling
- Data transformation
- n8n community nodes documentation
- sipgate AI Flow API Documentation
- sipgate AI Flow LLM Reference
- n8n workflow automation
npm run buildnpm run devnpm run lint
npm run lint:fix# Run tests
npm test
# Watch mode
npm run test:watch
# With coverage
npm run test:coverageSee CHANGELOG.md and the GitHub Releases page.
MIT
sipgate GmbH (aiflow@sipgate.de)