JSON, short for JavaScript Object Notation, is the universal language of data exchange across modern web applications, APIs, and automation tools like n8n. It’s lightweight, easy to read, and crucial for anyone working with digital systems—from developers to marketers.
What Does JSON Look Like?
Imagine you want to save contact information. Instead of storing this as plain text, JSON structures it in a way that both humans and machines can easily understand:
{
"name": "John Doe",
"age": 30,
"hasChildren": true,
"phoneNumbers": ["555-1234", "555-5678"]
}
This is a JSON object. It’s built with key/value pairs, where each key is a label (always in double quotes) and the value can be various data types.
Key Data Types in JSON
1. String
A string is text, enclosed in double quotes. Example:
"firstName": "Jane"
2. Number
Numbers are written without quotes. They can be integers or decimals:
"age": 28,
"height": 1.75
Note: Writing numbers in quotes will treat them as strings—you won’t be able to do math with them.
3. Boolean
Boolean values are either true
or false
, written without quotes:
"subscribed": true
Useful for toggles, logic, and decision-making in workflows.
4. Null
null
represents an intentional absence of value. It’s not the same as 0 or an empty string:
"middleName": null
5. Array
Arrays are ordered lists of values, enclosed in square brackets. These values can be strings, numbers, booleans, or even other objects:
"tags": ["marketing", "automation", "json"]
6. Object
An object is a collection of key/value pairs, wrapped in curly braces. This allows nesting of data for more complex structures:
"address": {
"street": "Main St",
"city": "Amsterdam",
"postalCode": "1000 AA"
}
Using JSON in Automation Tools Like n8n
In tools like n8n, you can dynamically use JSON values across nodes using expressions. Example:
"message": "Hello, the number is: {{ $('NumberNode').item.json.value }}"
This pulls the value value
from the node labeled NumberNode
. This is how you link outputs and inputs between steps in a workflow.
Practical Example: Personalizing Emails
Imagine you’re using n8n to send automated emails. You can fetch user data from a form and pass it in JSON like this:
{
"firstName": "Alex",
"lastName": "Smith",
"email": "[email protected]"
}
Then dynamically personalize the message using expressions:
"message": "Hi {{ $json.firstName }}, thanks for signing up!"
This way, every user receives a customized message without manual effort.
How to Check If Your JSON Is Valid
It’s important to validate JSON before using it in your workflow. A single missing quote or comma can break your process. Use online tools like JSON Formatter or your browser’s developer console to inspect and format your JSON properly.
Why Marketers Should Care
If you’re using automation tools, integrating CRMs, or analyzing data from APIs, JSON is your friend. It gives structure to data, which means you can personalize messages, segment leads, and automate tasks based on real-time inputs.
Mastering JSON doesn’t mean writing code from scratch—it means recognizing patterns, understanding data types, and knowing how to access the data you need. Once you get comfortable reading and modifying JSON, your marketing automations will become smarter, faster, and more scalable.
Tip: Use tools like JSON Formatter to validate and explore your data visually.