Image-to-video in n8n: reliable Magic Hour API workflow


You want n8n to turn an image into video, but the important part is what happens after submission. A temporary status-read failure should not send the workflow back to another paid generation request.
This guide separates upload, creation, polling and download so the same job stays identifiable across waits and retries. You’ll see how to store the API credential, retain the returned project ID and save the finished file before its temporary URL expires. Start with one representative image and request, then keep recovery attached to the existing job instead of treating every failed check as a new creation.
Quick answer
Upload the image, submit one Magic Hour Image-to-Video job and store its video-project ID. Poll that same ID and download only after the status is complete. A failed status request retries the read, not the paid generation; keep the API key in an n8n credential.
Test one Image-to-Video API job
Create an API key, upload one rights-cleared image through the documented signed-URL flow, and submit one short job. Save its project ID before adding waits, webhooks or downstream publishing.
Open Image-to-Video API Docs1. Store the Magic Hour API credential
Magic Hour's API quickstart uses bearer authentication. In n8n, create one HTTP Header Auth credential with header name Authorization and value Bearer followed by your API key. Select that credential only on Magic Hour API requests.
n8n's HTTP Request documentation covers credentials, cURL import and file responses. If you import a cURL example, remove its placeholder authorization header and attach the saved credential so only one value is sent.
2. Upload the image bytes
Magic Hour's input and output guide requires three actions: request an asset upload URL, PUT the binary file to that signed URL, then use the returned file_path in the generation request. A local path from the n8n host is not a Magic Hour asset path.
Request the correct file type and extension. Preserve the real MIME type and extension from the upstream binary.
PUT the file bytes to upload_url. Do not attach the Magic Hour bearer credential to the signed storage request.
Save file_path. Requesting an upload URL alone does not upload the image.
3. Submit exactly one Image-to-Video job
Open the current Image-to-Video API reference and import the cURL request into a new HTTP Request node. Use POST https://api.magichour.ai/v1/image-to-video, JSON content type and the saved credential.
Pass assets.image_file_path from the upload step. Choose end_seconds, model, resolution, audio and any optional ending image according to the current schema. Supported durations and fields vary by model; do not copy settings from another model and assume they apply.
Save the response id immediately. Keep the estimated credits_charged value for display or logging, then reconcile the final value after completion.
4. Poll the video project safely
After a Wait node, call Get Video Details with GET https://api.magichour.ai/v1/video-projects/{id}. Insert the saved submit response ID and use the same Magic Hour credential.
draft: inspect the submit path; rendering has not begun.
queued or rendering: wait, then poll the same ID.
complete: continue when the required download is present.
error: stop, store the error object and follow the documented failure behavior.
canceled: stop; do not automatically create a replacement job.
Use a bounded polling interval, backoff for temporary 429, 500 or network failures, and an overall workflow timeout. Keep submission outside the loop.
5. Download before the signed URL expires
When the project is complete, send downloads[0].url to a separate HTTP Request node configured to return a file. Do not select the Magic Hour API credential on the signed download request.
Store the binary in your own destination with the Magic Hour project ID and expires_at value. If the URL expires, fetch the same project details again instead of regenerating the video.
See the image-to-video stage
This Magic Hour browser tutorial demonstrates turning a still image into a moving shot. It illustrates the media operation whose finished file the n8n workflow downloads. The credential, upload, submission and polling steps remain the API instructions above; this recording does not show n8n automation. Watch the source video
Polling, webhooks and recovery
Polling is easiest for a first workflow and detects canceled projects. For higher volume, use Magic Hour webhooks for started, completed and errored events. Deduplicate each business effect using an application-owned key such as account, project ID and notification kind. A project-ID-only key can wrongly suppress completion after a started event for the same project. Retain a bounded recovery poll for missed deliveries; canceled projects do not emit a webhook in the current contract. Follow the secure webhook receiver guide for raw-body signature verification, durable acceptance before 2xx and duplicate-safe worker recovery.
Production checklist
Rights: the image, prompt, voice and intended publication are authorized.
Input validation: file type, aspect ratio, size and selected model fields meet the live endpoint schema.
Idempotency: one internal request owns one Magic Hour project ID.
Quality: subject identity, geometry, text, motion, background, audio and duration pass review.
Cost: estimate is visible before submission and final credits are recorded after completion.
Privacy: retention is defined for source images, generated video, n8n execution data and downstream storage.
Observability: log internal job ID, provider project ID, state changes, elapsed time and terminal error.
Frequently asked questions
No. Upload the binary through Magic Hour's signed upload flow and pass the returned file_path. A path meaningful to the n8n host is not automatically readable by the API.
Use default to follow the account tier's current recommendation, or select an explicit model when its duration, resolution, audio and input contract match the job. Record the exact model because defaults and supported options can change.
Retry only GET /v1/video-projects/{id} with backoff. Never route a polling failure to POST /v1/image-to-video.
Use the browser Image-to-Video tool for a source-quality check or open the Magic Hour API for programmatic access. The text-to-video n8n guide and video face-swap n8n guide cover adjacent job types.

Continue Reading

Video face swap in n8n: reliable Magic Hour API workflow

6 AI APIs for a weekend SaaS: architecture and launch checks (2027)

How to extend a video with AI for free (no sign-up, step-by-step)


