DEV Community

Adam King
Adam King

Posted on Originally published at pennycompute.com

Render a Remotion composition from n8n or Make with one HTTP request

You already have a Remotion bundle on a public URL, and you want n8n or Make to render it without standing up your own Chrome and FFmpeg box. This walkthrough uses PennyCompute's remotion.render.v1 job through a generic HTTP request: submit the job, poll until it finishes, then fetch the output URL. The same job is documented on the Remotion rendering guide. Field names and paths below are taken from the public OpenAPI document at https://api.pennycompute.com/openapi.json (buyer API 1.10.2).

There is no official n8n or Make app for PennyCompute, and no published community node. Use the built-in HTTP Request node in n8n, or the HTTP module in Make.

What you need

  • A public serve_url that points at the bundled Remotion site (the index.html written by npx remotion bundle). The renderer opens that URL in its own browser, so keep the bundle readable until the job has ended. Build the bundle with Remotion 4.0.530, the version the renderers run; the bundle carries its own React. Bundle every font the composition draws with: system fonts differ between renderers.
  • The composition_id to render.
  • Optional JSON input_props for the composition. For props too large to send in the request, use input_props_url instead, not together with a non-empty input_props.
  • A PennyCompute account and a server API key from https://app.pennycompute.com. Store the key as a secret in n8n or Make, and send it as Authorization: Bearer $PENNY_API_KEY on every API call. Do not put the key in a public workflow.

A new account starts with $5 in its prepaid balance. Failed, cancelled and expired jobs are not charged.

What a Remotion job costs

Live Remotion rates are on https://pennycompute.com/pricing: $0.0037 per render, plus $0.0048 per minute of output up to 1080p, or $0.017 per minute above 1080p.

POST /v1/jobs/estimate takes the same service_id and input as a job. It creates no job and reserves nothing. You can run an estimate from the same HTTP node or module before you submit.

Submit the render

Base URL: https://api.pennycompute.com.

In n8n, add an HTTP Request node. In Make, add an HTTP module. Set:

  • Method: POST
  • URL: https://api.pennycompute.com/v1/jobs
  • Headers:
    • Authorization: Bearer $PENNY_API_KEY
    • Content-Type: application/json
    • Idempotency-Key: a unique string between 8 and 128 characters for this attempt (for example a UUID). The API requires this header on POST /v1/jobs. Re-sending the same key returns the same job instead of creating a second one.
  • Body, JSON:
{
  "service_id": "remotion.render.v1",
  "input": {
    "serve_url": "https://example.com/your-bundle/index.html",
    "composition_id": "HelloWorld",
    "input_props": {
      "title": "Hello from n8n"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

serve_url and composition_id are required. With nothing else set, a render is H.264 in an MP4 at CRF 18 with the x264 preset medium, frames captured as JPEG at quality 80, yuv420p, and AAC sound at 320 kbps and 48,000 Hz. A composition with no sound gets no sound stream unless enforce_audio_track is true. Hardware encoding is off. Optional fields such as output_container (mp4, webm, or mov), video_codec, frame_range, still_frame, and remote_assets are documented in the OpenAPI schema RemotionRenderInput.

The response includes a job id and a status. Save the id.

The same request as curl, if you want to test the body before wiring the workflow:

curl -sS https://api.pennycompute.com/v1/jobs \
  -H "Authorization: Bearer $PENNY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "service_id": "remotion.render.v1",
    "input": {
      "serve_url": "https://example.com/your-bundle/index.html",
      "composition_id": "HelloWorld",
      "input_props": { "title": "Hello from n8n" }
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Poll until it finishes

Add a second HTTP Request (n8n) or HTTP module (Make):

  • Method: GET
  • URL: https://api.pennycompute.com/v1/jobs/{{job_id}}
  • Header: Authorization: Bearer $PENNY_API_KEY

Repeat until status is succeeded, failed, cancelled, or expired. In n8n, a Wait node plus a loop or an "Until" condition on that status field is enough. In Make, use a sleep plus a repeater, or a webhook if you registered one ahead of time (specification.webhook_endpoint_id on the job). Do not tight-loop without a pause.

If the status is not succeeded, stop. Failed, cancelled and expired jobs are not charged.

Fetch the file

When the job has succeeded, add one more HTTP request:

  • Method: GET
  • URL: https://api.pennycompute.com/v1/jobs/{{job_id}}/output
  • Header: Authorization: Bearer $PENNY_API_KEY

The body is a JSON object with a url field. The file is kept for three days. The GET on that file URL does not use the API key. Download or hand the URL to the next step in the workflow.

Optional: cancel

POST https://api.pennycompute.com/v1/jobs/{{job_id}}/cancel with an empty JSON object {} and the same Authorization header cancels a job that has not already finished.

Notes

  • POST /v1/jobs/estimate uses the same body as submit, and does not take an Idempotency-Key.
  • You can also send FFmpeg services from the same HTTP node, for example ffmpeg.transcode.v1 or ffmpeg.stitch_export.v1, by changing service_id and input. FFmpeg rates are separate: $0.0075 per minute of HD output, $0.00375 for SD and $0.015 for 4K, billed by the second, with a ten-second minimum per output. For FFmpeg estimates, price_is_final is false; the completed job is billed for the length of its actual output.
  • MiniMax H3 is limited/early and is not used in this walkthrough.

Top comments (0)