Turn NASA Astronomy Pictures into Matching Spotify Tracks using GPT-4o Vision

Go to Workflow
0 views
Built by Takumi Oku Takumi Oku
Created on June 07, 2026

Description

Who is this for
Space Enthusiasts & Music Lovers**: Discover new music paired with stunning cosmic visuals.
Community Managers**: specific Slack channels with engaging, creative daily content.
n8n Learners**: Learn how to chain Image Analysis (Vision), Logic, and API integrations (Spotify/Slack).

How it works
Schedule: The workflow runs every night at 10 PM.
Mood Logic: It checks the day of the week to adjust the energy level (e.g., higher energy for Friday nights, calmer vibes for Mondays).
Visual Analysis: OpenAI (GPT-4o) analyzes the NASA APOD image to determine its color palette, mood, and subject matter, converting these into musical parameters (Valence, Energy).
Curation: Spotify searches for a track that matches these specific parameters.
Creative Writing: OpenAI generates a short poem or caption linking the image to the song.
Delivery: The image, track link, and poem are posted to Slack, and the track is automatically saved to a designated Spotify Playlist.

Requirements
NASA API Key** (Free)
OpenAI API Key** (Must have access to GPT-4o model)
Spotify Developer Credentials** (Client ID and Client Secret)
Slack** Workspace and Bot Token

How to set up
Set up your credentials for NASA, OpenAI, Spotify, and Slack in n8n.
Create a specific Playlist in Spotify and copy its Playlist ID.
Copy the Channel ID from the Slack channel where you want to post.
Paste these IDs into the respective nodes (marked with <PLACEHOLDER>) or use the Set Fields node to manage them globally.

Nodes Used (5)

Code
n8n-nodes-base.code
NASA
n8n-nodes-base.nasa
OpenAI
@n8n/n8n-nodes-langchain.openAi
Slack
n8n-nodes-base.slack
Spotify
n8n-nodes-base.spotify