This workflow corresponds to n8n.io template #9853 — we link there as the canonical source.
This workflow follows the HTTP Request → OpenAI recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "PwD9bKQiuu5Rtufl",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "AI Image Generation with MagicHour",
"tags": [],
"nodes": [
{
"id": "f00a60e4-3025-4561-8e82-a737b69ce1e6",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-2208,
-960
],
"parameters": {
"path": "generate-image",
"options": {
"allowedOrigins": "*"
},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2.1
},
{
"id": "6ee2c66f-5cb2-43ca-9cae-c73bb908d1fb",
"name": "Generate Image Prompt",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-1344,
-1232
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "GPT-4.1"
},
"options": {
"topP": 1,
"temperature": 0.5
},
"messages": {
"values": [
{
"content": "=Generate a comprehensive and detailed image generation prompt from {{ $json.body.prompt }} for AI image generation model as input. Use the following information:\n\n**Subject**: AI generated\n**Image Count**: {{ $json.body.parameters.image_count }}\n**Orientation**: {{ $json.body.parameters.orientation }}\n**Style**: {{ $json.body.parameters.style.tool }}"
},
{
"role": "system",
"content": "=## Purpose\nYou are a prompt-generation agent. Your task is to convert structured user input into a clean, descriptive prompt suitable for text-to-image generation models (e.g., RunwayML, Stability AI, Midjourney). You do not generate images yourself. You must never invent or infer content beyond what is explicitly provided.\n\n---\n\n## Generate Subject\n- **Subject**: \n - **ANALYZE** the user prompt carefully to create a subject. Make sure the subject is precisely inline with user expectation and their tone. \n\n## Generate Characters\n- **Character list**: \n - Create a character list based on their roles in the user prompt\n - Create authentic appearance, clothing when any religious prompt is provided\n\n## Output Requirements\n- Generate a **non-empty prompt** that is **\u22641000 characters**, measured in UTF-16 code units.\n- The prompt must be:\n - Grammatically correct\n - Visually descriptive\n - Free of filler, emotional tone, or interpretation unless explicitly provided\n - Strictly limited to elements present in the input\n - NO USE OF \"\". ONLY use ''\n\n---\n\n## Input Expectations\nYou will receive structured input containing:\n- **Style**: visual style (e.g., realistic, cinematic, flat vector, watercolor)\n- **Scene details**: setting, objects, characters\n- **Text overlays** (if any): exact wording and placementl\n- **Aspect ratio or dimensions** (optional)\n\nIf any required field is missing or ambiguous, you must request clarification. Do not guess or proceed with assumptions.\n\n---\n\n## Prompt Format\nProduce a single prompt string suitable for direct use in a text-to-image API. Example:\n\n> \"A realistic portrait of a Sikh man in traditional attire standing in front of the Golden Temple at sunrise, with soft lighting and warm tones. No text overlay.\"\n\n---\n\n## Constraints\n- Do **not** add characters, objects, settings, or styles not present in the input.\n- Do **not** infer emotional tone, symbolism, or narrative unless explicitly described.\n- Do **not** include fantasy, surreal, or fictional elements unless requested.\n- Do **not** include political figures, celebrities, or religious icons unless authorized.\n- Do **not** exceed 500 UTF-16 characters under any circumstance.\n- Do **not** use double quotes. Output should be JSON compatible\n\n\n---\n\n## Character Control\n- Only include characters listed in the input.\n- Do **not** invent names, faces, roles, or behaviors.\n- If a character is referenced without description, request clarification.\n\n---\n\n## Typography & Text Rules\n- Use only text explicitly provided.\n- Do **not** add slogans, captions, or labels unless specified.\n- Font style, size, color, and placement must match instructions.\n\n---\n\n## Clarification Logic\nIf the input is vague, contradictory, or incomplete:\n- **Pause prompt generation**\n- **Respond with a clarification request**\n- Do **not** guess or proceed with assumptions\n\n---\n\n## Integration Notes\n- Designed for use in automated workflows (e.g., n8n, Zapier, API pipelines)\n- Output is a single prompt string for downstream image generation\n- Compatible with models that accept natural language input and enforce character limits (e.g., RunwayML, Stability AI)\n"
}
]
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "c623f5ca-8b61-471f-958a-fe631a344af1",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1216,
-976
],
"parameters": {
"options": {}
},
"typeVersion": 1.4
},
{
"id": "941f585d-52aa-4a34-bf38-04c7a6c8c3fe",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-1920,
-1104
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "08c86a8b-f2a8-4a5d-99a3-dc1079267c87",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.type }}",
"rightValue": "image"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "cb6e7ecb-a20e-40b1-9c98-dd1cd788a560",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
16,
-1216
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "0a9dc79f-32b5-4ca6-a4f1-beb656b3acc6",
"name": "Get Image Details",
"type": "n8n-nodes-base.httpRequest",
"position": [
256,
-1136
],
"parameters": {
"url": "=https://api.magichour.ai/v1/image-projects/{{ $('ai-image-generator').item.json.id }}",
"options": {},
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "6c753ca8-98c1-4a8a-9e04-6d69094d731b",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
544,
-1136
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "e240e5dc-6bdf-47a3-85c4-098b5e3235fc",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "complete"
},
{
"id": "cfeb1810-471d-438a-ad2c-f2bf14124616",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "error"
},
{
"id": "5b+1234567890f1a-bc59-7e55c51d83ff",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "cancelled"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "c1d25e83-a30a-4f2d-84cf-d4a6a86e646b",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-16,
-1568
],
"parameters": {
"width": 416,
"height": 576,
"content": "## The image can be one of the following status\n\n**draft** - not currently used\nqueued - the job is queued and waiting for a GPU\n**rendering** - the generation is in progress\n**complete** - the image is successful created\n**error** - an error occurred during rendering\n**canceled** - image render is canceled by the user\n\n**IF Loop** is to check if the Image processing has completed at the backend or not."
},
"typeVersion": 1
},
{
"id": "deb09fda-0660-4c02-a3cc-1c022bf44b9e",
"name": "If2",
"type": "n8n-nodes-base.if",
"position": [
-640,
-960
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "19a5f814-1943-49b7-97b6-e0af31eee57b",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.id }}",
"rightValue": ""
},
{
"id": "deea2b1d-a20d-4a8f-911c-02518bcad2ad",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.credits_charged }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "f4c83f1a-e23c-496c-8594-6f4d2301798d",
"name": "Download Image",
"type": "n8n-nodes-base.httpRequest",
"position": [
832,
-1152
],
"parameters": {
"url": "={{ $json.downloads[0].url }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "dfdccb9b-0ee4-42ea-adb7-0ebc652efe9f",
"name": "Generate video Prompt",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-1360,
-704
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "GPT-4.1"
},
"options": {
"topP": 1,
"temperature": 0.6
},
"messages": {
"values": [
{
"content": "=Generate a comprehensive and detailed video generation prompt from {{ $json.body.prompt }} for AI image generation model as input. Use the following information:\n\n**Subject**: AI generated\n**Duration**: {{ $json.body.parameters.end_seconds }}\n**Orientation**: {{ $json.body.parameters.orientation }}\n**Resolution**: {{ $json.body.parameters.resolution }}"
},
{
"role": "system",
"content": "=## \ud83d\udd39 Purpose\nYou are a prompt-generation agent. Your task is to convert minimal or structured user input into a clean, descriptive prompt suitable for text-to-video generation models (e.g., RunwayML Gen-2, Pika, Luma). You do not generate videos yourself. You must never invent characters, narrative arcs, or symbolic meaning beyond what is explicitly provided or reasonably inferred.\n\n---\n\n## \ud83d\udd39 Output Requirements\n- Generate a **non-empty**, grammatically correct prompt string\n- Output must be **\u22641000 UTF-16 characters**\n- Prompt must be:\n - Visually descriptive\n - Free of emotional tone or interpretation unless specified\n - Strictly limited to elements provided or inferred from context\n - Suitable for direct use in a text-to-video API\n\n---\n\n## \ud83d\udd39 Input Expectations\nYou may receive minimal or structured input containing:\n- **Subject or concept** (e.g., \u201ctwo world leaders playing chess\u201d)\n- **Duration** (e.g., 5 seconds)\n- **Style** (e.g., realistic, cinematic, animated)\n- **Optional details**:\n - Characters\n - Setting\n - Scene breakdown\n - Audio/narration\n - Text overlays\n - End frame instructions\n\n---\n\n## \ud83d\udd39 Default Handling Logic\nIf specific details are missing, apply the following default assumptions:\n\n- **Characters**: Represent as generic silhouettes or neutral figures unless described\n- **Setting**: Default to a neutral indoor space with soft lighting\n- **Scene Breakdown**: Use a single continuous shot with minimal movement\n- **Audio/Narration**: Assume silence unless ambient sound or narration is specified\n- **Text Overlays**: Assume no text unless explicitly requested\n- **Transitions**: Use hard cuts or static framing unless otherwise described\n\n---\n\n## \ud83d\udd39 Output Format\nProduce a single prompt string. Example:\n\n> \"A 5-second cinematic video showing two silhouetted world leaders seated across a chessboard in a dimly lit formal room. One leader makes a move while the other watches intently. The camera remains static. No narration or text overlay.\"\n\n---\n\n## \ud83d\udd39 Constraints\n- Do **not** add characters, symbols, or narrative elements not present or implied\n- Do **not** infer emotional tone, symbolism, or political meaning\n- Do **not** include fantasy, surreal, or fictional content unless requested\n- Do **not** include political figures, celebrities, or religious icons unless authorized\n\n---\n\n## \ud83d\udd39 Clarification Logic\nIf the input is contradictory or dangerously vague:\n- **Pause prompt generation**\n- **Respond with a clarification request**\n- Do **not** guess or proceed with assumptions that could misrepresent intent\n\n---\n\n## \ud83d\udd39 Integration Notes\n- Designed for use in automated workflows (e.g., n8n, Zapier, API pipelines)\n- Output is a single prompt string for downstream video generation\n- Compatible with models that accept natural language input and enforce character limits\n"
}
]
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "a18904cc-6f73-494c-903a-8b074159218d",
"name": "Edit Fields2",
"type": "n8n-nodes-base.set",
"position": [
-1568,
-688
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "3e45a85a-be16-480c-8ce9-f9fe7ae07ba5",
"name": "body.prompt",
"type": "string",
"value": "={{ $('Webhook').item.json.body.parameters.style.prompt }}"
},
{
"id": "d1742fce-32ae-4d00-940b-7a6e341f90f7",
"name": "body.parameters.name",
"type": "string",
"value": "={{ $('Webhook').item.json.body.parameters.name }}"
},
{
"id": "b32892cc-7b6b-4ad7-a24f-27e93bc99364",
"name": "body.parameters.end_seconds",
"type": "number",
"value": "={{ $('Webhook').item.json.body.parameters.end_seconds }}"
},
{
"id": "69b8e6de-23dd-4fd1-b31c-a63fbf52b6c9",
"name": "body.parameters.orientation",
"type": "string",
"value": "={{ $('Webhook').item.json.body.parameters.orientation }}"
},
{
"id": "6e6c76ad-a508-497c-9e35-66f0aa0798a9",
"name": "body.parameters.resolution",
"type": "string",
"value": "={{ $('Webhook').item.json.body.parameters.resolution }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "56c92629-de44-455a-bdea-a8af21a436f3",
"name": "Get Data from Webhook",
"type": "n8n-nodes-base.set",
"position": [
-1568,
-1232
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "3e45a85a-be16-480c-8ce9-f9fe7ae07ba5",
"name": "body.prompt",
"type": "string",
"value": "={{ $json.body.parameters.style.prompt }}"
},
{
"id": "4c8bbfdd-15e9-4e4b-8d85-2c3ed5048738",
"name": "body.parameters.style.tool",
"type": "string",
"value": "={{ $json.body.parameters.style.tool }}"
},
{
"id": "e75c66ce-03a8-486b-a761-a362e2a0236f",
"name": "body.parameters.name",
"type": "string",
"value": "={{ $json.body.parameters.name }}"
},
{
"id": "93503d53-a707-406c-81c2-5062b06391b6",
"name": "body.parameters.image_count",
"type": "number",
"value": "={{ $json.body.parameters.image_count }}"
},
{
"id": "5a10f233-78cb-4b87-b3cd-61f087f947ff",
"name": "body.parameters.orientation",
"type": "string",
"value": "={{ $json.body.parameters.orientation }}"
},
{
"id": "909e57e2-5fa4-4647-94ec-7143be75062f",
"name": "body.type",
"type": "string",
"value": "={{ $json.body.type }}"
},
{
"id": "6271c772-a93a-4495-af5b-694e23483d79",
"name": "body.action",
"type": "string",
"value": "={{ $json.body.action }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "33d63aeb-a2ad-4828-ac5a-43fac9794aac",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1104,
-1600
],
"parameters": {
"width": 384,
"height": 592,
"content": "## POST Request\n\n**Add credentials** for the MagicHour.ai and the make sure the body content has the JSON in following format;\n\n```\n{\n \"name\": \"<String>\",\n \"image_count\": <Number>,\n \"orientation\": \"<String>\",\n \"style\": {\n \"prompt\": \"<String>\",\n \"tool\": \"<String>\"\n }\n}\n```"
},
"typeVersion": 1
},
{
"id": "424e2d3a-93dc-4415-963b-f10f1fdbe092",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
736,
-1376
],
"parameters": {
"width": 336,
"height": 832,
"content": "## GET Request\n\n**GET** request to download the created Image or the video file\n"
},
"typeVersion": 1
},
{
"id": "27979d9b-1e87-4777-b935-175d58acdf31",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1104,
-960
],
"parameters": {
"width": 368,
"height": 416,
"content": "## POST Request\n\nThe **POST Request** responds back with Id\n\n```\n{\n \"id\": \"cuid-example\",\n \"estimated_frame_cost\": 450,\n \"credits_charged\": 450\n}\n\n```"
},
"typeVersion": 1
},
{
"id": "9321dada-7ef9-42bd-9b4b-e405de84ae3f",
"name": "If3",
"type": "n8n-nodes-base.if",
"position": [
-352,
-1088
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "69e57e0d-864d-4080-a8a8-1cf933308e79",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $item(\"0\").$node[\"Webhook\"].json[\"body\"][\"type\"] }}",
"rightValue": "image"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "69469d82-f353-4c10-a31d-fbb5414f6718",
"name": "Get Error Details",
"type": "n8n-nodes-base.set",
"position": [
192,
-256
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "817f5e6f-6548-49b2-834b-9a9199a63c06",
"name": "error.message",
"type": "string",
"value": "={{ $json.error.message }}"
},
{
"id": "80b4427b-7157-41e1-b694-dfe214cd4c1c",
"name": "error.code",
"type": "string",
"value": "={{ $json.error.code }}"
},
{
"id": "37299c90-153c-48d1-b21b-f4c8c97e97d3",
"name": "error.status",
"type": "number",
"value": "={{ $json.error.status }}"
},
{
"id": "712965ae-c018-4dbf-84c5-d031e76214ae",
"name": "finish_reason",
"type": "string",
"value": "={{ $json.finish_reason }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "79aa3064-f37f-4bbb-bfde-d9dba40a5975",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
-464
],
"parameters": {
"width": 384,
"height": 352,
"content": "## Capture Errors from HTTP run\n\nThis will catch any errors in running the HTTP Post request. \n\nThis **does not** capture the errors from generating Image or Video\n"
},
"typeVersion": 1
},
{
"id": "205e235d-fac9-4288-983d-b1b31407f0dc",
"name": "ai-image-generator",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
-976,
-1232
],
"parameters": {
"url": "https://api.magichour.ai/v1/ai-image-generator",
"method": "POST",
"options": {},
"jsonBody": "={\n \"name\": \"{{ $('Get Data from Webhook').item.json.body.parameters.name }}\",\n \"image_count\": {{ $('Get Data from Webhook').item.json.body.parameters.image_count }},\n \"orientation\": \"{{ $('Get Data from Webhook').item.json.body.parameters.orientation }}\",\n \"style\": {\n \"prompt\": \"{{ $json.message.content }}\",\n \"tool\": \"{{ $('Get Data from Webhook').item.json.body.parameters.style.tool }}\"\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2,
"alwaysOutputData": true
},
{
"id": "c0186ccf-3bfa-4390-a5a0-41245db45873",
"name": "text-to-video",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
-976,
-688
],
"parameters": {
"url": "https://api.magichour.ai/v1/text-to-video",
"method": "POST",
"options": {},
"jsonBody": "={\n \"name\": \"{{ $('Edit Fields2').item.json.body.parameters.name }}\",\n \"end_seconds\": {{ $('Edit Fields2').item.json.body.parameters.end_seconds }},\n \"orientation\": \"{{ $('Edit Fields2').item.json.body.parameters.orientation }}\",\n \"resolution\": \"{{ $('Edit Fields2').item.json.body.parameters.resolution }}\",\n \"style\": {\n \"prompt\": \"{{ $json.message.content }}\"\n }\n} ",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2,
"alwaysOutputData": true
},
{
"id": "e4bfdb41-1e79-40b9-adc7-fc353bb9dc64",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
32,
-736
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "aaf5f07a-7086-4f90-b959-fc3a51d5cb3c",
"name": "Get Video Details",
"type": "n8n-nodes-base.httpRequest",
"position": [
224,
-736
],
"parameters": {
"url": "https://api.magichour.ai/v1/video-projects/id",
"options": {},
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "b86b8653-7125-49cc-934a-efbf729e92df",
"name": "If4",
"type": "n8n-nodes-base.if",
"position": [
560,
-736
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "e240e5dc-6bdf-47a3-85c4-098b5e3235fc",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "complete"
},
{
"id": "cfeb1810-471d-438a-ad2c-f2bf14124616",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "error"
},
{
"id": "5b+1234567890f1a-bc59-7e55c51d83ff",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "cancelled"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "0dec21e4-5da8-4b1c-acfd-e051d12daf27",
"name": "Download Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
864,
-752
],
"parameters": {
"url": "={{ $json.downloads[0].url }}",
"options": {}
},
"typeVersion": 4.2
}
],
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "ce361a06-9a8c-4df2-a40d-139c04f5ce71",
"connections": {
"If": {
"main": [
[
{
"node": "Get Data from Webhook",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Download Image",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"If2": {
"main": [
[
{
"node": "If3",
"type": "main",
"index": 0
}
],
[]
]
},
"If3": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"If4": {
"main": [
[
{
"node": "Download Video",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Get Image Details",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Get Video Details",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Generate video Prompt",
"type": "main",
"index": 0
}
]
]
},
"text-to-video": {
"main": [
[
{
"node": "If2",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Error Details",
"type": "main",
"index": 0
}
]
]
},
"Download Image": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Download Video": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Get Error Details": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Get Image Details": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Get Video Details": {
"main": [
[
{
"node": "If4",
"type": "main",
"index": 0
}
]
]
},
"ai-image-generator": {
"main": [
[
{
"node": "If2",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Error Details",
"type": "main",
"index": 0
}
]
]
},
"Generate Image Prompt": {
"main": [
[
{
"node": "ai-image-generator",
"type": "main",
"index": 0
}
]
]
},
"Generate video Prompt": {
"main": [
[
{
"node": "text-to-video",
"type": "main",
"index": 0
}
]
]
},
"Get Data from Webhook": {
"main": [
[
{
"node": "Generate Image Prompt",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
httpBearerAuthopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
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.
Source: https://n8n.io/workflows/9853/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This powerful n8n automation workflow is designed to execute advanced B2B lead enrichment and hyper-personalization for cold email outreach. By orchestrating a complex chain of data scraping, AI analy
Eu Clara – Funil Kiwify Completo. Uses postgres, openAi, httpRequest, gmail. Webhook trigger; 70 nodes.
This workflow bridges the gap between raw product data and revenue sales tools. It automates the entire Product Qualified Lead (PQL) lifecycle—from real-time intent routing to churn prevention—reducin
Lua Nova - Sistema Completo. Uses postgres, httpRequest, openAi. Webhook trigger; 55 nodes.
User Signup & Verification: The workflow starts when a user signs up. It generates a verification code and sends it via SMS using Twilio. Code Validation: The user replies with the code. The workflow