1. Opening Problem Statement
Meet Emma, a community manager in Berlin who needs to keep her local residents informed about daily weather conditions to help them plan their day better. Every morning, Emma used to manually check the temperature on weather websites and send SMS alerts to hundreds of residents. This repetitive task took her at least 30 minutes daily, often leading to delays or forgotten messages, causing inconvenience to the residents and additional stress for Emma.
Emma needed a reliable, automated way to fetch the daily temperature and instantly send SMS updates without lifting a finger, saving her time and improving communication efficiency.
2. What This Automation Does
This n8n workflow automates the daily SMS notification of the weather temperature using real-time data. Here’s what happens when it runs every morning at 9 AM:
- Automatically triggers the workflow at 9 AM sharp using the Cron node.
- Fetches the current temperature for Berlin from OpenWeatherMap API.
- Formats a friendly SMS message including the exact temperature in Celsius.
- Sends the SMS via Plivo to the designated recipients seamlessly.
- Eliminates manual weather checks and texting, saving around 30 minutes daily for Emma.
- Ensures consistent and timely delivery of weather updates to the community.
3. Prerequisites ⚙️
- n8n Account (cloud or self-hosted) 🔌
- Plivo account with API credentials for SMS sending 🔑
- OpenWeatherMap account with API key to fetch weather data 🔑
4. Step-by-Step Guide
Step 1: Setup the Cron Node to Trigger Daily at 9 AM
Navigate to the n8n editor and click on the + button to add a new node. Select the Cron node from the core nodes.
In the configuration panel, set the trigger time to 9 hours (9 AM) using the dropdown for hours under the triggerTimes settings.
You should see the node labeled “Cron” with a scheduled trigger for 9 AM daily. This node starts the workflow at the correct time.
Common Mistake: Forgetting to select the hour or setting the wrong time zone can cause the workflow to run at unintended times.
Step 2: Add the OpenWeatherMap Node to Fetch Current Temperature
Click the + button next to the Cron node’s output and add the OpenWeatherMap node.
Select the cityName parameter and enter berlin exactly (case insensitive) to fetch Berlin’s weather.
Under credentials, provide your OpenWeatherMap API key by selecting the saved credential or creating a new one.
This node will call the OpenWeatherMap API to retrieve current weather data, including temperature.
Common Mistake: Using an invalid or expired API key will cause API request failures.
Step 3: Configure the Plivo Node to Send SMS
Add the Plivo node connected after the OpenWeatherMap node.
In the message parameter, use the expression editor (click the gear icon) and enter the following message:
=Hey! The temperature outside is {{$node["OpenWeatherMap"].json["main"]["temp"]}}°C.This pulls the temperature from the OpenWeatherMap node response and inserts it into the SMS text dynamically.
Set up your Plivo API credentials in the node’s credential section to authorize SMS sending.
Common Mistake: Mismatching the expression syntax or incorrect node name will result in empty or incorrect messages.
Step 4: Connect Nodes for Data Flow
Ensure the Cron node’s output is connected to the OpenWeatherMap node’s input, and the OpenWeatherMap node’s output is connected to the Plivo node’s input.
You should see a clear workflow chain: Cron -> OpenWeatherMap -> Plivo.
This wiring ensures data flows correctly, triggering, fetching data, and sending messages in order.
Step 5: Test the Workflow Manually
Before scheduling, manually execute the workflow by clicking the Execute Workflow button in n8n.
Check that the Plivo node sends the SMS with the correct, current temperature fetched live.
If any errors appear, check credentials and node configuration carefully.
Step 6: Activate the Workflow
Once tested, activate the workflow by toggling the Active switch in n8n.
The workflow will now automatically run every day at 9 AM, sending temperature SMS updates without manual input.
5. Customizations ✏️
- Change the city name in the OpenWeatherMap node from “berlin” to any other location to customize weather alerts for different regions.
- Modify the SMS message in the Plivo node to include additional weather info like humidity or weather description using available data from OpenWeatherMap.
- Adjust the Cron node to send updates multiple times a day by adding more trigger hours for more frequent notifications.
6. Troubleshooting 🔧
Problem: “API request failed with unauthorized error”
Cause: Plivo or OpenWeatherMap API credentials are incorrect or expired.
Solution: Re-check and update API keys in the credential manager. Test connection in credentials settings.
Problem: “SMS message contents are empty or incorrect”
Cause: Incorrect JSON path in message expression.
Solution: Verify the expression: {{$node["OpenWeatherMap"].json["main"]["temp"]}} matches the actual data structure from the OpenWeatherMap node output.
7. Pre-Production Checklist ✅
- Verify OpenWeatherMap API credentials and that API calls return current temperature data correctly.
- Confirm Plivo API credentials and test SMS sending with a manual trigger.
- Test connectivity and response time for all nodes.
- Check that the Cron node is set to the desired timezone or adjust accordingly.
8. Deployment Guide
After activation, monitor the workflow for at least a day to ensure SMS messages are sent on time with accurate temperature data.
Leverage n8n’s execution logs to track successful runs and errors.
Adjust or add recipients on the Plivo side as needed for scalability.
9. FAQs
Q: Can I use a different SMS provider instead of Plivo?
Yes, n8n supports multiple SMS integrations like Twilio, Nexmo. You would just swap the Plivo node with your preferred SMS node and update credentials accordingly.
Q: Does sending SMS via Plivo cost extra?
Yes, Plivo charges per SMS. Check Plivo pricing for details, as costs vary by country and volume.
Q: Is my temperature data safe?
Yes, data is fetched securely via OpenWeatherMap API. No sensitive personal data is handled in this workflow.
10. Conclusion
By setting up this n8n workflow, Emma automated her daily weather alerts, saving herself 30 minutes each morning and ensuring reliable, timely updates for her community. The automation fetches live temperature data and sends SMS effortlessly at a scheduled time.
Next, you could expand this workflow to include weather forecasts, send notifications in multiple languages, or integrate with voice call reminders for broader reach.
Now that you’ve mastered this setup, you’re well on your way to automating more vital daily communications efficiently.