Automated AI media creation with MagicHour AI and GPT-4 prompt optimization
Ready for 3.0What 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.
- If: checks a condition and branches into true / false
- Get Data from Webhook (Edit Fields (Set)): sets 7 fields: body.prompt, body.parameters.style.tool, body.parameters.name…
- Edit Fields (Edit Fields (Set)): sets 5 fields: body.prompt, body.parameters.name, body.parameters.end_seconds…
- Generate Image Prompt (OpenAI): uses OpenAI
- Generate video Prompt (OpenAI): uses OpenAI
- ai-image-generator (HTTP Request): calls api.magichour.ai (POST)
- text-to-video (HTTP Request): calls api.magichour.ai (POST)
- If: checks a condition and branches into true / false
- Get Error Details (Edit Fields (Set)): sets 4 fields: error.message, error.code, error.status…
- If: checks a condition and branches into true / false
…plus 9 more steps. See the full node list below.
Services it uses
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)
- Webhook
n8n-nodes-base.webhook - OpenAI
@n8n/n8n-nodes-langchain.openAi - Respond to Webhook
n8n-nodes-base.respondToWebhook - If
n8n-nodes-base.if - Wait
n8n-nodes-base.wait - HTTP Request
n8n-nodes-base.httpRequest - Edit Fields (Set)
n8n-nodes-base.set
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.…