AutomationFlowsAI & RAG › Generate Ad Images From Campaign Briefs with Gpt-4o and Openai Image API

Generate Ad Images From Campaign Briefs with Gpt-4o and Openai Image API

ByRahul Joshi @rahul08 on n8n.io

Description:

Event trigger★★★★☆ complexityAI-powered14 nodesHTTP RequestLm Chat Azure Open AiAgent
AI & RAG Trigger: Event Nodes: 14 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7949 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request 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 →

Download .json
{
  "id": "QHlBdxNaOW5x9gm3",
  "name": "Ads Image generator",
  "tags": [],
  "nodes": [
    {
      "id": "a9e3e2ff-f51b-42f3-b075-e8e8272cc5f2",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1104,
        0
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "131c824b-4fe8-4bd8-ac93-96590d6ce9c5",
      "name": "OpenAI - Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        0
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "85e14a8d-f18c-4cc0-887b-8bddc3b6384e",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        432,
        0
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "088ce6b5-d27c-4fe5-91dd-f47359ae0895",
      "name": "Separate Image Outputs",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        880,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "56e02732-0628-4ada-9b6f-8b1b062d3eb5",
      "name": "Azure OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        128,
        224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f8f1c038-d41d-4a62-a620-6a054631ba07",
      "name": "Prompt generator for image",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        32,
        0
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "eec7ce5d-348a-4713-a1f5-992fe5bdfaef",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -192,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ae209c1c-91bc-4b1f-ad1e-96ad90e5b659",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -560
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "910ed8db-e1c8-4b96-9940-de7a6a278a8d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        352
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "83bc2e3d-050b-4a4b-821b-29a57255e49f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        192
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "13bfd3c3-d9fd-47f8-90be-852c2453d0e4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -480
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b4f1f6db-d3ce-4bb5-b6db-e734bb9ff4e5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        176
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "586d1907-98ea-484b-a892-c9248aa94b82",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -368
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "040a4382-50d2-49e0-86cc-3b58aa06681c",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -176
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b445b924-d61d-4cbb-abff-f07a5ab4c10f",
  "connections": {
    "Set Variables": {
      "main": [
        [
          {
            "node": "OpenAI - Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Separate Image Outputs": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - Generate Image": {
      "main": [
        [
          {
            "node": "Separate Image Outputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Prompt generator for image",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prompt generator for image": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Prompt generator for image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Description:

Source: https://n8n.io/workflows/7949/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This n8n template demonstrates how to automatically process PDF purchase orders received via email and convert them into sales orders in Adobe Commerce (Magento 2) using Company Credit as the payment

HTTP Request, Form Trigger, Chat Trigger +5
AI & RAG

This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents. ​

Tool Http Request, Agent, HTTP Request +27
AI & RAG

This is a Telegram AI-to-Human Handover System that seamlessly transitions customer support conversations between an AI agent and human operators: AI-First Response: When users message the Telegram bo

Telegram Trigger, Telegram, Email Send +7
AI & RAG

Awesome N8N Templates. Uses agent, telegramTrigger, mcpClientTool, mcpTrigger. Event-driven trigger; 33 nodes.

Agent, Telegram Trigger, Mcp Client Tool +9
AI & RAG

This workflow is an AI-powered virtual cinematography and previs generation pipeline designed for film and VFX production. It transforms a director’s shot description into multiple camera choreography

Agent, Lm Chat Azure Open Ai, HTTP Request +7