Skip to main content
Large blocks of text can overwhelm users in a chat interface. A better user experience is to split a long explanation into 3-4 distinct chat bubbles sent sequentially. This guide outlines an Agentic Workflow that instructs the AI to format its response as JSON, allows you to parse that JSON, and then send the parts individually.

Workflow Overview

  1. OpenAI Node: Generates a structured JSON object instead of plain text.
  2. Get Data from JSON Node: Extracts specific parts (e.g., part1, part2) into variables.
  3. Send Message Nodes: Displays the variables sequentially with typing delays.

Step-by-Step Implementation

1

Configure the AI Prompt

First, you must instruct the LLM to output strictly formatted data.
  1. Add an OpenAI: Generate Text node.
  2. In the System Prompt or Custom Instructions, add the following instruction:
You must format your response as a valid JSON object. 
Split your answer into multiple logical parts using keys "part1", "part2", and "part3".

Example format:
{
  "part1": "Here is the introduction...",
  "part2": "Here are the details...",
  "part3": "Here is the conclusion."
}
  1. Save the response to a Custom Field, e.g., {{ai_json_response}}.
2

Extract Data from JSON

Use the Get Data from JSON action to break the response object into usable variables.
  1. Add a Get Data from JSON node immediately after your AI node.
  2. JSON Source: Select your variable {{ai_json_response}}.
  3. Map the JSON keys to new Custom Fields:
JSON PathSave to Variable
.part1{{message_part_1}}
.part2{{message_part_2}}
.part3{{message_part_3}}
If your content length varies, you can map up to 5 parts. If the AI only uses 3, the remaining variables will simply be empty and won’t display anything.
3

Display the Messages

Now, send the mapped variables back to the user as separate messages.
  1. Add a Send Message block.
  2. Insert {{message_part_1}}.
  3. Add a Typing Delay (e.g., 2 seconds).
  4. Add another text block with {{message_part_2}}.
  5. Repeat for all parts.

Real-World Example

User Query: “How do I improve my focus?” Internal AI Generation (Hidden):
{
  "part1": "Step 1: Set clear and achievable goals for your day.",
  "part2": "Step 2: Minimize distractions by clearing your workspace.",
  "part3": "Step 3: Use the Pomodoro technique to take regular breaks."
}