Analyze images with OpenAI Vision while preserving binary data for reuse
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...
Template notes
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 (data) and the first analysis result (content) at the same time.
---
✅ What this template does - Collects an image file via Form Trigger (binary field labeled data) - Analyzes the image with OpenAI Vision (GPT-4o) using base64 input - Merges the original upload and the analysis result (combine by position) so the next node has both - Re-analyzes/uses the image alongside the first analysis in an AI Agent step
---
🧩 How it works (Node-by-node) 1. Form Trigger - Presents a simple upload form and emits a binary/base64 field named data. 2. Analyze image (OpenAI Vision) - Reads the same data field as base64 and runs image analysis with GPT-4o. - The node outputs a text content (first-pass analysis). 3. Merge (combine by position) - Combines the two branches so the next node receives both the original upload (data) and the analysis (content) on the same item. 4. AI Agent - Receives data + content together. - Prompt includes the original image (=data) and the first analysis ({{$json.content}}) to compare or refine results. 5. OpenAI Chat Model - Provides the language model for the Agent (wired as ailanguageModel).
---
🛠️ Setup Instructions (from the JSON) > Keep it simple: mirror these settings and you’re good to go.
1) Form Trigger (n8n-nodes-base.formTrigger) - Path: d6f874ec-6cb3-46c7-8507-bd647c2484f0 (you can change this) - Form Title: Image Document Upload - Form Description: Upload a image document for AI analysis - Form Fields: - Label: data - Type: file - Output: emits a binary/base64 field named data.