{
  "name": "My workflow VISION (Chains)",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -448,
        176
      ],
      "id": "30bcb860-8dc4-4dbb-8094-78ec92cc903a",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0da1ec5b-dbca-41df-8cf0-842c7b8e0b66",
              "name": "sample_image",
              "value": "https://live.staticflickr.com/23/24563730_63c845667f_b.jpg",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -224,
        176
      ],
      "id": "2d4a29ee-354e-472e-bab7-6ac55853ecfb",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "jsCode": "// Get binary data from input item\nconst binaryData = items[0].binary;\n\n// Get the binary field name (default 'data')\nconst binaryPropertyName = 'data'; // Change this if your binary has a different name\n\n// Verify that binary exists\nif (!binaryData || !binaryData[binaryPropertyName]) {\n  throw new Error('Binary data not found in the specified field');\n}\n\n// Get the buffer from binary\nconst buffer = await this.helpers.getBinaryDataBuffer(0, binaryPropertyName);\n\n// Convert to base64\nconst base64String = buffer.toString('base64');\n\n// Return the result\nreturn [\n  {\n    json: {\n      base64: base64String,\n      mimeType: binaryData[binaryPropertyName].mimeType,\n      fileName: binaryData[binaryPropertyName].fileName\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        416,
        368
      ],
      "id": "40f3447a-12d5-440c-b984-d3f2c5d4d415",
      "name": "Binary to Base64"
    },
    {
      "parameters": {
        "url": "={{ $json.sample_image }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        64,
        272
      ],
      "id": "085cb6bb-a2b7-47d9-b33a-ad2fedc7e729",
      "name": "Download Image"
    },
    {
      "parameters": {
        "imageSource": "url",
        "imageUrl": "={{ $json.sample_image }}",
        "options": {}
      },
      "type": "n8n-nodes-universal-llm-vision.visionChain",
      "typeVersion": 1,
      "position": [
        0,
        80
      ],
      "id": "fcde730d-fe51-436c-af43-07e7184feaa1",
      "name": "Vision Chain (URL)"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-universal-llm-vision.visionChain",
      "typeVersion": 1,
      "position": [
        352,
        176
      ],
      "id": "fbd8992c-348e-4dcc-8966-cc3eec9110cd",
      "name": "Vision Chain (BINARY)"
    },
    {
      "parameters": {
        "imageSource": "base64",
        "base64Data": "={{ $json.base64 }}",
        "options": {
          "imageDetail": "auto"
        }
      },
      "type": "n8n-nodes-universal-llm-vision.visionChain",
      "typeVersion": 1,
      "position": [
        704,
        368
      ],
      "id": "429219ae-1b60-4d16-a1ce-5662f330a917",
      "name": "Vision Chain (BASE 64)"
    },
    {
      "parameters": {
        "model": "google/gemini-2.0-flash-lite-001",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        192,
        528
      ],
      "id": "d31d87fe-8862-4629-a861-a1d23d6f5d62",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Vision Chain (URL)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Binary to Base64": {
      "main": [
        [
          {
            "node": "Vision Chain (BASE 64)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Binary to Base64",
            "type": "main",
            "index": 0
          },
          {
            "node": "Vision Chain (BINARY)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Vision Chain (URL)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Vision Chain (BINARY)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Vision Chain (BASE 64)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vision Chain (URL)": {
      "main": [
        []
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "7f2e07b0-8051-4e01-8e39-7f7a1fc42090",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "udM9lhOEThp4gm5C",
  "tags": []
}