Skip to main content

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​

  1. Create an API key at mediasfu.com/api-keys. Start with a sandbox key; it creates sandbox rooms (IDs start with s).
  2. In n8n, add a MediaSFU API credential with your API username and API key.
  3. 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​

ResourceOperations
Agent CallStart Agent Call, Get State, Get Summary, Get Transcript, Hand to Agent, Hand to Person, End
RoomCreate, Get Join Link, Get, Get Many, End
RecordingGet Many (optionally for one room)
AccountGet 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​

EventFires when
Room Started / Room EndedA room is created or ends
Recording Ready / Recording FailedA recording finished processing
Participant Joined / LeftSomeone joins or leaves a room
Phone Call EndedA call on your number ends: caller, number, duration, whether the agent answered
Phone Call Summary ReadyThe AI summary of a call is ready, with the transcript
Callback RequestedThe caller booked a callback (the PIN is never passed on)
Human Handoff RequestedThe 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.

  1. MediaSFU Trigger, event Phone Call Summary Ready, with your number's secure code as the call webhook token.
  2. IF: summary contains "call back" or "callback".
  3. True branch: Slack (or email) to the front desk with caller, summary and durationSeconds.
  4. Both branches: Google Sheets (or your CRM) appends caller, calledNumber, summary and timestamp.

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​

SymptomFix
Credential test failsCheck the API username and key; the header is built for you
Trigger never fires for room eventsn8n 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 401The number's secure code and Call Webhook Token must match
Start Agent Call says the initiator was not foundJoin the room under Initiator Name before starting the call

More​