How to Automate Air Quality Alerts with n8n and Ambee API

This workflow automates fetching real-time air quality and pollen data using the Ambee API, then uses AI to generate personalized health suggestions sent via Gmail. It helps users stay informed and take action according to current environmental conditions.
Schedule Trigger
HTTP Request
agent
+5
Workflow Identifier: 2246
NODES in Use: Schedule Trigger, Set, HTTP Request, agent, toolThink, lmChatOpenAi, Gmail, Sticky Note
Automate air quality alerts with n8n and Ambee API

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

1. What This Workflow Does

This workflow runs every day at 7 AM and gets the air quality and pollen data for your location.

It sends an easy-to-read, personalized message to your email about how safe the environment is for your health.

This saves you time checking many sites and helps you plan your day without allergy surprises.


2. Who Should Use This Workflow

Anyone who wants daily updates about local air quality and pollen.

This is especially good for people with pollen allergies, asthma, or other health sensitivities.


3. Tools and Services Used

  • n8n: For building and running the automation workflow.
  • Ambee API: Provides real-time air pollution and pollen data using coordinates.
  • OpenAI GPT-4: Analyzes data and user profile to write a friendly health update.
  • Gmail with OAuth2: Sends personalized emails securely.

4. Beginner Step-by-Step: How to Use This Workflow in n8n

Download and Import

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where you want to deploy the workflow.
  3. Use Import from File option to load the workflow.

Configure Credentials and Settings

  1. Add your Ambee API Key in the HTTP Request nodes headers under “x-api-key”.
  2. Add your OpenAI API Key in the OpenAI Chat Model node credentials.
  3. Set up your Gmail OAuth2 credentials correctly in the Gmail node.
  4. Change location coordinates in the “Set Your Location Coordinates” node to your city’s latitude and longitude.
  5. Update the “Set User Profile” node with your age and health sensitivities if needed.
  6. Modify email recipient address(es) in the Gmail node to where you want the alerts sent.

Test and Activate

  1. Run the workflow manually once to check data fetching, AI summary, and email delivery.
  2. Fix any errors based on logs and messages.
  3. Activate the workflow to run automatically every day at the scheduled time.
  4. If self hosting n8n, see self-host n8n for setup help.

5. Inputs, Processing, and Outputs

Inputs

  • Your location coordinates (latitude and longitude).
  • User health profile data (age, allergies).

Processing Steps

  • The workflow triggers every day at 7 AM automatically.
  • It calls Ambee API twice: once for air quality, once for pollen data.
  • The AI agent uses OpenAI GPT-4 to analyze data with your user profile.
  • The AI writes a personalized summary telling you about air and pollen risks and health advice.
  • The workflow sends the message to your Gmail inbox via OAuth2 authentication.

Outputs

  • Daily email with a clear subject line.
  • Message body with tailored, friendly explanation about air and pollen conditions.

6. Common Edge Cases and Failures

  • 401 Unauthorized Errors: These happen if the Ambee API Key is wrong or missing. Fix by checking the “x-api-key” header.
  • Email Sending Errors: Gmail node may fail if OAuth2 credentials aren’t set or authorized properly. Reauthenticate them.
  • Incomplete AI Summaries: Caused by bad prompt variables or OpenAI downtime. Check JSON paths in AI Agent node and API key validity.
  • Missing or Invalid Coordinates: Wrong lat/lng format can fail API calls. Make sure coordinates are strings and accurate.

7. Customization Ideas

  • Change monitored location by updating coordinates in the corresponding node.
  • Add health details like asthma to improve AI advice in the user profile node.
  • Adjust daily trigger time to match your schedule (for example, 6 AM or 8 AM).
  • Send emails to multiple addresses by listing them with commas in the Gmail node.
  • Modify the AI Agent system prompt text to change tone, add safety tips or indoor plant advice.

8. Summary and Benefits

✓ Saves daily time spent checking multiple sites for air and pollen data.

✓ Gives a clear, personalized health message tailored to allergies and sensitivities.

✓ Automates the process with scheduled triggers, API calls, AI analysis, and email delivery.

✓ Helps plan outdoor activities safely and avoid allergy risks.

→ You get a daily morning email telling you the air and pollen status in your location.

→ You feel more confident about when it is safe to go outside.


9. Final Notes

Test the workflow on manual runs before activating the schedule to avoid errors.

Store API Keys and credentials securely in n8n.

Consider monitoring workflow runs with n8n logs to catch issues early.

Automate air quality alerts with n8n and Ambee API

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

Yes, replace the Gmail node with another email node like SMTP or Outlook and configure its credentials accordingly.
Each run makes two calls to Ambee API and one call to OpenAI API, so monitor usage quotas from those services.
Yes, data is securely processed in n8n and external APIs using encrypted connections. Keep API Keys private.
Yes, by adding nodes to loop over different user profiles and locations, it can send personalized alerts to many users.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.