Automate MediaSFU with n8n
Add MediaSFU to your n8n workflows: start an outbound AI agent call from a form,
CRM or schedule, create a room and send its link, and act on a call summary,
a finished recording or a room that just ended. The n8n-nodes-mediasfu
community node adds two nodes, MediaSFU (actions) and MediaSFU Trigger.
1. Install the node
In a self-hosted n8n, open Settings → Community Nodes → Install, enter:
n8n-nodes-mediasfu
and accept the prompt. From the command line instead, run
npm install n8n-nodes-mediasfu in your n8n custom-nodes folder and restart n8n.
Check it works: search for "MediaSFU" in the node panel; both nodes appear.
2. Add your credentials
- Create an API key at mediasfu.com/api-keys.
Start with a sandbox key; it creates sandbox rooms (IDs start with
s). - In n8n, add a MediaSFU API credential with your API username and API key.
- Leave Base URL as
https://mediasfu.com.
n8n tests the credential by reading your balance. The key stays in n8n's credential store and is sent only to MediaSFU.
3. Use the actions
| Resource | Operations |
|---|---|
| Agent Call | Start Agent Call, Get State, Get Summary, Get Transcript, Hand to Agent, Hand to Person, End |
| Room | Create, Get Join Link, Get, Get Many, End |
| Recording | Get Many (optionally for one room) |
| Account | Get Balance |
Start Agent Call phones a number from one of your SIP numbers, and the AI agent attached to that number talks. It needs a live room created with Allow Phone Calls, with someone already in it under Initiator Name. Fill in purpose, objective, reference ID and a short script so the agent knows why it is calling.
Create can turn on phone calls, live translation, low-bandwidth video,
recording and a per-room webhook. The output includes meetingID and
publicURL, ready for an email or chat message.
The MediaSFU node also works as a tool for n8n's AI Agent node.
4. Use the trigger
| Event | Fires when |
|---|---|
| Room Started / Room Ended | A room is created or ends |
| Recording Ready / Recording Failed | A recording finished processing |
| Participant Joined / Left | Someone joins or leaves a room |
| Phone Call Ended | A call on your number ends: caller, number, duration, whether the agent answered |
| Phone Call Summary Ready | The AI summary of a call is ready, with the transcript |
| Callback Requested | The caller booked a callback (the PIN is never passed on) |
| Human Handoff Requested | The agent asked for a person to take over, with priority and reason |
Your n8n must be reachable over public HTTPS for MediaSFU to deliver events.
Room events. With Automatic setup, activating the workflow points your account's room webhook at the trigger with a fresh signing secret, and every request is checked against it. If your account already sends room events somewhere else, the trigger asks you to turn on Replace Existing Webhook; the previous URL comes back when you deactivate the workflow. With Manual setup, pass the trigger's URL as the room's webhook when you create it and enter that room's signing secret in Room Webhook Secret. Unsigned or wrongly signed requests are rejected.
Phone call events. In the MediaSFU dashboard, open Phone & SIP Setup for your number. Set its webhook URL (call ended, summary, handoff) and its callback webhook URL (callback requested) to the trigger's production URL, and enter the number's secure code in Call Webhook Token. Requests without the matching token are rejected.
Example: AI receptionist follow-up
Send every call your AI receptionist handles to your team, with the summary.
- MediaSFU Trigger, event Phone Call Summary Ready, with your number's secure code as the call webhook token.
- IF:
summarycontains "call back" or "callback". - True branch: Slack (or email) to the front desk with
caller,summaryanddurationSeconds. - Both branches: Google Sheets (or your CRM) appends
caller,calledNumber,summaryandtimestamp.
Activate the workflow, call your number, and hang up after a short conversation. A row appears in the sheet within a few seconds of the summary.
A ready-made receptionist service with prompts for business hours and after hours is in the AI receptionist starter.
Common problems
| Symptom | Fix |
|---|---|
| Credential test fails | Check the API username and key; the header is built for you |
| Trigger never fires for room events | n8n must be on public HTTPS without a custom port; activate the workflow, not just test it |
| "Your MediaSFU account already sends room events to …" | Turn on Replace Existing Webhook, or use manual setup per room |
| Phone call events return 401 | The number's secure code and Call Webhook Token must match |
| Start Agent Call says the initiator was not found | Join the room under Initiator Name before starting the call |
More
- Reference for AI tools: every request the node makes, in one page.
- AI call control: handing live calls between the agent and a person.
- MediaSFU MCP: the same account actions from an AI assistant.