Built with n8n: A Feishu Voice Bot routing to 5 tools (DeepSeek, Groq, Excel gen & Local TTS)

:shield: Feishu Voice Safety Q&A Assistant

An internal AI bot for enterprise safety departments — ask questions in Feishu via text or voice, and retrieve ledger data and regulatory specifications instantly.

![Workflow overview]

Hi everyone,

I’m working on a series of practical n8n automation projects, and today I’d like to share my latest workflow: the Feishu Voice Safety Q&A Assistant.

This is an internal AI bot designed for enterprise safety departments. Safety officers can ask it questions directly in Feishu via text or voice to retrieve ledger data and regulatory specifications.

:package: Workflow file: Feishu Voice Safety Q&A Assistant.json


:rocket: What it does

1) Feishu event ingestion and filtering

Receives Feishu callbacks via Webhook and uses a Code node to enforce:

  • a strict allowlist: ALLOWED_OPEN_IDS
  • a 24-hour message deduplication mechanism

![Event ingestion and filtering]

2) Intelligent speech-to-text

Automatically downloads voice files sent via Feishu and calls Groq’s Whisper model to transcribe them into Chinese text at high speed.

![Speech-to-text]

3) Thinking placeholder to prevent timeouts

When a text question is received, it first quickly replies with a placeholder message:

:thinking: Received, querying, please wait…

Then, once the answer is generated, it directly edits and replaces that message.

![Thinking placeholder]

4) Multi-tool AI Agent

The core uses the DeepSeek chat model and retains the last 8 rounds of context memory (isolated by chatId).

It mounts 5 powerful sub-tools:

# Sub-tool What it does
1 Safety reward & penalty ledger Query safety reward and penalty records
2 Supervision ledger Query supervision/inspection records
3 Safety regulation knowledge base Search safety rules and specifications
4 Excel detail table Generate Excel detail tables directly
5 Monthly trend chart Generate monthly trend charts and send them into the conversation

![Multi-tool AI Agent]

5) Native voice reply

If the user sent voice, the LLM compresses the answer to within 150 characters, calls a local TTS service (192.168.1.26:5002) to synthesize an opus voice file, and finally sends the voice back to the user along the original path.

![Voice reply]


:compass: Workflow at a glance

flowchart TD
    A[Feishu Webhook] --> B[Allowlist + 24h Dedup]
    B --> C[Immediately respond to Feishu<br/>return 200]
    C --> D{Text or Voice?}
    D -->|Voice| E[Download voice file]
    E --> F[Groq Whisper<br/>speech-to-text]
    D -->|Text| G[Text question]
    F --> H[Multi-tool AI Agent<br/>DeepSeek + 8-round memory]
    G --> H
    H --> I[5 sub-tools<br/>ledgers · KB · Excel · charts]
    I --> J{Voice input?}
    J -->|Yes| K[Compress to <=150 chars<br/>Local TTS opus]
    K --> L[Send voice reply]
    J -->|No| M[Reply / edit placeholder<br/>text answer]