AutomationFlowsAI & RAG › Openai Models Template: Gpt-4 and Dall-e Services Overview

Openai Models Template: Gpt-4 and Dall-e Services Overview

ByNick Saraev @nicksaraev on n8n.io

Categories: AI Agents, Design Automation, Business Tools

Chat trigger trigger★★★★★ complexityAI-powered40 nodesTool WorkflowHTTP Request ToolMemory Buffer WindowOpenAI ChatChat TriggerAgentGoogle DriveHTTP Request
AI & RAG Trigger: Chat trigger Nodes: 40 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Agent → Chat Trigger 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "My workflow",
  "tags": [],
  "nodes": [
    {
      "id": "de133b2f-126e-4a46-bbe5-befeb657eab9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2580,
        -1540
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## \ud83c\udf08 Gradient Image Generator\n\nThis workflow generates gradient backgrounds:\n\n1. **When Executed by Another Workflow**: Receives parameters (imagePrompt, resolution, imageType, fileName)\n2. **Google Drive**: Downloads template gradient example\n3. **Generate Image Using GPT Image**: Uses template as inspiration with your prompt\n4. **Convert to File**: Converts AI output to downloadable format\n5. **Google Drive Upload & Share**: Saves and shares final gradient"
      },
      "typeVersion": 1
    },
    {
      "id": "f876e7f3-b05a-4fe4-9970-9a048c6142d6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2600,
        -1240
      ],
      "parameters": {
        "width": 350,
        "content": "## \ud83c\udfaf Logo Generator\n\nSimple logo creation workflow:\n\n1. **OpenAI**: Generates logo directly from text prompt\n2. **Google Drive Upload**: Saves generated logo\n3. **Google Drive Share**: Makes logo accessible via link\n4. **Edit Fields**: Formats output data for consistent response\n\n**Note**: No template needed - generates from scratch using AI"
      },
      "typeVersion": 1
    },
    {
      "id": "20ae1a05-49c7-429e-a460-bf100fa88815",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2600,
        -920
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## \ud83d\udccb Style Guide Generator\n\nCreates comprehensive brand guidelines:\n\n1. **Google Drive Download**: Gets style guide template\n2. **Generate Image Using GPT Image**: Customizes template with your brand info\n3. **Convert to File**: Processes AI output\n4. **Google Drive Upload & Share**: Saves final style guide\n5. **Edit Fields**: Organizes response data"
      },
      "typeVersion": 1
    },
    {
      "id": "d7e251c2-6af2-40b5-b61f-4bc20d061e2a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2580,
        -520
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## \u270f\ufe0f Design Editor/Revisor\n\nRevises existing designs based on feedback:\n\n1. **Switch**: Routes Google Drive vs external URLs differently\n2. **HTTP Request/Google Drive**: Downloads existing image\n3. **Generate Image**: Applies revisions using AI with specific edit instructions\n4. **Upload Process**: Saves revised design\n\n**Key**: Maintains original design while applying requested changes"
      },
      "typeVersion": 1
    },
    {
      "id": "77de1bf1-f332-4122-a3e0-d7141ec3f5bb",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        60
      ],
      "parameters": {
        "width": 380,
        "height": 200,
        "content": "## \ud83e\udd16 AI Graphic Designer Agent\n\nMain conversational interface that orchestrates all tools:\n\n1. **When chat message received**: Handles user requests\n2. **AI Agent**: Routes requests to appropriate design tools (logo, style guide, gradient, editor, upscaler)\n3. **OpenAI Chat Model**: Processes conversations\n4. **Tool Integration**: Calls the 4 design workflows above based on user needs\n\n**Result**: Natural language design requests \u2192 Professional design outputs"
      },
      "typeVersion": 1
    },
    {
      "id": "1ea2e7f7-2e0c-4ba9-bbd2-32405b2b8796",
      "name": "Edit/Revise Image",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -860,
        280
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "xRfWilBLzcDW8L3y",
          "cachedResultName": "Design Editor/Revisor (AI Graphic Designer)"
        },
        "description": "Call this tool to edit or revise an image. Only call this if you are explicitly asked to change something.\n\nSupported resolutions:\n1024x1024\n1536x1024\n1024x1536",
        "workflowInputs": {
          "value": {
            "fileName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fileName', ``, 'string') }}",
            "imageType": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imageType', ``, 'string') }}",
            "resolution": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('resolution', ``, 'string') }}",
            "imagePrompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imagePrompt', ``, 'string') }}",
            "previousImageUrl": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('previousImageUrl', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "imagePrompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imagePrompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "resolution",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "resolution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageType",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imageType",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fileName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "previousImageUrl",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "previousImageUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "666db8e0-1b34-410d-b568-917865b07bb2",
      "name": "Upscale Image",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -1000,
        280
      ],
      "parameters": {
        "url": "https://api.replicate.com/v1/models/google/upscaler/predictions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"input\": {\n    \"image\": \"{{ $fromAI(\"inputImageUrl\")}}\",\n    \"upscale_factor\": \"{{$fromAI(\"upscale_factor\")}}\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "toolDescription": "Call this tool to upscale an image.\n\nFor upscale_factor, you can write x2 or x4. Nothing else.\n\nReturn the response[0].output parameter wrapped in nice markdown (atx) format for the user.",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <your-replicate-api-key-here>"
            },
            {
              "name": "Prefer",
              "value": "wait"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "52ad87b4-d9a3-480a-9275-7ade155dbb16",
      "name": "Generate Gradient Background",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -1140,
        280
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "kZ2VRoLIX2txywbe",
          "cachedResultName": "Gradient Image (AI Graphic Designer)"
        },
        "description": "Call this tool to generate a gradient background. Then return the webViewLink in markdown (atx) format, so the user can click it and open a new tab.\n\nSupported resolutions:\n1024x1024\n1536x1024\n1024x1536",
        "workflowInputs": {
          "value": {
            "fileName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fileName', ``, 'string') }}",
            "imageType": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imageType', ``, 'string') }}",
            "resolution": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('resolution', ``, 'string') }}",
            "imagePrompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imagePrompt', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "imagePrompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imagePrompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "resolution",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "resolution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageType",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imageType",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fileName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ee740103-8935-4d6f-a504-eeb404ea9294",
      "name": "Generate Style Guide",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -1280,
        280
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "kjr6b4WQwpr6g9h5",
          "cachedResultName": "Style Guide Generator (AI Graphic Designer)"
        },
        "description": "Call this tool to generate a style guide. Then return the webViewLink in markdown (atx) format, so the user can click it and open a new tab.\n\nSupported resolutions:\n1024x1024\n1536x1024\n1024x1536",
        "workflowInputs": {
          "value": {
            "fileName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fileName', ``, 'string') }}",
            "imageType": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imageType', ``, 'string') }}",
            "resolution": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('resolution', ``, 'string') }}",
            "imagePrompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imagePrompt', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "imagePrompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imagePrompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "resolution",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "resolution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageType",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imageType",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fileName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "45d6d6d7-1ed8-4d10-8321-91dd6bebe507",
      "name": "Generate Logo",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -1420,
        280
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "6XCAq81V1voPR3kB",
          "cachedResultName": "Logo Generator (AI Graphic Designer)"
        },
        "description": "Call this tool to generate a logo. Then return the webViewLink in markdown (atx) format, so the user can click it and open a new tab.\n\nSupported resolutions:\n1024x1024\n1536x1024\n1024x1536",
        "workflowInputs": {
          "value": {
            "fileName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fileName', ``, 'string') }}",
            "imageType": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imageType', ``, 'string') }}",
            "resolution": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('resolution', ``, 'string') }}",
            "imagePrompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imagePrompt', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "imagePrompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imagePrompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "resolution",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "resolution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageType",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "imageType",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fileName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6e7a815f-1306-4366-a552-c7beb915f978",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1560,
        280
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "09b4bdfc-2f77-4f78-9977-8a151414a313",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1680,
        280
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {
          "temperature": 0.7
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8adccc61-ef34-40b3-82b4-c601030a3e2d",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1580,
        20
      ],
      "parameters": {
        "public": true,
        "options": {
          "title": "Design Agent \ud83d\udc4b",
          "subtitle": "Message anytime!",
          "customCss": ":root {\n  /* Colors */\n  --chat--color-primary: #e74266; /* leave as accent or swap if desired */\n  --chat--color-secondary: #A3CEF1;       /* pastel blue */\n  --chat--color-secondary-shade-50: #8EBEE8;\n  --chat--color-secondary-shade-100: #78ADDE;\n  --chat--color-white: #ffffff;\n  --chat--color-light: #f7f9fb;\n  --chat--color-light-shade-50: #eef1f5;\n  --chat--color-medium: #d2d4d9;\n  --chat--color-dark: #101330;\n  --chat--color-disabled: #a0a4ab;\n  --chat--color-typing: #404040;\n\n  /* Base Layout */\n  --chat--spacing: 1rem;\n  --chat--border-radius: 0.2rem;\n  --chat--transition-duration: 0.15s;\n\n  /* Window Dimensions */\n  --chat--window--width: 400px;\n  --chat--window--height: 600px;\n  --chat--window--bottom: var(--chat--spacing);\n  --chat--window--right: var(--chat--spacing);\n  --chat--window--z-index: 9999;\n  --chat--window--border: 1px solid var(--chat--color-light-shade-50);\n  --chat--window--border-radius: var(--chat--border-radius);\n  --chat--window--margin-bottom: var(--chat--spacing);\n\n  /* Header Styles */\n  --chat--header--background: var(--chat--color-white);\n  --chat--header--color: var(--chat--color-dark);\n  --chat--header--padding: calc(var(--chat--spacing) * 0.75);\n  --chat--header-height: auto;\n  --chat--header--border-bottom: 1px solid var(--chat--color-light-shade-50);\n\n  /* Message Styles */\n  --chat--message--font-size: 1rem;\n  --chat--message--padding: calc(var(--chat--spacing) * 0.75);\n  --chat--message--border-radius: var(--chat--border-radius);\n  --chat--message-line-height: 1.5;\n  --chat--message--margin-bottom: var(--chat--spacing);\n  --chat--message--bot--background: var(--chat--color-white);\n  --chat--message--bot--color: var(--chat--color-dark);\n  --chat--message--user--background: var(--chat--color-secondary);\n  --chat--message--user--color: var(--chat--color-white);\n  --chat--message--pre--background: rgba(0, 0, 0, 0.03);\n\n  /* Toggle Button */\n  --chat--toggle--background: var(--chat--color-secondary);\n  --chat--toggle--hover--background: var(--chat--color-secondary-shade-50);\n  --chat--toggle--active--background: var(--chat--color-secondary-shade-100);\n\n  /* Input Area */\n  --chat--textarea--height: 50px;\n  --chat--textarea--max-height: 30rem;\n  --chat--input--background: var(--chat--color-white);\n  --chat--input--color: var(--chat--color-dark);\n  --chat--input--padding: 0.8rem;\n  --chat--input--border: 1px solid var(--chat--color-light-shade-50);\n  --chat--input--border-active: 1px solid var(--chat--color-secondary-shade-100);\n  --chat--input--border-radius: var(--chat--border-radius);\n\n  /* Button Styles */\n  --chat--button--background: var(--chat--color-secondary);\n  --chat--button--color: var(--chat--color-white);\n  --chat--button--padding: 0.5rem var(--chat--spacing);\n  --chat--button--border-radius: var(--chat--border-radius);\n  --chat--button--hover--background: var(--chat--color-secondary-shade-50);\n\n  /* Send & File Buttons */\n  --chat--input--send--button--background: var(--chat--color-white);\n  --chat--input--send--button--color: var(--chat--color-secondary);\n  --chat--input--file--button--color: var(--chat--color-secondary);\n  --chat--files-spacing: 0.25rem;\n\n  /* Body & Footer */\n  --chat--body--background: var(--chat--color-light);\n  --chat--footer--background: var(--chat--color-light);\n  --chat--footer--color: var(--chat--color-dark);\n}\n\n.chat-message {\n  max-width: 50%;\n}"
        },
        "initialMessages": "Hi\u2014I can generate a logo, style guide, or background gradient for you. Let me know what you need?"
      },
      "typeVersion": 1.1
    },
    {
      "id": "ef79976c-3cc1-413b-a914-0c9ed9a8c487",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1320,
        20
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful, intelligent design assistant. You generate high-quality designs using the provided tools (generate logo, generate style guide, and generate gradient background). Then you can also upscale them, and finally, you can revise them.\n\nWhen you receive an image from a tool, wrap it in nice looking Markdown (atx) format and present it to the user.\n\nThe only three things you can generate are logos, style guides, and gradient backgrounds. \n\nMake sure to clarify which (as well as any additional information needed) so the prompt you send to the image model is optimal.\n\nIf you are asked to adjust or revise an image, ask the user to define their changes as explicitly as possible.",
          "passthroughBinaryImages": true
        }
      },
      "typeVersion": 2
    },
    {
      "id": "098c35d2-550c-4882-b551-c8a75e759e25",
      "name": "Google Drive11",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1580,
        -380
      ],
      "parameters": {
        "name": "={{ $json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "87b416db-b16b-46a4-aa66-470381792f5a",
      "name": "Edit Fields3",
      "type": "n8n-nodes-base.set",
      "position": [
        -260,
        -460
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cc5839f6-8d08-405e-bf8e-fc038e1bb121",
              "name": "webViewLink",
              "type": "string",
              "value": "={{ $('Google Drive9').item.json.webViewLink }}"
            },
            {
              "id": "0808c18a-075d-4d90-bbec-55a505512d30",
              "name": "initialPrompt",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imagePrompt }}"
            },
            {
              "id": "26209b1c-9d62-48a3-a4a6-290802b2e0c5",
              "name": "fileName",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.fileName }}"
            },
            {
              "id": "2d72a62f-1871-43a4-9c8f-687d0006b31d",
              "name": "imageType",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imageType }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "34b5fb8d-9333-4e96-8363-2ccb117a9483",
      "name": "Google Drive10",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -480,
        -460
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "3a946658-06fd-4ffe-812e-adfe088274bd",
      "name": "Google Drive9",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -700,
        -460
      ],
      "parameters": {
        "name": "={{ $('When Executed by Another Workflow').item.json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "02d41fae-0018-435e-9b8f-f38f72ad3d24",
      "name": "Convert to File2",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -920,
        -460
      ],
      "parameters": {
        "options": {
          "mimeType": "image/png"
        },
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json"
      },
      "typeVersion": 1.1
    },
    {
      "id": "29a6b70d-4633-4257-89c6-4367302be220",
      "name": "Google Drive8",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1360,
        -460
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $if($json.previousImageUrl, $json.previousImageUrl, $json.webViewLink) }}"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "8eaf1f44-3613-4199-812c-bf8afc08b570",
      "name": "Generate Image Using GPT Image 2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1140,
        -460
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/edits",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "image[]",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "prompt",
              "value": "=This is the former image. The client wants these revisions: {{ $('When Executed by Another Workflow').item.json.imagePrompt }}. Make them without materially changing anything that is not explicitly asked for (including backgrounds if relevant etc)."
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "typeVersion": 4.2
    },
    {
      "id": "5538f089-0b01-41f5-bde2-1a3e2c52c452",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1800,
        -380
      ],
      "parameters": {
        "url": "={{ $json.previousImageUrl }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "8de1534d-baec-4bef-b253-4c09060314de",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2020,
        -460
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Google",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c43d6a7d-bf5f-4060-8181-c6ef674c705d",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.previousImageUrl }}",
                    "rightValue": "google"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Non-Google",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "5bb1f007-a7ab-4aeb-b803-9757ce08070b",
                    "operator": {
                      "type": "string",
                      "operation": "notContains"
                    },
                    "leftValue": "={{ $json.previousImageUrl }}",
                    "rightValue": "google"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "917b135c-65db-454d-acde-34eb7b7416da",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        -920,
        -900
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cc5839f6-8d08-405e-bf8e-fc038e1bb121",
              "name": "webViewLink",
              "type": "string",
              "value": "={{ $('Google Drive6').item.json.webViewLink }}"
            },
            {
              "id": "0808c18a-075d-4d90-bbec-55a505512d30",
              "name": "initialPrompt",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imagePrompt }}"
            },
            {
              "id": "26209b1c-9d62-48a3-a4a6-290802b2e0c5",
              "name": "fileName",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.fileName }}"
            },
            {
              "id": "2d72a62f-1871-43a4-9c8f-687d0006b31d",
              "name": "imageType",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imageType }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d9e3fd9-a666-499d-b6fd-1add42ed58e3",
      "name": "Google Drive7",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1140,
        -900
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "144e4212-b45d-40c0-ab7d-fe59b2f378d5",
      "name": "Google Drive6",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1360,
        -900
      ],
      "parameters": {
        "name": "={{ $('When Executed by Another Workflow').item.json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "0a750831-79c7-4ef4-9c35-c959558a7314",
      "name": "Convert to File1",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -1580,
        -900
      ],
      "parameters": {
        "options": {
          "mimeType": "image/png"
        },
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json"
      },
      "typeVersion": 1.1
    },
    {
      "id": "15caf639-b249-4909-bd79-65516587baae",
      "name": "Google Drive5",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -2020,
        -900
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "1ga_xjprqAqlE1Rk_VYyy1zy3izfTqsp3"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "04d823a8-81a9-437e-ba18-1184d19926fd",
      "name": "Generate Image Using GPT Image ",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1800,
        -900
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/edits",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "image[]",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "prompt",
              "value": "=Using this image as inspiration, create: {{ $('When Executed by Another Workflow').item.json.imagePrompt }}"
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "typeVersion": 4.2
    },
    {
      "id": "14a02578-e294-41de-b467-4de7ff76b87d",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1360,
        -1220
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cc5839f6-8d08-405e-bf8e-fc038e1bb121",
              "name": "webViewLink",
              "type": "string",
              "value": "={{ $('Google Drive4').item.json.webViewLink }}"
            },
            {
              "id": "0808c18a-075d-4d90-bbec-55a505512d30",
              "name": "initialPrompt",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imagePrompt }}"
            },
            {
              "id": "26209b1c-9d62-48a3-a4a6-290802b2e0c5",
              "name": "fileName",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.fileName }}"
            },
            {
              "id": "2d72a62f-1871-43a4-9c8f-687d0006b31d",
              "name": "imageType",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imageType }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ff273bbd-ba92-4e91-9b53-615221e92926",
      "name": "Google Drive4",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1800,
        -1220
      ],
      "parameters": {
        "name": "={{ $('When Executed by Another Workflow').item.json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a39b75a7-7910-4950-9e99-f6fed11e5234",
      "name": "Google Drive1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1580,
        -1220
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "b385da97-02f7-47b6-917d-ce6785bd6be8",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -2020,
        -1220
      ],
      "parameters": {
        "model": "gpt-image-1",
        "prompt": "={{ $json.imagePrompt }}",
        "options": {
          "size": "={{ $json.resolution }}",
          "quality": "low"
        },
        "resource": "image"
      },
      "typeVersion": 1.8
    },
    {
      "id": "e034cb73-1ee9-43d8-99f0-b85bcf578f3a",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -680,
        -1520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cc5839f6-8d08-405e-bf8e-fc038e1bb121",
              "name": "webViewLink",
              "type": "string",
              "value": "={{ $('Google Drive2').item.json.webViewLink }}"
            },
            {
              "id": "0808c18a-075d-4d90-bbec-55a505512d30",
              "name": "initialPrompt",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imagePrompt }}"
            },
            {
              "id": "26209b1c-9d62-48a3-a4a6-290802b2e0c5",
              "name": "fileName",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.fileName }}"
            },
            {
              "id": "2d72a62f-1871-43a4-9c8f-687d0006b31d",
              "name": "imageType",
              "type": "string",
              "value": "={{ $('When Executed by Another Workflow').item.json.imageType }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d25b9492-1f64-4be1-916b-7cd880da747b",
      "name": "Google Drive3",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -900,
        -1520
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "fa544996-01af-4e07-8898-7ddae2f69b51",
      "name": "Google Drive2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1120,
        -1520
      ],
      "parameters": {
        "name": "={{ $('When Executed by Another Workflow').item.json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ef21462b-4b47-4986-9927-2de6bc71e875",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -1340,
        -1520
      ],
      "parameters": {
        "options": {
          "mimeType": "image/png"
        },
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1e309ae6-3761-4a2e-b29c-3b3bb14170b7",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1780,
        -1520
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "1gitoFs9-KqsuNjZt9plv9rvnWUWPJUJb"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "4556597f-ee92-4489-88a8-82984ace4197",
      "name": "Generate Image Using GPT Image 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1560,
        -1520
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/edits",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "image[]",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "prompt",
              "value": "=Using this image as inspiration, create: {{ $('When Executed by Another Workflow').item.json.imagePrompt }}"
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "typeVersion": 4.2
    },
    {
      "id": "17f58dbb-b2e2-4614-85e8-6e35d2a23589",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -2000,
        -1520
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "imagePrompt"
            },
            {
              "name": "resolution"
            },
            {
              "name": "imageType"
            },
            {
              "name": "fileName"
            }
          ]
        }
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "Google Drive4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Google Drive8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Generate Image Using GPT Image 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Google Drive11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Logo": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive2": {
      "main": [
        [
          {
            "node": "Google Drive3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive3": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive4": {
      "main": [
        [
          {
            "node": "Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive5": {
      "main": [
        [
          {
            "node": "Generate Image Using GPT Image ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive6": {
      "main": [
        [
          {
            "node": "Google Drive7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive7": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive8": {
      "main": [
        [
          {
            "node": "Generate Image Using GPT Image 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive9": {
      "main": [
        [
          {
            "node": "Google Drive10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Upscale Image": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive10": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive11": {
      "main": [
        [
          {
            "node": "Google Drive8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Google Drive2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File1": {
      "main": [
        [
          {
            "node": "Google Drive6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File2": {
      "main": [
        [
          {
            "node": "Google Drive9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit/Revise Image": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Style Guide": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Gradient Background": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image Using GPT Image ": {
      "main": [
        [
          {
            "node": "Convert to File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image Using GPT Image 1": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image Using GPT Image 2": {
      "main": [
        [
          {
            "node": "Convert to File2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Google Drive",
            "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

Categories: AI Agents, Design Automation, Business Tools

Source: https://n8n.io/workflows/5390/ — 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 template attempts to create an AI-powered content assistant for WordPress sites using Mistral AI, enabling article recommendations, content summarization, and contextual Q&A capabilities.

Chat Trigger, Output Parser Structured, Agent +10
AI & RAG

by Varritech Technologies

Chat Trigger, Agent, OpenAI Chat +8
AI & RAG

Who’s it for Creators who want to create faceless videos automatically, while keeping human oversight and quality control.

Read Write File, Agent, OpenAI Chat +7
AI & RAG

Who is this workflow for? This workflow is designed for SEO analysts, content creators, marketing agencies, and developers who need to index a website and then interact with its content as if it were

Agent, OpenAI Chat, Memory Buffer Window +10
AI & RAG

Airtable AI Agent. Uses lmChatOpenAi, agent, toolWorkflow, toolCode. Chat trigger; 42 nodes.

OpenAI Chat, Agent, Tool Workflow +6