Back to Catalog

Automated water consumption tracker - stored in sheet and notify in Slack

darrell_twdarrell_tw
845 views
2/3/2026
Official Page

Water Reminder Workflow

This workflow demonstrates how to use n8n and Slack to build an intelligent water drinking reminder system, combined with Google Sheets for data recording and OpenAI for generating personalized reminder messages.


Google Sheet Template

The iOS shortcut template: IMG_5835_5dcead4a70_1_09d5e26b6c 1.jpg

The result in iOS health: IMG_0378_35d2c74ab3 1.png

The template demo in Youtube


Key Features

  1. Scheduled Reminders: Automatically sends water reminders at random times every hour.
  2. Intelligent Scheduling: Delays the next reminder if you've recently had water.
  3. AI-Generated Messages: Uses OpenAI to generate friendly and non-repetitive reminder messages.
  4. Data Tracking: Records daily water intake and calculates percentage of goal achievement.
  5. Quick Response: Easily record water intake through Slack buttons.
  6. iOS Integration: Provides iOS shortcut links to sync data with the Health app.

Pre-Configuration Requirements

To use this workflow, you need to set up the following:

  1. Google Sheets:

    • Create a Google spreadsheet with log and setting sheets
    • The log sheet should include date, time, and value columns
    • The setting sheet is used to store daily water intake goals
  2. Slack:

    • Create a Slack app and obtain an API token
    • Configure permissions for interactive buttons
  3. OpenAI:

    • Obtain an OpenAI API key
  4. iOS Shortcut (optional):

    • Create an iOS shortcut named darrell_water for recording health data

Node Configurations

1. Scheduled Triggers and Data Collection

1.1. Schedule Trigger

  • Purpose: Triggers water reminders on schedule
  • Configuration:
    • Cron Expression: 0 {{ Math.floor(Math.random() * 11) }} 8-23 * * *
    • Triggers at a random minute every hour, only between 8 AM and 11 PM

1.2. Google Sheets - Get Target

  • Purpose: Retrieves daily water intake goal
  • Configuration:
    • Document ID: Your Google spreadsheet ID
    • Sheet Name: setting

1.3. Google Sheets - Get Log

  • Purpose: Retrieves today's water intake records
  • Configuration:
    • Document ID: Your Google spreadsheet ID
    • Sheet Name: log
    • Filter Condition: date equals today's date {{ $now.format('yyyy-MM-dd') }}

1.4. Summarize

  • Purpose: Calculates total water intake for today
  • Configuration:
    • Fields to Summarize: value (sum)

1.5. Limit

  • Purpose: Gets the most recent water intake record
  • Configuration:
    • Keep: Last items

2. Intelligent Reminder Logic

2.1. Combine Data

  • Purpose: Merges target and actual water intake data
  • Configuration:
    • Combine By: Combine by position
    • Number of Inputs: 3

2.2. If

  • Purpose: Checks if water was consumed recently
  • Configuration:
    • Condition:
      • {{ DateTime.fromISO($json.date+"T"+$json.time).format('yyyy-MM-dd HH:mm:ss') }} is after {{ $now.minus(30, "minutes") }}

2.3. Wait

  • Purpose: Randomly delays the reminder if water was consumed recently
  • Configuration:
    • Wait Time: {{ Math.floor(Math.random() * 1) + 1 }} minutes

3. AI Message Generation and Sending

3.1. OpenAI

  • Purpose: Generates personalized water reminder messages
  • Configuration:
    • Model: gpt-4o-mini
    • Messages:
      • System prompt: Requests responses in Traditional Chinese and in JSON format
      • User prompt: Includes information about last water time, current time, goal, and progress
    • Temperature: 1

3.2. Slack Send Drink Notification

  • Purpose: Sends water reminders to Slack channel
  • Configuration:
    • Channel: Your Slack channel ID
    • Message Type: Block
    • Block UI: Contains AI-generated reminder message and water amount buttons (100ml, 150ml, 200ml, 250ml, 300ml)

4. User Interaction and Data Recording

4.1. Slack Drink Webhook

  • Purpose: Receives user interactions when water buttons are clicked
  • Configuration:
    • HTTP Method: POST
    • Path: slack-water-webhook

4.2. Slack Action Payload

  • Purpose: Parses Slack interaction data
  • Configuration:
    • Mode: Raw
    • JSON Output: {{ $json.body.payload }}

4.3. Slack Action Drink Data

  • Purpose: Extracts water amount and message information
  • Configuration:
    • Assignments:
      • value: {{ $json.actions[0].value }}
      • message_text: {{ $json.message.text }}
      • shortcut_url: shortcuts://run-shortcut?name=darrell_water&input=
      • shortcut_url_data: JSON containing water amount and time
      • message_ts: {{ $json.container.message_ts }}

4.4. Google Sheets

  • Purpose: Records water intake data to spreadsheet
  • Configuration:
    • Operation: Append
    • Document ID: Your Google spreadsheet ID
    • Sheet Name: log
    • Column Mapping:
      • date: {{ $now.format('yyyy-MM-dd') }}
      • time: {{ $now.format('HH:mm:ss') }}
      • value: {{ $json.value }}

4.5. Send to Slack with Confirm

  • Purpose: Sends confirmation message and provides iOS shortcut link
  • Configuration:
    • Channel: Your Slack channel ID
    • Message Type: Block
    • Block UI: Contains confirmation message and iOS Health app button
    • Reply Settings: Reply to the thread of the original message

Author Information

This workflow was created by darrell_tw_, an engineer focused on AI and Automation.

Contact:

Automated Water Consumption Tracker with Google Sheets and Slack Notifications

This n8n workflow provides a robust solution for tracking daily water consumption, storing the data in a Google Sheet, and sending daily summary notifications to a Slack channel. It helps individuals or teams monitor their hydration goals efficiently.

What it does

  1. Triggers Daily: The workflow is scheduled to run once every day.
  2. Generates Water Consumption Prompt: It uses OpenAI to generate a prompt for the user to input their water consumption for the day.
  3. Waits for User Input: It then waits for a webhook call, expecting the user to respond with their daily water consumption.
  4. Stores Data in Google Sheet: Upon receiving the water consumption, it appends a new row to a specified Google Sheet, recording the date and the consumed amount.
  5. Retrieves Last 7 Days of Data: It reads the last 7 entries from the Google Sheet to analyze recent consumption.
  6. Calculates Average Consumption: It calculates the average water consumption over the last 7 days.
  7. Determines Hydration Status: It compares the average consumption against a target (e.g., 2 liters) to determine if the user is meeting their hydration goals.
  8. Sends Daily Slack Notification: It sends a Slack message summarizing the day's water intake, the 7-day average, and a personalized message based on the hydration status (e.g., "Great job!" or "Remember to drink more!").

Prerequisites/Requirements

  • n8n Instance: A running n8n instance.
  • Google Sheets Account: A Google Sheets spreadsheet set up to store water consumption data.
    • You will need to configure Google Sheets credentials in n8n.
  • Slack Account: A Slack workspace and a channel where notifications will be sent.
    • You will need to configure Slack credentials in n8n.
  • OpenAI API Key: An OpenAI API key to generate the initial prompt.
    • You will need to configure OpenAI credentials in n8n.

Setup/Usage

  1. Import the Workflow:
    • Download the provided JSON file.
    • In your n8n instance, click on "Workflows" in the left sidebar.
    • Click "New" and then "Import from JSON".
    • Paste the workflow JSON or upload the file.
  2. Configure Credentials:
    • Locate the "Google Sheets" node and configure your Google Sheets credentials. Specify the Spreadsheet ID and Sheet Name where water consumption data will be stored. Ensure the sheet has columns for Date and Water_Consumed_Liters (or similar, matching the workflow's data structure).
    • Locate the "Slack" node and configure your Slack credentials. Specify the Channel ID where notifications should be posted.
    • Locate the "OpenAI" node and configure your OpenAI API key.
  3. Configure Webhook:
    • The "Webhook" node will provide a unique URL once the workflow is activated. This URL is where you'll send your daily water consumption data.
    • You can trigger this webhook manually (e.g., via a simple HTTP request or a custom app) or integrate it with other systems.
  4. Activate the Workflow:
    • Once all credentials and configurations are set, activate the workflow by toggling the "Active" switch in the top right corner of the workflow editor.
  5. Daily Interaction:
    • Every day, the "Schedule Trigger" will initiate the workflow.
    • The "OpenAI" node will generate a prompt.
    • The workflow will then wait at the "Webhook" node for your input. Send a POST request to the webhook URL with your water consumption data (e.g., {"water_consumed": 2.5}).
    • After receiving the input, the workflow will process the data, update the Google Sheet, and send a Slack notification.

Related Templates

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chatβ€”turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. πŸ“‹ What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing πŸ”§ Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation πŸ”‘ Required Credentials OpenAI API Setup Go to platform.openai.com β†’ API keys (sidebar) Click "Create new secret key" β†’ Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai β†’ Dashboard β†’ API Keys Generate a new API key β†’ Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) βš™οΈ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowβ€”chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

AI-powered code review with linting, red-marked corrections in Google Sheets & Slack

Advanced Code Review Automation (AI + Lint + Slack) Who’s it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting β€” all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0–10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your team’s channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow β€” reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why it’s valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n β€” combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your team’s review history transparent and centralized.

higashiyama By higashiyama
90

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353