Fetch Recent SpaceX Launches via GraphQL - n8n Workflow

Use this powerful n8n workflow to automatically query the SpaceX GraphQL API and retrieve details for the last 5 launches. Learn how to use the specific GraphQL n8n node effectively.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Space enthusiasts and hobbyists who track launch data.

  • Developers needing an example of a robust GraphQL query using an n8n node.

  • Users building data pipelines that require structured API interaction.

  • Anyone looking for advanced n8n templates focusing on data extraction.

Overview

This automation provides an excellent demonstration of utilizing the specialized GraphQL n8n node to interact with complex web services. Many modern APIs rely on GraphQL for efficient data querying. Instead of retrieving excessive data via a standard REST API, this n8n workflow uses a precise query to retrieve only the mission name, launch details, rocket configuration, and associated ship data for the last five launches.

This simple yet powerful n8n template ensures minimal latency and bandwidth usage, making it an efficient piece of any data integration strategy built within n8n. If you are learning how to manage external data sources, analyzing this n8n workflow provides crucial insights into data extraction techniques.

How it Works

The entire process is initiated by a manual n8n trigger, designed for immediate execution and testing. The flow begins at the 'On clicking 'execute'' n8n trigger node. From there, the execution passes directly to the 'GraphQL' n8n node.

The 'GraphQL' n8n node is configured to connect to the public https://api.spacex.land/graphql/ endpoint. It sends a large, specific GraphQL query requesting the last five entries (launchesPast(limit: 5)). This query retrieves deeply nested information including launch site names, article and video links, detailed rocket information (cores, reuse count, payloads, mass), and associated ships.

Upon receiving the response, the GraphQL n8n node automatically parses the string response into structured JSON objects, making the rich space data immediately available for subsequent n8n nodes in the workflow, such as storage or notification steps. This entire n8n workflow is a single-step data retrieval operation.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' menu > 'Import from JSON'.

  2. Required Credentials: No credentials are required for this specific n8n workflow as the SpaceX API is public and anonymous access is allowed.

  3. Execution: Since this n8n workflow uses a 'Manual Trigger', you can execute it immediately by clicking the 'Execute Workflow' button in the interface to test the GraphQL n8n node and view the output data.

Node Details

On clicking 'execute' (Manual Trigger n8n Trigger)
Function: Acts as the starting point, allowing manual execution of the n8n workflow when needed.
Key Configuration: Standard manual n8n trigger configuration.

GraphQL (GraphQL n8n Node)
Function: Executes the defined GraphQL query against the SpaceX API to retrieve structured launch data.
Key Configuration:
Endpoint: https://api.spacex.land/graphql/.
Query: A detailed query targeting launchesPast(limit: 5), extracting data points like missionname, launchdate_local, and nested fields for rocket and ships. This demonstrates the power of the GraphQL n8n node to request precise data structures.

Related n8n Workflows

Free

Nodes: 2 Nodes
Updated: December 26 2025
View all
Created by
amudhan
amudhan

Featured*