Scan Food Labels via WhatsApp
Lets users send food label images on WhatsApp via Superchat, then uses an AI agent to extract and reply with detailed nutrition information.
Overview
This workflow enables a WhatsApp-based nutrition label scanner powered by Superchat and an AI agent. Users send a photo of a food label to your WhatsApp number, and the workflow automatically extracts all nutrient values from the image and replies with a clear, readable summary — all within the WhatsApp conversation.
How It Works
- Webhook Trigger — A Superchat webhook fires whenever a user sends a message (image) to your WhatsApp number.
- Fetch the Image — An HTTP GET request retrieves the uploaded file from Superchat's API using the file ID from the incoming webhook payload. (Note: The URL should dynamically reference the file ID from the webhook data rather than using a hard-coded value.)
- AI Analysis — The image URL is passed to an AI agent node that analyzes the food label and extracts all nutrient values, including serving size, calories, fats, carbohydrates, protein, vitamins, and minerals.
- Identify the Sender — A parallel code node extracts the sender's identifier from the webhook payload so the reply goes to the right user.
- Merge Results — A merge node combines the AI analysis output and the sender information.
- Send Reply — An HTTP POST request sends the formatted nutrition breakdown back to the user on WhatsApp via Superchat's messaging API.
Workflow Nodes
| Node | Type | Purpose |
|---|---|---|
| Webhook Trigger | Trigger | Receives incoming WhatsApp messages from Superchat |
| HTTP GET (Fetch File) | HTTP Request | Retrieves the food label image file from Superchat |
| AI Agent | AI Model | Analyzes the label image and extracts nutrient values |
| Code (Sender Info) | Code | Extracts the sender's identifier for the reply |
| Merge | Control | Combines AI output and sender data |
| HTTP POST (Reply) | HTTP Request | Sends the nutrition summary back via WhatsApp |
Prerequisites
Before setting up this workflow, make sure you have:
- A Superchat account with an active WhatsApp number
- Your SUPERCHAT_API_KEY, found in Superchat Settings
- Your SUPERCHAT_CHANNEL_ID, found under your WhatsApp number settings in Superchat
Setup Steps
- Add the
SUPERCHAT_API_KEYandSUPERCHAT_CHANNEL_IDas variables in your Needle workspace. - Copy the webhook URL from the Webhook Trigger node in Needle.
- Paste the webhook URL into the Superchat webhook configuration so that incoming WhatsApp messages are forwarded to this workflow.
- Ensure the HTTP GET node dynamically references the file ID from the webhook payload (replace any hard-coded file ID placeholder like
<file-id>with the actual expression pointing to the incoming data). - Test by sending a photo of a food label to your WhatsApp number — you should receive a detailed nutrition breakdown within seconds.
What Gets Extracted
The AI agent reads the food label image and returns values including:
- Serving size
- Calories
- Total Fat (saturated fat, trans fat)
- Cholesterol
- Sodium
- Total Carbohydrates (dietary fiber, sugars)
- Protein
- Vitamins and minerals
- Any other nutrients shown on the label
The response is formatted as plain text, optimized for readability in WhatsApp conversations.
Want to showcase your own workflows?
Become a Needle workflow partner and turn your expertise into recurring revenue.
