From 2f4f88c4568afb8a8815657db9d157fac5cdc76a Mon Sep 17 00:00:00 2001 From: nusquama Date: Wed, 12 Nov 2025 19:23:06 +0100 Subject: [PATCH] creation --- .../readme-5507.md | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 workflows/Analyze Images from Forms using GPT-4o-mini Vision and Deliver to Telegram-5507/readme-5507.md diff --git a/workflows/Analyze Images from Forms using GPT-4o-mini Vision and Deliver to Telegram-5507/readme-5507.md b/workflows/Analyze Images from Forms using GPT-4o-mini Vision and Deliver to Telegram-5507/readme-5507.md new file mode 100644 index 000000000..015b39ca3 --- /dev/null +++ b/workflows/Analyze Images from Forms using GPT-4o-mini Vision and Deliver to Telegram-5507/readme-5507.md @@ -0,0 +1,186 @@ +Analyze Images from Forms using GPT-4o-mini Vision and Deliver to Telegram + +https://n8nworkflows.xyz/workflows/analyze-images-from-forms-using-gpt-4o-mini-vision-and-deliver-to-telegram-5507 + + +# Analyze Images from Forms using GPT-4o-mini Vision and Deliver to Telegram + +### 1. Workflow Overview + +This workflow automates the process of analyzing images submitted via a form and delivering the AI-generated analysis directly to a specified Telegram chat. It is designed for scenarios such as instant screenshot interpretation, automated document or receipt analysis, OCR tasks, and image classification workflows. The logic is divided into four main functional blocks: + +- **1.1 Input Reception:** Captures image submissions from a form trigger. +- **1.2 AI Processing:** Sends the submitted image to OpenAI’s GPT-4o-mini Vision model for analysis. +- **1.3 Chat ID Setup:** Defines the Telegram chat ID where the analysis result will be delivered. +- **1.4 Telegram Delivery:** Sends the AI-generated analysis text to the specified Telegram chat. + +--- + +### 2. Block-by-Block Analysis + +#### 1.1 Input Reception + +**Overview:** +This block listens for form submissions containing an image file. It acts as the workflow’s entry point by capturing user-uploaded images for analysis. + +**Nodes Involved:** +- On form submission + +**Node Details:** + +- **On form submission** + - **Type:** Form Trigger + - **Technical Role:** Listens for and receives form submissions with file uploads. + - **Configuration:** + - Triggered by submissions to a form titled "ANALYZE IMAGE" + - Single form field configured to accept a file upload labeled "upload here" + - Form description instructs the user to input the image for analysis + - **Key Expressions/Variables:** The uploaded file is accessible as binary data under the property named after the form field ("upload_here"). + - **Input Connections:** None (trigger node) + - **Output Connections:** Feeds into the OpenAI node + - **Version-Specific Requirements:** Uses typeVersion 2.2 for the form trigger node. + - **Potential Failures:** Missing or invalid file uploads, webhook misconfiguration, or network issues may cause failures. + - **Sub-workflow Reference:** None. + +#### 1.2 AI Processing + +**Overview:** +This block performs the image analysis by sending the base64-encoded image to the OpenAI GPT-4o-mini Vision model, which returns a descriptive text analysis of the image content. + +**Nodes Involved:** +- OpenAI + +**Node Details:** + +- **OpenAI** + - **Type:** OpenAI node (from Langchain integration) + - **Technical Role:** Processes the submitted image with an AI vision model to analyze the image content. + - **Configuration:** + - Model ID set to "gpt-4o-mini" + - Operation set to "analyze" under the "image" resource + - Input type specified as "base64" + - Binary property name is "upload_here" to match the form field’s binary data + - OpenAI API credentials configured via an existing credential named "OpenAi account Dave" + - **Key Expressions/Variables:** Processes binary data from the form trigger; outputs analysis text in `item.json.content`. + - **Input Connections:** Receives data from "On form submission" node + - **Output Connections:** Passes result to "Set your Telegram Chat ID" node + - **Version-Specific Requirements:** Uses typeVersion 1.8; ensure compatibility with Langchain OpenAI integration in n8n. + - **Potential Failures:** Authentication errors with OpenAI API, timeouts on large images, invalid binary data input, API quota limits. + - **Sub-workflow Reference:** None. + +#### 1.3 Chat ID Setup + +**Overview:** +This block statically assigns the Telegram chat ID to which the AI analysis text will be sent. It can be replaced with dynamic lookups for multi-user workflows. + +**Nodes Involved:** +- Set your Telegram Chat ID + +**Node Details:** + +- **Set your Telegram Chat ID** + - **Type:** Set node + - **Technical Role:** Creates a workflow variable holding the target Telegram chat ID. + - **Configuration:** + - Sets a string variable named "telegram chat id " (with trailing space) to the value "60277172761" + - **Key Expressions/Variables:** The variable is referenced downstream to specify the chat ID for message delivery. + - **Input Connections:** Receives the analysis output from OpenAI node + - **Output Connections:** Sends data to the "Telegram Delivery" node + - **Version-Specific Requirements:** Uses typeVersion 3.4 + - **Potential Failures:** Misconfigured or invalid chat ID will cause Telegram delivery failures. + - **Sub-workflow Reference:** None. + +#### 1.4 Telegram Delivery + +**Overview:** +This block sends the text analysis generated by the AI to the predefined Telegram chat using a Telegram bot. + +**Nodes Involved:** +- Telegram Delivery + +**Node Details:** + +- **Telegram Delivery** + - **Type:** Telegram node + - **Technical Role:** Sends a Telegram message containing the AI’s image analysis. + - **Configuration:** + - Text content dynamically set to the output from OpenAI node via expression: `={{ $('OpenAI').item.json.content }}` + - Chat ID dynamically set to the previously assigned "telegram chat id " variable via expression: `={{ $json['telegram chat id '] }}` + - Uses credentials stored under "Telegram account 2" + - Operation defaults to sending a message (sendMessage) + - **Key Expressions/Variables:** References previous nodes for message content and chat ID. + - **Input Connections:** Receives input from "Set your Telegram Chat ID" node + - **Output Connections:** None (final node) + - **Version-Specific Requirements:** Uses typeVersion 1.2 + - **Potential Failures:** Invalid bot token, incorrect chat ID, Telegram API rate limits, message formatting errors. + - **Sub-workflow Reference:** None. + +#### Additional Node + +- **Sticky Note** + - **Type:** Sticky note node + - **Technical Role:** Provides detailed documentation and setup instructions within the workflow editor for user reference. + - **Position:** Positioned offset from main flow for visibility. + - **Content:** Explains use cases, setup guide steps, and testing instructions. + - **Input/Output connections:** None. + +--- + +### 3. Summary Table + +| Node Name | Node Type | Functional Role | Input Node(s) | Output Node(s) | Sticky Note | +|------------------------|--------------------------------|---------------------------------|----------------------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| On form submission | Form Trigger | Captures image upload via form | None | OpenAI | See sticky note for detailed workflow purpose and setup guide. | +| OpenAI | OpenAI (Langchain integration) | Analyzes uploaded image using GPT-4o-mini Vision | On form submission | Set your Telegram Chat ID | See sticky note for detailed workflow purpose and setup guide. | +| Set your Telegram Chat ID | Set | Assigns Telegram chat ID string | OpenAI | Telegram Delivery | See sticky note for detailed workflow purpose and setup guide. | +| Telegram Delivery | Telegram | Sends analysis result to Telegram chat | Set your Telegram Chat ID | None | See sticky note for detailed workflow purpose and setup guide. | +| Sticky Note | Sticky Note | Provides workflow documentation | None | None | ## This workflow analyzes images submitted via a form using OpenAI Vision, then delivers the analysis result directly to your Telegram chat. Use case examples and setup guide steps included. | + +--- + +### 4. Reproducing the Workflow from Scratch + +1. **Create the Form Trigger Node** + - Add a **Form Trigger** node, name it "On form submission". + - Set form title to `"ANALYZE IMAGE"`. + - Add one form field of type **File Upload**, label it `"upload here"`. + - Optionally add a form description: `"input the image you want to analyse"`. + - This node will act as the webhook entry point for image submissions. + +2. **Configure OpenAI Node for Image Analysis** + - Add an **OpenAI** node (Langchain integration), name it "OpenAI". + - Select model `"gpt-4o-mini"`. + - Set the resource to `"image"` and operation to `"analyze"`. + - Set input type to `"base64"`. + - Set binary property name to `"upload_here"` (matching the form field's binary data name). + - Enter your OpenAI API credentials or create new ones if not present. + - Connect the output of "On form submission" node to this node’s input. + +3. **Set Telegram Chat ID** + - Add a **Set** node, name it `"Set your Telegram Chat ID"`. + - Create a new string field named `"telegram chat id "` (note the trailing space) and assign your Telegram Chat ID as a string value, e.g., `"60277172761"`. + - Connect the output of "OpenAI" node to this node’s input. + +4. **Configure Telegram Delivery Node** + - Add a **Telegram** node, name it `"Telegram Delivery"`. + - Connect your Telegram Bot credentials (create or select an existing Telegram API credential using your bot token). + - Set the message text parameter to the expression: `={{ $('OpenAI').item.json.content }}` to send the AI-generated analysis text. + - Set the chat ID parameter to the expression: `={{ $json['telegram chat id '] }}` to use the chat ID from the previous node. + - Connect the output of "Set your Telegram Chat ID" node to this node’s input. + +5. **Test the Workflow** + - Activate the workflow webhook by executing the workflow manually or deploying it. + - Submit an image through the configured form. + - Confirm that the image is analyzed by OpenAI and the text result is delivered to the specified Telegram chat. + +--- + +### 5. General Notes & Resources + +| Note Content | Context or Link | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------| +| This workflow analyzes images submitted via a form using OpenAI Vision, then delivers the analysis result directly to your Telegram chat. Use cases include instant screenshot interpretation, automated document or receipt analysis, quick OCR, and image classification workflows. Setup steps are detailed inside the workflow sticky note. | Workflow purpose and setup instructions (embedded sticky note) | + +--- + +**Disclaimer:** The provided text is exclusively generated from an automated n8n workflow. It respects all content policies and contains no illegal or protected material. All data handled is legal and public. \ No newline at end of file