AutomationFlowsAI & RAG › Analyze Images with Openai Vision While Preserving Binary Data for Reuse

Analyze Images with Openai Vision While Preserving Binary Data for Reuse

ByRobert Breen @rbreen on n8n.io

Use this template to upload an image, run a first-pass OpenAI Vision analysis, then re-attach the original file (binary/base64) to the next step using a Merge node. The pattern ensures your downstream AI Agent (or any node) can access both the original file () and the first…

Event trigger★★☆☆☆ complexityAI-powered7 nodesForm TriggerOpenAIAgentOpenAI Chat
AI & RAG Trigger: Event Nodes: 7 Complexity: ★★☆☆☆ AI nodes: yes Added:

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

This workflow follows the Agent → Form 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
  },
  "nodes": [
    {
      "id": "d49cdb6a-5084-4c00-a40f-062c157a9b3d",
      "name": "Form Trigger1",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -928,
        10784
      ],
      "parameters": {
        "path": "d6f874ec-6cb3-46c7-8507-bd647c2484f0",
        "options": {},
        "formTitle": "Image Document Upload",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "data"
            }
          ]
        },
        "formDescription": "Upload a image document for AI analysis"
      },
      "typeVersion": 2
    },
    {
      "id": "a363370d-851d-4452-ac9a-b0f5d6a7107e",
      "name": "Analyze image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -368,
        10576
      ],
      "parameters": {
        "text": "=data",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "a0270371-928d-4084-8c07-6ff8936837c0",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        -160,
        10960
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "76a6e130-ea39-4b6e-8bbd-200c0a57ed99",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        10336
      ],
      "parameters": {
        "color": 7,
        "width": 2144,
        "height": 1056,
        "content": "### \ud83d\uddbc\ufe0f Use Binary Field after next step\n\nThis workflow demonstrates how to **preserve and reuse an uploaded file (binary/base64)** after a downstream step by using a **Merge** node (`combineByPosition`). A user uploads an image via **Form Trigger** \u2192 the image is analyzed with **OpenAI Vision** \u2192 results are **merged back** with the original upload so the next **AI Agent** step can access **both** the original file (`data`) and the first analysis (`content`) at the same time.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "79d53391-5e87-472a-bd08-e5cd7d43a39a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        10336
      ],
      "parameters": {
        "width": 400,
        "height": 1056,
        "content": "\n\n## \ud83d\udcec Contact  \nNeed help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your PDF)?  \n\n- \ud83d\udce7 **rbreen@ynteractive.com**  \n- \ud83d\udd17 **https://www.linkedin.com/in/robert-breen-29429625/**  \n- \ud83c\udf10 **https://ynteractive.com**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f77d1571-f807-48f9-a523-582ffb48f2e5",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        240,
        10880
      ],
      "parameters": {
        "text": "=data\n {{ $json.content }}",
        "options": {
          "systemMessage": "analyze the image again and see if you get the same result. "
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "5bbd5de7-cdaf-4a65-92ad-f29830a710b1",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        208,
        11088
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "connections": {
    "Merge1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form Trigger1": {
      "main": [
        [
          {
            "node": "Analyze image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Use this template to upload an image, run a first-pass OpenAI Vision analysis, then re-attach the original file (binary/base64) to the next step using a Merge node. The pattern ensures your downstream AI Agent (or any node) can access both the original file () and the first…

Source: https://n8n.io/workflows/8867/ — 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

Onboarding System Automation. Uses formTrigger, agent, lmChatOpenAi, openAi. Event-driven trigger; 9 nodes.

Form Trigger, Agent, OpenAI Chat +3
AI & RAG

🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.

OpenAI, HTTP Request, Form Trigger +7
AI & RAG

🧠 Automate end-to-end SEO blog creation and WordPress publishing using a GPT-5 multi-agent workflow with real-time research, metadata generation, and optional featured images.

Output Parser Structured, HTTP Request, OpenAI +10
AI & RAG

This is an automated blog post generation system that: Researches topics using AI agents and web search tools Writes complete blog posts with proper SEO structure Generates custom images for each post

Output Parser Structured, Google Gemini Chat, HTTP Request Tool +11
AI & RAG

📄 Documentation: Notion Guide

Telegram Trigger, HTTP Request, Agent +8