{"product_id":"n8n-webhook-workflow-generate-2-images-via-imagestyle","title":"n8n Webhook Workflow: Generate 2 Images via ImageStyle","description":"\u003ch3\u003eGenerate images on demand with an n8n Webhook + ImageStyle\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow exposes a Webhook that accepts an image prompt (and optional aspect ratio), creates a text-to-image generation task in \u003cstrong\u003eImageStyle\u003c\/strong\u003e, polls until completion, and returns the resulting image URL in the webhook response.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a POST request\u003c\/strong\u003e to an n8n webhook with JSON containing \u003ccode\u003eprompt\u003c\/code\u003e and optional \u003ccode\u003easpectRatio\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalizes inputs\u003c\/strong\u003e by defaulting \u003ccode\u003easpectRatio\u003c\/code\u003e to \u003ccode\u003e1:1\u003c\/code\u003e when it isn’t provided.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates an ImageStyle generation task\u003c\/strong\u003e by sending the prompt and aspect ratio to \u003ccode\u003eImageStyle \/api\/v1\/generate\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWaits and polls for completion\u003c\/strong\u003e: it waits 5 seconds, then checks status via \u003ccode\u003eImageStyle \/api\/v1\/generate\/{id}\u003c\/code\u003e until results are available.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns a JSON response\u003c\/strong\u003e including the task ID, status, and output URL\/images when ImageStyle reports \u003cstrong\u003ecompleted\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHandles failures and timeouts\u003c\/strong\u003e: returns a \u003cstrong\u003e502\u003c\/strong\u003e JSON error if ImageStyle reports \u003cstrong\u003efailed\u003c\/strong\u003e or if the task runs longer than \u003cstrong\u003e10 minutes\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eBuild a lightweight API endpoint for your SaaS that turns user prompts into generated images instantly.\u003c\/li\u003e\n  \u003cli\u003eAutomate marketing asset previews by triggering ImageStyle from a backend service via webhook.\u003c\/li\u003e\n  \u003cli\u003eCreate an internal tool for automation engineers to test prompt-to-image generation with consistent aspect ratios.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes:\u003c\/strong\u003e \u003ccode\u003ewebhook\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003ewait\u003c\/code\u003e, \u003ccode\u003ehttp request\u003c\/code\u003e, and a \u003ccode\u003esticky note\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eImageStyle integration:\u003c\/strong\u003e uses your \u003cstrong\u003eImageStyle API key\u003c\/strong\u003e via an \u003cstrong\u003en8n HTTP Header Auth\u003c\/strong\u003e credential sending \u003ccode\u003eAuthorization: Bearer \u0026lt;YOUR_API_KEY\u0026gt;\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eActivation:\u003c\/strong\u003e start the workflow, then POST to the webhook URL with \u003ccode\u003e{\"prompt\":\"...\",\"aspectRatio\":\"1:1\"}\u003c\/code\u003e (or omit \u003ccode\u003easpectRatio\u003c\/code\u003e).\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45962248749235,"sku":"N8N-19035","price":52.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/HZdZC0PzbUH3T2PhtyqNC_U15Q3TZK.png?v=1788600165","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-workflow-generate-2-images-via-imagestyle","provider":"N8N Commerce","version":"1.0","type":"link"}