MindStudio University
  • Documentation
  • Video Courses
  • Newsroom
  • Video Courses
  • 1: Core Building Principles
    • Intro to AI Agents & MindStudio
    • AI Editor Overview
    • Building Your First AI Agents
    • Building an AI Agent for the Chrome Extension
    • Testing & Debugging Basics
    • Designing User Inputs & Forms
    • How to Scrape Web Data for AI Agents
    • Chaining Multiple Blocks Together in AI Agent Workflows
    • How to Generate Content & Media with AI
    • How to Choose the Right AI Model
    • Prompt Writing 101
    • Using Integration Blocks to Connect to External Services
    • Creating & Using Data Sources
  • 2: Workflow Mastery
    • Building AI Agents that Run on a Schedule
    • Using Launch Variables & Global Variables in Workflows
    • Routing, Logic, & Checkpoint Blocks
    • Advanced Testing Using Evaluations
    • Running Blocks in Parallel for Workflow Optimization
    • Working with Structured Data (JSON)
    • Running Sub-Workflows to Iterate and Process Data With AI
    • Creating Dynamic User Inputs
    • How to Generate HTML Assets for Your AI Agents
  • Masterclass Sessions
    • AI Agent Zero to Hero Masterclass (Beginner)
    • AI Agent Monetization Masterclass
    • AI for Content Marketing Masterclass
    • Deep Research Masterclass
    • AI Agents In-Depth Masterclass
    • AI Agents for Partnerships Masterclass
Powered by GitBook
On this page
  • What is JSON?
  • Using JSON in MindStudio Workflows
  • Applying JSON in HTML Templates
  • Summary
Export as PDF
  1. 2: Workflow Mastery

Working with Structured Data (JSON)

Learn how to understand, manipulate, and apply structured data (JSON) in MindStudio workflows

Last updated 1 day ago

JSON (JavaScript Object Notation) is a powerful and widely used format for storing and exchanging structured data. In MindStudio, understanding how to parse, generate, and utilize JSON is essential for building flexible and powerful AI workflows.

What is JSON?

JSON is a structured data format made up of key-value pairs. Each key is a string (in quotes), and its associated value can be:

  • A string ("Alice")

  • A number (30)

  • A boolean (true)

  • An array (["user", "admin"])

  • Another object ({"age": 30, "active": true})

JSON also supports nesting, allowing you to build complex hierarchies of data.

JSON Syntax Rules

  1. All keys must be strings (in double quotes).

  2. Key-value pairs must be comma-separated.

  3. Do not include a trailing comma at the end of the last key-value pair.

Using JSON in MindStudio Workflows

Receiving JSON from Blocks

Many blocks, like Search Google News, return data as JSON. This allows you to access structured results, such as article titles, links, and thumbnails.

You can:

  • Display the full JSON

  • Extract specific values using path expressions

  • Iterate through lists using each blocks

Accessing Individual Values

To get a specific value from JSON, use the JSON path:

{{GoogleNews.articles[0].title}}

This extracts the title of the first article from the GoogleNews variable.

Iterating Through Arrays

Use the #each tag to loop through arrays in JSON:

{{#each GoogleNews}}
### {{title}}
[Read Article]({{url}})
![]({{thumbnail}})
---
{{/each}}

This will render each article's title, link, and thumbnail using Markdown formatting.

Generating JSON with AI

You can use the Generate Text block to ask AI to return structured JSON. For example, extracting all URLs from search results:

{
  "links": [
    "https://example.com/1",
    "https://example.com/2"
  ]
}

Use an output schema to define the format and simplify complex JSON into more usable lists.

Applying JSON in HTML Templates

JSON can also be applied to generate HTML pages dynamically using the Generate Asset block. You can:

  • Iterate over content sections

  • Conditionally render data like headings, key takeaways, and entities

  • Use extracted structured data to build full HTML pages for summaries or reports

Example usage:

  • Extract structured information from a Verge article

  • Use that data to populate an HTML summary page

  • Present it with images, headlines, and lists using embedded JSON paths

Summary

Understanding JSON enables you to:

  • Parse and manipulate structured responses

  • Extract only the values you need

  • Iterate through complex arrays

  • Generate clean structured output from unstructured content

  • Build advanced outputs like HTML templates dynamically

Once you master JSON in MindStudio, you'll be able to build significantly more advanced and powerful agents with flexible output formatting and robust data handling.