Planetary Defense System for NASA Asteroid Alerts - n8n Workflow

Use this powerful n8n workflow to monitor hazardous asteroid data from NASA daily. It employs an n8n trigger, OpenAI for custom Sci-Fi alerts, DeepL translation, and LINE notifications.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical enthusiasts interested in space and data monitoring.

  • Developers seeking advanced n8n templates integrating AI, translation, and notification services.

  • Users who need scheduled, automated API checks.

  • Individuals looking to create custom, branded alerts using an n8n workflow.

Overview

Keeping track of real-time space threats is crucial for those interested in planetary defense, but manually checking NASA APIs is tedious. This comprehensive n8n workflow solves this by acting as your automated early warning system. It runs daily, fetching up-to-the-minute asteroid data from NASA. If a potentially hazardous object is detected, the n8n workflow leverages the power of generative AI (OpenAI) to craft an urgent, engaging, Sci-Fi-style warning. This warning is then localized using DeepL translation before being instantly delivered via LINE Notify. Whether it’s a detailed alert or a simple 'Peace Report,' this n8n automation ensures you are always informed without manual intervention, making it one of the most unique n8n templates available for data processing and alert generation.

How it Works

The operation of this n8n workflow is divided into three logical stages, starting with a scheduled n8n trigger:


  1. Scheduled Data Fetch: The workflow starts with the Daily Schedule n8n trigger, set to run every morning at 9:00 AM. It immediately calls the NASA NeoWs API using the dedicated n8n node to retrieve asteroid approach data for the current day.

  2. Filtering and Calculation: The workflow proceeds to a Code n8n node, which executes custom JavaScript. This script filters the raw NASA data, retaining only asteroids flagged as 'potentially hazardous.' Crucially, it calculates the asteroid's miss distance relative to the Moon’s distance (Lunar Distance) and sets a type flag: 'DANGER' or 'PEACE.'

  3. Threat Path Branching: The Check Threat Level Switch n8n node evaluates the 'type' flag.

Peace Path: If 'PEACE,' a routine 'All Green' report is sent via the LINE n8n node (Send Peace Report1).
Danger Path: If 'DANGER,' the flow continues to the OpenAI n8n node (Generate SF Alert1) to create a custom alert message based on the asteroid details. This output is then piped to the DeepL n8n node for translation (e.g., to Japanese). Finally, the translated, dramatic alert is sent via the LINE n8n node (Send Danger Alert1). This use of the schedule n8n trigger ensures timely monitoring.

Installation Guide

To deploy this expert n8n workflow, follow these setup steps:


  1. Import: Copy the provided JSON and import it into your n8n instance as a new n8n workflow.

  2. NASA API Key: Sign up for an API key at api.nasa.gov. Configure the credentials for the Get Asteroid Data1 n8n node.

  3. OpenAI: Set up your OpenAI credential for the Generate SF Alert1 n8n node. This node uses Chat resources to generate the content.

  4. DeepL: Configure your DeepL API key for the Translate Alert1 n8n node. If you do not require translation, you can remove this n8n node or adjust the target language (Translate To).

  5. LINE Notify: Generate a LINE Notify token. Configure this credential for both Send Danger Alert1 and Send Peace Report1 n8n nodes. Ensure the token is linked to the desired chat or group.

  6. Activation: Once all credentials are set, activate the n8n workflow. The scheduled n8n trigger will begin execution at the specified time.

Node Details

Daily Schedule1 (n8n trigger): The primary n8n trigger for the entire n8n workflow. It is configured to run daily at 9:00 AM, ensuring a predictable monitoring schedule.
Get Asteroid Data1 (NASA n8n node): Connects to NASA's NeoWs API. Its function is to fetch asteroid orbital data for the current day. Requires a NASA API credential.
Filter & Calculate Distance1 (Code n8n node): The analytical heart of this n8n workflow. It filters the results for ispotentiallyhazardous_asteroid: true and calculates the relative lunar distance (miss distance in km divided by the Moon's distance) to provide context for the alert.
Check Threat Level1 (Switch n8n node): Controls the flow path based on the output of the Code n8n node (DANGER or PEACE), routing the automation appropriately.
Generate SF Alert1 (OpenAI n8n node): Used only in the 'DANGER' path. It generates a dramatic, context-aware alert message using AI based on the asteroid's name, size, and distance calculation. An essential AI integration within this n8n workflow.
Translate Alert1 (DeepL n8n node): Translates the AI-generated warning (currently configured for Japanese, JA). This is a key customization feature of this n8n template.


  • Send Danger Alert1 / Send Peace Report1 (LINE n8n node): The final action nodes. They use LINE Notify to send the appropriate warning or safety report to the user's preferred notification channel.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
寳田 武
寳田 武

Featured*