Image Segmentation, Object Detection, and Multi-Channel Sharing - n8n Workflow

Use this powerful n8n workflow to automate image segmentation and object detection using VLM Run, then automatically upload results to Google Drive and share via Telegram. A robust n8n automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical teams needing parallel image processing (segmentation and detection).

  • Users looking for advanced, asynchronous n8n templates integrating external AI APIs.

  • Anyone who needs to automatically distribute AI-processed results to cloud storage and messaging apps.

  • n8n users seeking examples of combining HTTP requests, code nodes, and cloud services.

Overview

This comprehensive n8n workflow demonstrates how to build resilient, asynchronous automations around computationally intensive AI tasks. When a user uploads an image via the initial form n8n trigger, the file is immediately dispatched to two separate VLM Run agents—one for segmentation and one for object detection. The use of multiple webhook n8n nodes allows the core flow to continue without waiting for the lengthy AI processing, achieving parallelism.

Once the AI task is complete, the VLM Run service calls back to the specified webhook n8n trigger, providing a securely signed Google Cloud Storage URL. A critical component of this n8n workflow is the custom code n8n node, which ensures the full signed URL (including authentication parameters) is extracted correctly. Finally, the processed image is downloaded and automatically archived to Google Drive and shared instantly via Telegram. This setup is a prime example of leveraging the power of n8n for complex data pipelines.

How it Works


  1. Form Trigger Activation: The n8n workflow starts when a user uploads a file (PDF or image) via the Upload Image Form Trigger n8n node.

  2. Parallel AI Dispatch: The uploaded file is immediately sent to two custom VLM Run agents: VLM Run (Segmentation) and VLM Run (Detection). These agents handle the heavy visual processing asynchronously.

  3. Asynchronous Callbacks: Each VLM Run agent is configured with a unique callback URL, handled by the Webhook for Segmented Image and Webhook for Detected Image n8n nodes. When the AI processing is finished, the results (a signed image URL) are posted back to the respective webhook n8n trigger.

  4. URL Extraction and Normalization: The flow merges into the Code n8n node. This node uses JavaScript regex to precisely extract the full signed URL from the JSON payload, crucial for preventing download authentication errors.

  5. Secure Download: The Download Image HTTP Request n8n node uses the extracted signed URL to fetch the processed image's binary data securely.

  6. Multi-Channel Distribution: The final binary data is shared via two separate n8n nodes: the Upload File Google Drive n8n node uploads the image to a designated folder, and the Send Image Telegram n8n node pushes the result to a specified chat ID, completing the end-to-end n8n workflow.

Installation Guide


  1. Import the n8n template: Copy the provided JSON and import it into your n8n instance.

  2. Form Trigger Setup: Activate the Upload Image Form Trigger n8n node and note the webhook URL generated. This is the entry point for the n8n workflow.

  3. VLM Run Credentials: Configure your VLM Run API credentials. Ensure the callback URLs provided in the VLM Run (Segmentation) and VLM Run (Detection) n8n nodes are correctly pointing to the public URLs of the respective Webhook n8n nodes.

  4. Google Drive Setup: Provide valid Google Drive OAuth2 credentials and specify the target Drive ID and Folder ID for the Upload File n8n node.

  5. Telegram Setup: Set up credentials for the Telegram API (Bot Token) and input the correct chatId in the Send Image n8n node where you want the processed images to be delivered.

  6. Activation: Save and activate the n8n workflow to start automation.

Node Details

Upload Image (Form Trigger n8n node): The primary n8n trigger for the workflow. It provides a simple form for users to upload files (configured to accept .pdf, .csv, though used here for images).
VLM Run (Segmentation / Detection): Custom n8n node for interacting with VLM Run AI agents. It sends the input image and specifies an agentPrompt (e.g., "Segment all objects"). Crucially, it defines agentCallbackUrl to tell VLM Run where to send the results back.
Webhook for Segmented/Detected Image (Webhook n8n trigger): These asynchronous n8n nodes listen for the callback responses from VLM Run. They use unique paths (imagesegmentation, imagedetection).
Code (n8n node): A custom scripting block essential for this n8n workflow. It uses a regex (https?:\/\/[^\s"]+) to locate and extract the full, query-parameter-inclusive signed URL necessary for authenticated download.
Download Image (HTTP Request n8n node): Fetches the processed image binary data using the signed URL provided by the Code n8n node (={{ $json.url }}). This brings the image back into the n8n execution context.
Upload File (Google Drive n8n node): Archives the processed image to Google Drive, using the test_data folder ID specified in the parameters.


  • Send Image (Telegram n8n node): Distributes the final image to a specific chat using the sendDocument operation and utilizing the binary data output from the Download Image n8n node.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Mehedi Ahamed
Mehedi Ahamed

Featured*