{
  "name": "BananaBanana: image via AI Agent + MCP",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "Create a square image: A ripe banana on a wooden desk, soft studio light, photorealistic.",
        "options": {
          "systemMessage": "You create images with the BananaBanana tools. Call generate_image with the user's request (model nano-banana-2-lite unless the user names another model; list_models shows models and prices). generate_image returns a job_id: call get_result with that job_id and wait_seconds 30 until status is completed. If a tool answers status confirmation_required, tell the user the quoted price and stop: never pass confirm_cost on your own. Finish with the first file URL from get_result on its own line.",
          "maxIterations": 10
        }
      },
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-5-mini"
        },
        "responsesApiEnabled": true,
        "options": {}
      },
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        260,
        220
      ]
    },
    {
      "parameters": {
        "endpointUrl": "https://bananabanana.pro/api/mcp",
        "serverTransport": "httpStreamable",
        "authentication": "bearerAuth",
        "include": "selected",
        "includeTools": [
          "list_models",
          "get_account",
          "generate_image",
          "get_result"
        ],
        "options": {
          "timeout": 90000
        }
      },
      "name": "BananaBanana MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.4,
      "position": [
        520,
        220
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{ $json.output.match(/https?:\\/\\/\\S+?\\/api\\/files\\/[^\\s)\"'\\]]+/)[0] }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "name": "Download file",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        0
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "BananaBanana MCP": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
