

To automate text-to-video in n8n, send one POST request to Magic Hour, save the returned video-project ID, and poll that same project until its status is complete. Download the first output URL only after completion. A delayed status response is not a reason to submit another paid generation.
This workflow was checked against the current Magic Hour and n8n documentation on September 13, 2026. Model names, supported durations, aspect ratios, resolution and credit estimates can change, so copy the current schema before deploying a workflow.
Copy the current request schema, create one short job, preserve its project ID, and prove the complete polling and download path before scaling the workflow.
Open Text-to-Video API DocsTrigger and validate. Require a non-empty prompt and any job-specific settings.
Submit once. POST one text-to-video request and capture the returned id.
Preserve the project ID. Keep it with the workflow execution before any wait or retry.
Wait, then poll. GET the same video project until it reaches a terminal status.
Route the result. Download complete jobs; stop and report error or canceled jobs.
Store the file and metadata. Persist the video, project ID, prompt, settings, final status and credits charged.
Open the Magic Hour API page to run a sample and create an API key in the Developer Hub. In n8n, create a generic Header Auth credential with the header name Authorization and the value Bearer followed by the API key. Select the same saved credential on both Magic Hour HTTP Request nodes. Do not paste the real key into a shared workflow export.
n8n’s HTTP Request documentation supports generic Header Auth and importing cURL. Importing the Magic Hour example is a useful starting point, but n8n imports parameter values as strings. Switch the body to JSON and keep numbers and booleans as their actual types.
Use a Manual Trigger while building. Before the POST node, add an If or Edit Fields node that requires a non-empty prompt. Set explicit defaults for duration, aspect ratio, resolution, model and audio instead of accepting arbitrary incoming values.
Validate those settings against the selected model. The current Text-to-Video API reference lists different supported durations, aspect ratios and resolutions by model. An allowed value for one model can be rejected by another.
Add an HTTP Request node named Submit Text-to-Video with method POST and URL https://api.magichour.ai/v1/text-to-video. Select the saved Header Auth credential, send Content-Type application/json, choose a JSON body, and start with a short request:
unknown nodeThe example uses a current documented model and a five-second landscape output. Replace the prompt with your trigger field and choose model-specific values from the live reference. The successful POST response includes id and credits_charged. Treat the initial credit value as an estimate until the project completes.
Immediately after the POST, add an Edit Fields node named Keep Project ID. Store the response id as project_id and retain any business key needed to connect the finished video to the source record. If the workflow stops later, resume from project_id rather than submitting a new job.
This is the main duplicate-charge guard. Disable automatic retries on the POST unless your surrounding system can prove that no project was created. A network timeout after submission is ambiguous: check your stored state and Magic Hour projects before sending another POST.
Add an n8n Wait node after Keep Project ID, then add a second HTTP Request node with method GET:
unknown nodeSelect the same Magic Hour credential. The Get Video Details endpoint returns draft, queued, rendering, complete, error or canceled. Route them explicitly:
queued or rendering: wait again, then GET the same project ID.
complete: continue only when downloads contains an output.
error: stop, record the error object and do not resubmit automatically.
canceled: stop and record that the job was canceled.
draft or an unknown value: send the execution to manual review.
Keep a poll counter or elapsed-time deadline and stop cleanly when it is exceeded. Processing time depends on the model, duration and queue; consult the current processing-time guidance instead of assuming one fixed delay proves completion.
For a complete job, read downloads[0].url. Use a separate HTTP Request node configured to download a file. Do not attach the Magic Hour API Authorization header to the output URL; it is a separate signed download location.
The project response includes expires_at for each download. Save the file promptly to your own storage, then persist the project ID, final status, prompt, model, duration, aspect ratio, resolution, credits charged and destination URL or object key.
401 unauthorized: verify the saved Header Auth credential and the Bearer prefix.
402 insufficient credits: stop before polling and route the execution for account action.
400 or 422 request error: compare every field with the current selected-model schema.
429 or temporary 5xx while polling: wait and retry the GET request within a bounded policy.
timeout after POST: treat the result as ambiguous; do not assume the job was never created.
error or canceled project: record the terminal state and require an intentional new submission.
Keep the API key only in an n8n credential.
Validate model, duration, aspect ratio, resolution and audio before the POST.
Store the project ID immediately after submission.
Bound the polling interval, attempt count and total elapsed time.
Never turn a delayed GET into an automatic second POST.
Download completed outputs before the signed URL expires.
Keep the source prompt and settings beside the output for audit and reruns.
Review the complete video before any automated publication step.
For broader API selection, input types and cost comparison, use the multimodal video API guide. If a workflow later needs uploaded image, video or audio inputs, follow Magic Hour’s input and output workflow and use the returned file_path rather than assuming an arbitrary public URL is accepted.
No. The generic HTTP Request, Edit Fields, Wait and If nodes are enough to submit, track and download a Magic Hour video project.
Submit once, persist the returned project ID, and retry only the GET status request. A timeout or temporary polling failure does not establish that the original POST failed.
Only complete means the render succeeded and downloads should contain the output. queued and rendering are non-terminal; error and canceled are terminal failure paths.
Polling is the simplest n8n workflow. Magic Hour also documents video.started, video.completed and video.errored events. Even with webhooks, reconcile stored project IDs because a canceled job does not emit a cancellation webhook.
Text-to-video starts from a prompt. For image-led or audio-led generation, use the corresponding API and its current schema. Upload required assets through the documented upload flow and pass the returned file_path.
