Skip to main content

iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage

Workflow preview

Workflow preview
100%
iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

iMessage AI Powered Smart Calorie Tracker What it looks like in use: This image shows a visual of the workflow in action. Use it for ref...

Best for

  • Personal Productivity automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorypostgreschat, n8n-nodes-base.webhook, n8n-nodes-base.if, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by David Harvey.

Original n8n.io source

1.1 Workflow description

Title
iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage
Workflow name
iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage

iMessage AI-Powered Smart Calorie Tracker

> 📌 What it looks like in use:

> This image shows a visual of the workflow in action. Use it for reference when replicating or customizing the template.

This n8n template transforms a user-submitted food photo into a detailed, friendly, AI-generated nutritional report — sent back seamlessly as a chat message. It combines OpenAI's visual reasoning, Postgres-based memory, and real-time messaging with Blooio to create a hands-free calorie and nutrition tracker.


🧠 Use Cases

  • Auto-analyze meals based on user-uploaded images.
  • Daily/weekly/monthly diet summaries with no manual input.
  • Virtual food journaling integrated into messaging apps.
  • Nutrition companion for healthcare, fitness, and wellness apps.

📌 Good to Know

  • ⚠️ This uses GPT-4 with image capabilities, which may incur higher usage costs depending on your OpenAI pricing tier. Review OpenAI’s pricing.
  • The model uses visual reasoning and estimation to determine nutritional info — results are estimates and should not replace medical advice.
  • Blooio is used for sending/receiving messages. You will need a valid API key and project set up with webhook delivery.
  • A Postgres database is required for long-term memory (optional but recommended). You can use any memory node with it.

⚙️ How It Works

  1. Webhook Trigger
    The workflow begins when a message is received via Blooio. This webhook listens for user-submitted content, including any image attachments.

  2. Image Validation and Extraction
    A conditional check verifies the presence of attachments. If images are found, their URLs are extracted using a Code node and prepared for processing.

  3. Image Analysis via AI Agent
    Images are passed to an OpenAI-based agent using a custom system prompt that:

    • Identifies the meal,
    • Estimates portion sizes,
    • Calculates calories, macros, fiber, sugar, and sodium,
    • Scores the meal with a health and confidence rating,
    • Responds in a chatty, human-like summary format.
  4. Memory Integration
    A Postgres memory node stores user interactions for recall and contextual continuity, allowing day/week/month reports to be generated based on cumulative messages.

  5. Response Aggregation & Summary
    Messages are aggregated and summarized by a second AI agent into a single concise message to be sent back to the user via Blooio.

  6. Message Dispatch
    The final message is posted back to the originating conversation using the Blooio Send Message API.


🚀 How to Use

  • The included webhook can be triggered manually or programmatically by linking Blooio to a frontend chat UI.
  • You can test the flow using a manual POST request containing mock Blooio payloads.
  • Want to use a different messages app? Replace the Blooio nodes with your preferred messaging API (e.g., Twilio, Slack, Telegram).

✅ Requirements

  • OpenAI API access with GPT-4 Vision or equivalent multimodal support.
  • Blooio account with access to incoming and outgoing message APIs.
  • Optional: Postgres DB (e.g., via Neon) for tracking message context over time.

🛠️ Customising This Workflow

  • Prompt Tuning
    Tailor the system prompt in the AI Agent node to fit specific diets (e.g., keto, diabetic), age groups, or regionally-specific foods.

  • Analytics Dashboards
    Hook up your Postgres memory to a data visualization tool for nutritional trends over time.

  • Multilingual Support
    Adjust the response prompt to translate messages into other languages or regional dialects.

  • Image Preprocessing
    Insert a preprocessing node before sending images to the model to resize, crop, or enhance clarity for better results.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Send Message

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 6 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

Block 8 - Receive Message (From Blooio)

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 9 - HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - If has images, download them

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 11 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 12 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 14 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 15 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 16 - Don't respond to yourself

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage
Complexity advanced
Nodes 19
Categories Personal Productivity, AI Chatbot
Author David Harvey
Published 30 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5461/5461.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage do?

iMessage AI Powered Smart Calorie Tracker What it looks like in use: This image shows a visual of the workflow in action. Use it for ref...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Chatbot use case.