- Processes images, audio messages, and text requests from WhatsApp to analyze food and drink consumption.
- Updates Google Sheets with food history and provides personalized responses using AI models.
- WhatsApp Trigger: The workflow starts when a new message (text, image, or audio) is received on WhatsApp.
- Switch Node: Determines the type of message (text, image, or audio) and routes it accordingly.
- Image Path:
- Downloads the image.
- Sends it to an HTTP request for analysis.
- Extracts calories information.
- Updates Google Sheets with the food entry.
- Reads back data from the sheet and sends it to the AI model for response generation.
- Audio Path:
- Downloads the audio message.
- Transcribes it to text.
- Processes it with AI to extract user requests.
- Updates Google Sheets and aggregates data for AI response.
- Text Request Path:
- Edits fields as needed.
- Reads Google Sheets for user’s food history.
- Merges with aggregated data.
- AI agent generates a personalized response.
- Response:
- The AI-generated message is sent back to the user via WhatsApp.
- Download media: Fetch images or audio messages from WhatsApp.
- HTTP Request: Communicate with APIs for analysis.
- Edit Fields: Preprocess or enrich the data before storing.
- Google Sheets: Stores and retrieves user food history.
- Aggregate & Merge: Combine historical data for AI analysis.
- AI Agent: Generates dietary advice and responses.
- Send Message: Responds to the user on WhatsApp.
- n8n workflow automation platform
- WhatsApp API access
- Google Sheets API credentials
- OpenAI API key
- Open n8n online and create a new workflow.
- Follow all prompts in n8n to configure nodes.
- Use
food_images_analysis.ipynbfor image processing instructions. - Use
text_voice_requests.mdfor handling text and voice messages. - Start the workflow to automate WhatsApp food tracking.
- n8n for workflow automation.
- OpenAI API for AI-based analysis.
- Google Sheets & Drive APIs for data storage.
- Tutorial inspiration from YouTube channel.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.

