workflows.fit
Back to n8n workflows
n8n templateFreeBy inderjeet Bhambra

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

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...

DevelopmentCore NodesAILangchainUtilityWebhookOpen AiRespond To Webhook
Loading interactive preview...

Template notes

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.

Who's it for

Content creators, marketers, social media managers, and developers who need automated AI media generation at scale. Perfect for teams building applications that require on-demand image or video creation without manual intervention.

How it works

The workflow receives a webhook POST request containing generation parameters (type, orientation, style, duration). GPT-4.1 analyzes and optimizes the user's prompt based on the request type (image or video), then sends it to MagicHour.ai's API. The workflow monitors the generation status through polling loops, downloads the completed media, and returns it via webhook response. Error handling ensures failed requests are captured and reported.

Requirements

- n8n instance (self-hosted or cloud) - MagicHour.ai account with API access (Bearer token) - OpenAI API account for GPT-4.1 access - Basic understanding of webhooks and JSON

How to set up