Skip to main content

JSON Builder Node

The JSON Builder node constructs JSON objects dynamically by combining input data with a defined JSON schema. It uses AI to intelligently map input values to the specified schema structure, making it easy to transform unstructured or semi-structured data into well-formed JSON objects that match your requirements.

JSON Builder node


Basic Usage​

Use the JSON Builder node to convert text input, form data, or other content into structured JSON objects based on a defined schema.


Inputs​

The JSON Builder node accepts the following inputs:

  • Input: The source data to be transformed into JSON format. Can be text, user input, form responses, or any string data.
  • JSON Schema: A schema definition that describes the desired structure and format of the output JSON object.
  • Overwrite System Prompt: Custom instructions to override the default AI behavior for JSON construction (optional).

Outputs​

  • JSON Output: The constructed JSON object that conforms to the provided schema, containing the mapped data from the input.

Configuration​

The JSON Builder node uses AI processing to intelligently map input data to the JSON schema, requiring no manual configuration beyond connecting the appropriate inputs.

How It Works​

  1. Input Data: Receives unstructured or semi-structured data
  2. Schema Definition: Uses the provided JSON schema to understand the desired output structure
  3. AI Processing: Applies AI to intelligently extract and map data to schema fields
  4. JSON Construction: Generates a valid JSON object matching the schema
  5. Output: Returns the constructed JSON for use in downstream nodes

Example Workflows​

Employee Report Processing Sub-Flow​

Scenario: Create a reusable sub-flow that extracts employee information from text reports and returns structured JSON data to the parent flow.

JSON Builder Example

Steps to Create the Sub-Flow:

  1. Add a Flow Call Receiver node to receive data from the parent flow:

    • Configure a slot named slot-1 to receive the employee report text
    • This acts as the entry point for the sub-flow
  2. Add a Text node for the employee report data:

    • Connect this to provide sample data or pass through the received data
    • Example report text:
    Company Employee Report 2026
    Employee #1: John Smith (ID: EMP001, john@company.com, age 32, active) works as Senior
    Developer in Engineering department.
  3. Add a JSON Block node with the desired schema:

    • Define the structure for employee data extraction
    • Example JSON Schema:
    {
    "type": "object",
    "properties": {
    "employees": [
    {
    "name": "string",
    "id": "string",
    "email": "string",
    "age": "number",
    "status": "string",
    "position": "string",
    "department": "string"
    }
    ]
    }
    }
  4. Add a Text node with extraction instructions:

    • Provide the system prompt for AI processing
    • Example prompt:
    Extract information for all employees mentioned in the report. Create an array of employee
    objects and provide summary statistics including total count and average age.
    • Optional: Check "Encrypt the text" for sensitive prompts
  5. Add and connect a JSON Builder node:

    i. Connect Flow Call Receiver output to Input:

    • The employee report text flows into the JSON Builder

    ii. Connect JSON Block output to JSON Schema:

    • Defines the structure for the output

    iii. Connect Text node output to Overwrite System Prompt:

    • Provides extraction instructions to the AI
  6. Add a Flow Call Return node at the end:

    • Connect JSON Builder's JSON Output to Returning Slot Json
    • This returns the structured JSON back to the parent flow
    • The parent flow can then use this data for further processing

Preview:

Input report text:

Company Employee Report 2026
Employee #1: John Smith (ID: EMP001, john@company.com, age 32, active) works as Senior
Developer in Engineering department.
Employee #2: Sarah Johnson (ID: EMP002, sarah@company.com, age 28, active) works as
Product Manager in Product department.
Employee #3: Mike Chen (ID: EMP003, mike@company.com, age 35, active) works as
Design Lead in Design department.

Output JSON returned to parent flow:

{
"employees": [
{
"name": "John Smith",
"id": "EMP001",
"email": "john@company.com",
"age": 32,
"status": "active",
"position": "Senior Developer",
"department": "Engineering"
},
{
"name": "Sarah Johnson",
"id": "EMP002",
"email": "sarah@company.com",
"age": 28,
"status": "active",
"position": "Product Manager",
"department": "Product"
},
{
"name": "Mike Chen",
"id": "EMP003",
"email": "mike@company.com",
"age": 35,
"status": "active",
"position": "Design Lead",
"department": "Design"
}
],
"summary": {
"totalEmployees": 3,
"averageAge": 31.67
}
}

Result: A reusable sub-flow that processes unstructured employee reports into clean, structured JSON data that can be used by multiple parent flows for database storage, reporting, or API integration.


JSON Schema Examples​

Simple User Profile​

{
"userId": "string",
"name": "string",
"email": "string",
"age": "number",
"active": "boolean"
}

Nested Address Object​

{
"name": "string",
"contact": {
"email": "string",
"phone": "string"
},
"address": {
"street": "string",
"city": "string",
"state": "string",
"zipCode": "string"
}
}

With Arrays​

{
"studentName": "string",
"courses": ["string"],
"grades": ["number"],
"metadata": {
"enrollmentDate": "string",
"graduationYear": "number"
}
}

Complex Business Object​

{
"orderId": "string",
"customer": {
"name": "string",
"email": "string"
},
"items": [
{
"productId": "string",
"quantity": "number",
"price": "number"
}
],
"total": "number",
"status": "string"
}

  • Form Node: Collect structured user input for JSON conversion
  • Text Input: Capture unstructured text for JSON transformation
  • AI General Prompt: Pre-process or clean data before JSON building
  • CSV Builder: Alternative for tabular data structures
  • API Call: Send constructed JSON to external APIs
  • Data Dump: Store constructed JSON for debugging or logging
  • Branching Node: Route based on JSON construction success/failure
  • Display Text: Show the constructed JSON output
  • Flow Call Return: Return JSON to parent flows
  • Google Spreadsheet: Export JSON data to spreadsheets