Templates / Automated AI media creation with MagicHour AI and GPT-4 prompt optimization

Automated AI media creation with MagicHour AI and GPT-4 prompt optimization

Ready for 3.0

by inderjeet Bhambra ✓ · 230 views · created 2025-10-17 · Content Creation, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 20 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI. It also calls api.magichour.ai over HTTP.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. If: checks a condition and branches into true / false
  2. Get Data from Webhook (Edit Fields (Set)): sets 7 fields: body.prompt, body.parameters.style.tool, body.parameters.name…
  3. Edit Fields (Edit Fields (Set)): sets 5 fields: body.prompt, body.parameters.name, body.parameters.end_seconds…
  4. Generate Image Prompt (OpenAI): uses OpenAI
  5. Generate video Prompt (OpenAI): uses OpenAI
  6. ai-image-generator (HTTP Request): calls api.magichour.ai (POST)
  7. text-to-video (HTTP Request): calls api.magichour.ai (POST)
  8. If: checks a condition and branches into true / false
  9. Get Error Details (Edit Fields (Set)): sets 4 fields: error.message, error.code, error.status…
  10. If: checks a condition and branches into true / false

…plus 9 more steps. See the full node list below.

Services it uses

OpenAI

HTTP calls to: api.magichour.ai

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (7)

From the author

This workflow automates AI-powered image and video generation using MagicHour.ai's API, enhanced by GPT-4.1 for intelligent prompt optimization. It processes webhook requests, refines prompts using AI, generates media content, and returns the final output.…

Excerpt from inderjeet Bhambra's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.