JSON

JSON (JavaScript Object Notion) is a human-readable data file format which is commonly used when building automations. It’s like a shared language that lets humans and computers communicate structured data easily - without needing complicated code.

Here is what JSON looks like:

  • Objects: contain data in key-value pairs. “name/email/subscribed” are keys. The values are “Alice/true/alice@example(dot)com”.

  • Arrays: lists of values wrapped in “[]” when there are multiple possibilities for a value.

  • 7 Different data types that you can include within an object:

    • stringKey

    • boolean

    • nullKey

    • objectKey nested as:

      • nestedStringKey

      • nestedNumberkey

    • arrayKey

Here is a list I generated with GPT about the various data file formats:

JSON is key for transmitting data from one module to another in MAKE (or any platform). Here is why:

  • It’s the standard for representing structured data (key-value pairs, arrays, objects)

  • Almost all APIs return JSON now (e.g., Twitter, Google Sheets, Notion)

  • MAKE and n8n both use JSON internally to let modules map values between each other

MAKE can parse XML, CSV, or XLSX into JSON. When you use the HTTP module, you can set the response type to JSON.

How JSON is Used in MAKE

1) Create JSON: it’s common in MAKE to create a new data type/structure (JSON) because some tools or modules need data in a very specific shape.

2) Parse JSON: break the data down when it comes in messy (usually from a webhook or HTTP response) and you want to turn it into clean, usable pieces. The reason it is messy when it comes from a webhook or HTTP response is because when data hits you through a webhook or HTTP, it usually looks like this:

That’s JSON; but in string form, like someone crammed a whole salad into a smoothie. MAKE looks at that and goes, “Cool story. But I can’t use this unless you slice it up.”

So you parse it, which is basically telling MAKE: “Hey, break this into real fields I can click and map.”

Parsing turns that blob into:

3) Map JSON: using the values inside JSON to power activity in other modules (like filling out emails, updating Sheets, etc.)

4) Transform JSON: sometimes data you receive might need to be changed or reorganized to fit the requirements of other modules or systems. This is called transforming JSON. For eg, you may need to combine information from multiple pieces of JSON data into one, or you may want to change the structure of the data so that it's in a format more useful for your specific needs (such as adding or removing fields, or changing data types).

5) Handle JSON in Iterators: When JSON contains an array (a list of multiple items), you might need to process each item individually. An iterator is used to go through each item in the array one by one and perform actions on them. This is necessary when you need to handle multiple pieces of similar data separately, such as when working with a list of email addresses or a series of products in an order.

6) JSON Response Handling: when you make a request to an API or service (via an HTTP module), the service often returns data in JSON format. This is known as the JSON response. You need to parse this response to extract and use the relevant information in your workflow. For eg, an API might return a JSON object containing a user's details (name, email, etc.), and you would parse the JSON to extract just the fields you need.

JSON Validation and Error Handling

JSON Validation: Before using JSON in your workflows, it’s important to ensure that it’s well-formed. This means the JSON data must follow the correct syntax (e.g., proper quotation marks around strings, commas separating key-value pairs). Tools like JSONLint can help validate your JSON structure.

Error Handling: In practice, JSON data might not always be perfectly structured. Knowing how to handle errors in the data (e.g., missing or incorrect fields) is important. In MAKE, this can involve checking for the existence of values or using conditional logic to handle unexpected or missing data.

Working with JSON in Arrays

Deep Nested Arrays: Arrays can sometimes contain nested objects or even other arrays. Understanding how to navigate deeply nested structures is key for extracting the data you need. MAKE’s iterator module can help break down these complex arrays into individual elements, making it easier to process.

Advanced Array Manipulation: You might need to filter, map, or reduce arrays in MAKE (for example, to select only certain items based on a condition or to restructure the array). Exploring these array manipulation techniques can be helpful when working with complex JSON responses.

Dynamic JSON Keys
In some cases, the keys in your JSON might not be fixed or known ahead of time (e.g., they could be dynamically generated by an API). In such cases, you would need to use more flexible ways to access the data. Understanding how to handle dynamic keys can be useful when working with APIs that return unpredictable data.

JSON and Webhooks
Webhook Responses: Webhooks often send JSON data in response to an event (like a new submission on a form). Knowing how to properly handle these webhook responses (e.g., parsing the JSON, checking for errors, and triggering follow-up actions) is crucial for integrating webhooks into your automations.

JSON in API Pagination:
Some APIs return a large dataset in chunks (pagination). When you receive paginated data in JSON format, you'll need to manage how to request and process multiple pages of data. Understanding the pagination structure in JSON responses and how to iterate through multiple pages is important for dealing with large datasets.

JSON and Date/Time Handling:
JSON often includes date or time fields, and knowing how to work with these (especially in automation platforms) is important. Some APIs return dates in ISO format (e.g., "2025-04-16T10:30:00Z"), and you may need to parse, convert, or format them for use in other systems.