AAAli Asghar
← All work

AI Image & Video Generation Router

a content production business

n8nWebhooksAI image generationAI video generation

The problem

Image and video generation ran through separate manual tools, and long-running video jobs had to be checked on by hand.

What was built

  • A single webhook entry point that validates the request and routes it to image or video generation
  • Dedicated sub-workflows for each media type
  • Polling with wait and retry for long-running generation jobs
  • A consistent response returned to the calling application

Inside the build

The workflows behind this system

View-only previews of the production workflows, drawn from the real builds with client details removed. The workflow files and walkthrough videos are available on request.

TriggerAILogicAPI callApp integration
Call Image Subworkflown8n29 nodes
Start (Execute Workflow Trigger)StartExecute Workflow TriggerWait Before Status Check (Wait)Wait Before Status Ch…WaitCheck-Task Status (Http Request)Check-Task StatusHttp RequestStatus Pending / Processing? (If)Status Pending / Proc…IfStatus Completed? (If)Status Completed?IfImage_URL (Set)Image_URLSetWait Before Status Check1 (Wait)Wait Before Status Ch…WaitCheck-Task Status1 (Http Request)Check-Task Status1Http RequestStatus Pending / Processing?1 (If)Status Pending / Proc…IfStatus Completed?1 (If)Status Completed?1IfImage_URL1 (Set)Image_URL1SetNano Banana Image Task (Http Request)Nano Banana Image TaskHttp RequestQwen Image (Http Request)Qwen ImageHttp RequestNano Banana? (If)Nano Banana?IfQwen Image? (If)Qwen Image?IfFlusk Image? (If)Flusk Image?IfFlusk Image (Http Request)Flusk ImageHttp RequestMidjourney Image (Http Request)Midjourney ImageHttp RequestMidjourney Image? (If)Midjourney Image?IfWait Before Status Check2 (Wait)Wait Before Status Ch…WaitCheck-Task Status2 (Http Request)Check-Task Status2Http RequestStatus Pending / Processing?2 (If)Status Pending / Proc…IfStatus Completed?2 (If)Status Completed?2IfImage_URL2 (Set)Image_URL2SetWait Before Status Check5 (Wait)Wait Before Status Ch…WaitCheck-Task Status5 (Http Request)Check-Task Status5Http RequestStatus Pending / Processing?5 (If)Status Pending / Proc…IfStatus Completed?5 (If)Status Completed?5IfImage_URL5 (Set)Image_URL5Set
Image Generationn8n10 nodes
Midjourney (Set)MidjourneySetFlux (Set)FluxSetSwitch (Switch)SwitchSwitchQwen Image (Set)Qwen ImageSetCall Qwen Image (Execute Workflow)Call Qwen ImageExecute WorkflowCall Nano Banana (Execute Workflow)Call Nano BananaExecute WorkflowNano Banana (Set)Nano BananaSetStart (Execute Workflow Trigger)StartExecute Workflow TriggerCall Flux Image (Execute Workflow)Call Flux ImageExecute WorkflowCall Midjourney Image (Execute Workflow)Call Midjourney ImageExecute Workflow
Parent Workflow - AI Generation Routern8n8 nodes
Webhook (Webhook)WebhookWebhookRespond to Webhook (Respond To Webhook)Respond to WebhookRespond To WebhookCall Call Video Subworkflow (Execute Workflow)Call Call Video Subwo…Execute WorkflowMapped Data For Image (Set)Mapped Data For ImageSetMapped Data For Video (Set)Mapped Data For VideoSetImage Request? (If)Image Request?IfVideo Request? (If)Video Request?IfCall Image Generation (Execute Workflow)Call Image GenerationExecute Workflow
Call Video Subworkflown8n2 nodes
Call Video Subworkflow (Execute Workflow)Call Video SubworkflowExecute WorkflowStart (Execute Workflow Trigger)StartExecute Workflow Trigger