Reference Data from Previous Nodes in n8n
In n8n, data flows from one node to the next. But sometimes the node directly before you doesn't have all the data you need. It might be two or three steps back in the workflow.
This is called "backwards referencing" and it's essential when you're combining data from multiple sources. Instead of passing every field through every node, you can reach back and grab exactly what you need from any previous step.
In this challenge, you'll work with a workflow that fetches Star Wars characters and their home planets from two separate API calls. Your task is to combine data from both sources into a single output.
What you'll practice:
- Accessing data from nodes that aren't directly connected
- Using the INPUT panel to browse previous node outputs
- Combining data from multiple API calls into one result
Your Task
- 1Copy the exercise below
- 2Paste into your n8n editor (Ctrl+V)
- 3Solve it — use hints if you get stuck
- 4Check the solution when done
A workflow is provided that fetches Star Wars character data and their home planets using two separate API calls:
- Fetch People calls
https://swapi.info/api/people/and returns character info - Fetch Homeworlds calls each character's homeworld URL and returns planet info
The Create Sentences node is empty. Configure it to output a sentence that combines data from both previous nodes:
Expected output:
{
"Sentence": "The homeworld of Luke Skywalker is Tatooine. It has desert terrain and arid climate"
}
The challenge: After the Fetch Homeworlds node runs, you only see planet data. The character name seems "lost", but it's not! You need to reference it from the earlier node.
Get the exercise workflow
Create a free account to copy exercises into your n8n editor.