Automation tools like n8n allow developers and builders to construct complex media workflows, but handling video or audio processing presents a significant infrastructure challenge.
Traditionally, running FFmpeg commands inside n8n requires customizing your Docker containers, dealing with local storage limits, and running CPU-intensive operations on the same server hosting your database and automation engine.
In this guide, we show you how to execute cloud-scale FFmpeg commands directly from n8n using Xora’s API, keeping your automation flows lightweight and reliable.
1. The Server Dependency Problem
Running media operations directly inside n8n is brittle for several reasons:
- CPU Starvation: A single high-resolution H.264 encode will consume 100% of your host server’s CPU, freezing all other active n8n workflows.
- Docker Bloat: Standard n8n images do not include
ffmpegor necessary media codecs. You must maintain custom Dockerfiles to compile them locally. - Storage Overhead: Downloading multi-gigabyte raw video inputs directly to your local n8n volume can easily fill up disk storage, causing workflow failures.
By shifting execution to Xora’s Cloud FFmpeg API, you replace heavy local processes with a simple, non-blocking HTTP request node. The execution runs on isolated cloud compute, billing you only for the exact seconds consumed.
2. Setting Up the n8n HTTP Request Node
To trigger a media processing job, add an HTTP Request node to your n8n workflow and configure the following parameters:
- Method:
POST - URL:
https://api.xora.sh/v1/jobs - Authentication: Header Auth
- Name:
Authorization - Value:
Bearer YOUR_XORA_API_KEY
- Name:
- Send Headers: True
- Header Name:
Content-Type - Header Value:
application/json
- Header Name:
- Send Body: True
- Body Content Type:
JSON
The Request Payload
Here is a standard payload configuration executing custom FFmpeg arguments to compress a video file:
{ "mode": "ffmpeg", "input_files": { "in_1": "https://example.com/raw-input.mov" }, "output_files": { "out_1": "compressed-output.mp4" }, "ffmpeg": { "args": [ "-i", "{{in_1}}", "-c:v", "libx264", "-crf", "23", "-c:a", "aac", "-b:a", "128k", "{{out_1}}" ] }}3. Practical n8n Media Workflows
Scenario A: Grab a Thumbnail from a URL
To extract a preview image from a video URL at the 5-second mark, use this payload in your HTTP Request node. This seeks immediately, avoiding downloading the entire file to your server:
{ "mode": "ffmpeg", "input_files": { "in_1": "https://example.com/raw-input.mov" }, "output_files": { "out_1": "thumbnail.jpg" }, "ffmpeg": { "args": [ "-ss", "5.0", "-i", "{{in_1}}", "-vframes", "1", "-f", "image2", "{{out_1}}" ] }}Scenario B: Trimming and Compressing
To cut the first 10 seconds of a raw source video and compress it for web playback:
{ "mode": "ffmpeg", "input_files": { "in_1": "https://example.com/raw-input.mov" }, "output_files": { "out_1": "trimmed-clip.mp4" }, "ffmpeg": { "args": [ "-ss", "00:00:00", "-t", "10", "-i", "{{in_1}}", "-c:v", "libx264", "-crf", "24", "{{out_1}}" ] }}4. Handling Async Completions with Webhooks
Media transcoding takes time. Instead of keeping the n8n HTTP Request node waiting, execute jobs asynchronously by adding a webhook callback.
When submitting the job, include a webhook_url pointing to an n8n Webhook Node:
{ "mode": "ffmpeg", "input_files": { "in_1": "https://example.com/raw-input.mov" }, "output_files": { "out_1": "output.mp4" }, "ffmpeg": { "args": ["-i", "{{in_1}}", "-c:v", "libx264", "-crf", "23", "{{out_1}}"] }, "webhook_url": "https://your-n8n-instance.com/webhook/xora-callback-id"}Writing the Callback Handler
- Add an n8n Webhook Node set to listen to
POSTrequests. - When the job completes, Xora will POST a payload containing the final status, file links, and detailed compute execution times.
- Parse this payload to trigger down-stream actions, such as emailing the finished download link, updating a Airtable record, or uploading the output to Slack.