Block 1 - Webhook
- Type / Role
- n8n-nodes-base.webhook - webhook
- Config choices
- Version 2.1
This workflow is provided as-is. Please review and test before using in production.
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...
n8n-nodes-base.webhook, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.respondtowebhook, n8n-nodes-base.if, n8n-nodes-base.wait, n8n-nodes-base.httprequest, n8n-nodes-base.stickynote, n8n-nodes-base.set
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by inderjeet Bhambra.
Original n8n.io sourceThis 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.
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.
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.
Configure credentials:
Activate the workflow:
Download the n8n-magichour HTML tester Click here to download
For image generation, send a POST request with this structure:
{
"action": "generate",
"type": "image",
"parameters": {
"name": "My Image",
"image_count": 1,
"orientation": "landscape",
"style": {
"prompt": "A serene mountain landscape at sunset",
"tool": "realistic"
}
}
}
For video generation, use:
{
"action": "generate",
"type": "video",
"parameters": {
"name": "My Video",
"end_seconds": 5,
"orientation": "landscape",
"resolution": "1080p",
"style": {
"prompt": "A dog running through a field"
}
}
}
Adjust AI prompt optimization: Modify the system prompts in Generate Image Prompt or Generate video Prompt nodes to change how GPT-4.1 refines user inputs. Current prompts enforce strict character limits and avoid unauthorized content.
Change polling intervals: Modify the Wait nodes to adjust how frequently the workflow checks generation status (useful for longer video renders).
Modify response format: Update the Respond to Webhook node to customize the output structure sent back to the caller.
Add multiple output formats: Extend Download Image/Video nodes to save files to cloud storage (Google Drive, S3) instead of just returning via webhook.
Implement queue management: Add a database node before MagicHour.ai calls to queue requests and prevent API rate limiting.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.
| Workflow | Automated AI media creation with MagicHour AI and GPT-4 prompt optimization |
|---|---|
| Complexity | advanced |
| Nodes | 25 |
| Categories | Content Creation, Multimodal AI |
| Author | inderjeet Bhambra |
| Published | 17 Oct 2025 |
Use the JSON export at /data/workflows/9853/9853.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
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...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.