{
  "name": "Store AI-generated images in AWS S3: OpenAI image creation & cloud storage",
  "nodes": [
    {
      "id": "8839c349-fde5-4fef-9b73-e337e47c0deb",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1424,
        240
      ]
    },
    {
      "id": "94dd22ea-6cf3-4c7f-9b20-a9b11680ec1d",
      "name": "Generate an image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1728,
        16
      ]
    },
    {
      "id": "7108a3aa-a2d5-4167-9c16-5201c0fe11d1",
      "name": "Upload a file",
      "type": "n8n-nodes-base.awsS3",
      "position": [
        2224,
        16
      ]
    },
    {
      "id": "548ec1cf-53dc-4df0-b2f4-9c17d795af4c",
      "name": "Prompt Generation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1328,
        16
      ]
    },
    {
      "id": "0c16a07e-9892-442c-840a-abc9201c8b85",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -320,
        16
      ]
    },
    {
      "id": "a1cabec4-957e-4954-aae9-ea54103fc379",
      "name": "Create AWS S3 Bucket",
      "type": "n8n-nodes-base.awsS3",
      "position": [
        736,
        16
      ]
    },
    {
      "id": "96a3f0bc-468a-42e2-b07f-0d57636c9b5a",
      "name": "Create a folder",
      "type": "n8n-nodes-base.awsS3",
      "position": [
        1104,
        16
      ]
    },
    {
      "id": "7e6da7e5-721f-4979-9101-c477d6a9b9cf",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        96,
        16
      ]
    },
    {
      "id": "a962b9e3-a7f0-4fa9-9d79-3726d5f4d2b9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        -480
      ],
      "parameters": {
        "width": 816,
        "height": 1280,
        "content": "# Automating AWS S3 Operations with n8n: Buckets, Folders, and Files\n\nThis tutorial walks you through setting up an automated workflow that **generates AI-powered images** from prompts and securely st"
      }
    },
    {
      "id": "9bbf079c-2987-484a-886c-9b0884e5049c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -272
      ],
      "parameters": {
        "width": 448,
        "height": 192,
        "content": "## Step 1: Trigger Workflow\n- The workflow begins when you **click “Execute Workflow”** in n8n.  \n- This is a manual trigger, giving you control over when to generate images.  \n👉 You can later replace"
      }
    },
    {
      "id": "e181e6ad-0c22-414d-aefb-6fdc6811db21",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        208
      ],
      "parameters": {
        "width": 448,
        "height": 272,
        "content": "## Step 2: Edit Fields\n- This node allows you to **manually provide input fields** for the workflow.  \n- Typical inputs include:  \n  - **Image Description** (e.g., *“A futuristic city skyline in water"
      }
    },
    {
      "id": "2263ecde-5632-4a67-ab9b-bad883b0215e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -288
      ],
      "parameters": {
        "width": 432,
        "height": 224,
        "content": "## Step 3: Create AWS S3 Bucket\n- The workflow will create a new **AWS S3 bucket** to store your images.  \n- If the bucket already exists, it will skip this step.  \n- Recommended format: `ai-images-de"
      }
    },
    {
      "id": "9a1b2396-a262-4540-85d7-11576ce70d0f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        288
      ],
      "parameters": {
        "width": 432,
        "height": null,
        "content": "## Step 4: Create a Folder\n- Inside your S3 bucket, a **folder** (sometimes called a “prefix”) is created.  \n- This helps keep images organized (e.g., by project, user, or campaign).  \n- Example: `ai-"
      }
    },
    {
      "id": "41197544-3daa-4d41-9152-8887f59d4894",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -288
      ],
      "parameters": {
        "width": 544,
        "height": 208,
        "content": "## Step 5: Prompt Generation Agent\n- This node uses the **OpenAI Chat Model** to **refine your prompt** before generating the image.  \n- Example: If you enter *“dog in a park”*, the agent might expand"
      }
    },
    {
      "id": "f6cc0eca-f4e1-41b0-ab62-fda3bedc074c",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        224
      ],
      "parameters": {
        "width": 544,
        "height": 240,
        "content": "## Step 6: Generate an Image\n- Using the refined prompt, the **OpenAI Image Generation model** creates an image.  \n- You can define:  \n  - Resolution (512px, 1024px, etc.)  \n  - Style (realistic, wate"
      }
    },
    {
      "id": "da9e8e07-bb47-4270-b0af-16e2e3dabd29",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        -272
      ],
      "parameters": {
        "width": 560,
        "height": 208,
        "content": "## Step 7: Upload File to AWS S3\n- The generated image is uploaded into your S3 bucket and folder.  \n- The file is given a unique name (e.g., `image_2025-08-17_12-30.png`).  \n- Once uploaded, you can:"
      }
    },
    {
      "id": "967a41d5-1d28-4ff8-93f5-aff3b6cdeb38",
      "name": "Delete a folder",
      "type": "n8n-nodes-base.awsS3",
      "position": [
        752,
        -464
      ]
    },
    {
      "id": "3aa92356-4bf3-4039-b431-ffc9e28deef9",
      "name": "Delete uploaded image",
      "type": "n8n-nodes-base.awsS3",
      "position": [
        304,
        -464
      ]
    },
    {
      "id": "7ab94a69-9ca2-4ee0-8db9-db2037fe087a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -800
      ],
      "parameters": {
        "width": 496,
        "height": 288,
        "content": "## Step 8: Delete an Object\n- This step lets you **remove a specific file (object) from your S3 bucket**.  \n- Typical use cases:  \n  - Replacing outdated images.  \n  - Cleaning up test runs.  \n- Input"
      }
    },
    {
      "id": "74d397eb-4f59-4709-8fd2-650b5a67f0f5",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -816
      ],
      "parameters": {
        "width": 496,
        "height": 304,
        "content": "## Step 9: Delete a Folder\n- This step allows you to **delete an entire folder (prefix) in S3**.  \n- It will remove all objects inside that folder.  \n- Typical use cases:  \n  - Clearing old project as"
      }
    }
  ],
  "connections": {
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Create AWS S3 Bucket",
            "type": "main",
            "index": 0
          },
          {
            "node": "Delete uploaded image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload a file": {
      "main": [
        []
      ]
    },
    "Create a folder": {
      "main": [
        [
          {
            "node": "Prompt Generation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate an image": {
      "main": [
        [
          {
            "node": "Upload a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Prompt Generation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create AWS S3 Bucket": {
      "main": [
        [
          {
            "node": "Create a folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete uploaded image": {
      "main": [
        [
          {
            "node": "Delete a folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompt Generation Agent": {
      "main": [
        [
          {
            "node": "Generate an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}