Hi everyone,
I’m using an AI Agent (Tools Agent) in a conversational chat flow in n8n to collect structured data from users and then trigger a Stripe checkout.
The current flow is structured like this:
[When chat message received] → [AI Agent] → [Check Fields (JavaScript)] → [IF isComplete] → [Stripe Checkout]
### Problem:
From the **very first interaction**, even if the user just says “hello”, the AI Agent tries to build the full JSON output. It often includes empty or default values for fields (e.g. empty `"name"`, `null` `"age but still **passes it downstream**. This causes:
* `Check Fields` to receive a partially filled JSON,
* the `IF` node to sometimes interpret it as valid (depending on how it's written),
* and worst of all: **the Stripe Checkout node is triggered prematurely**, before the user has completed the conversation.
This happens despite not using any **Structured Output Parser**. The system message includes detailed instructions (role, rules, step-by-step inputs), but it seems the AI Agent is too eager to output final JSON too soon.
### What I want to achieve:
1. **Keep the conversation going** and **only output the final JSON** once all required fields are collected.
2. Prevent the AI from prematurely outputting incomplete JSON or triggering downstream nodes.
3. Optionally store intermediate variables in memory, and **generate the JSON explicitly at the end**, once the user confirms.
---
### Questions:
* Is there a way to **prevent the AI Agent from generating final output until explicitly instructed**?
* Should I restructure the flow into two agents — one for data collection and one for JSON formatting?
* Are there best practices for building **chat-style flows** that should only advance to Stripe or generation once all required fields are confirmed?
Thanks in advance for your help.
