{
  "name": "AI Ad Creative Variations Agent",
  "nodes": [
    {
      "parameters": {
        "public": true,
        "initialMessages": "Hi there! 👋\n\nI'm a graphic design agent. Just drop your desired ads to emulate in this folder: https://drive.google.com/drive/folders/YOUR_GOOGLE_DRIVE_ID?usp=sharing\n\nThen, after your request is sent, they'll start populating in this folder: https://drive.google.com/drive/folders/YOUR_GOOGLE_DRIVE_ID?usp=drive_link\n\nMake sure to provide an image prompt (with the company name, replacement text, and any style you want) as well as the number of designs per example to generate.\n\nHappy designing!",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "23ce5314-747c-40ec-b750-ad410c80cd6c",
      "name": "When chat message received",
      "webhookId": "cc19cd7d-8907-4316-9d25-55b0d583a55d"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful, intelligent graphic design assistant. When a user feeds in an \"imagePrompt\", your task is to call the \"Image Spinner\" tool. Do not change or improve the provided imagePrompt—this is dealt with inside of the tool call itself. Also, make sure to ask the user for \"numberOfSamples\", and pass that to Image Spinner as well. If a user does not provide numberOfSamples, ask them something like \"how many samples per image do you want?\""
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        260,
        0
      ],
      "id": "d461821d-aa17-417f-b32b-25581b605d0b",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1",
          "mode": "list",
          "cachedResultName": "gpt-4.1"
        },
        "options": {
          "temperature": 0.7
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        220,
        220
      ],
      "id": "b4f4fb91-01d8-4476-bd9a-4534c0f2ca28",
      "name": "OpenAI Chat Model"
    },
    {
      "parameters": {
        "description": "Call this tool to spin an image. Pass the imagePrompt through directly. If no numberOfSamples is provided in the chat, then return 3 as a default. ",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "AI Ad Creative Variations - Image Generator Sub-workflow"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "imagePrompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imagePrompt', ``, 'string') }}",
            "numberOfSamples": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('numberOfSamples', ``, 'string') }}"
          },
          "matchingColumns": [
            "imagePrompt"
          ],
          "schema": [
            {
              "id": "imagePrompt",
              "displayName": "imagePrompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            },
            {
              "id": "numberOfSamples",
              "displayName": "numberOfSamples",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        460,
        220
      ],
      "id": "5a3b9e96-adb1-436d-864e-b69a9d9d8cf4",
      "name": "Image Spinner"
    },
    {
      "parameters": {
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        340,
        220
      ],
      "id": "c3b7125c-bc7c-4ab6-bc08-55c2cdb3eb4e",
      "name": "Memory"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Image Spinner": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}
