The Golden Rule
Never execute two action-based activities in a row without collecting a slot in between.
Never execute two action-based activities in a row in a conversation process without collecting a slot in between.
That’s the rule. If you remember one thing from this page, remember that. Every other best practice in Agent Studio is downstream of this principle.
Why This Rule Exists
Every action activity in a conversation process returns output that gets added to the reasoning engine’s context window. That output stays in the window for the rest of the conversation. The engine reads all of it on every subsequent turn to decide what to say and do next.
Chain two actions back-to-back, and both outputs sit in the window. Chain four, and you have four full API responses competing for the engine’s limited attention budget.
Here’s what happens:
The reasoning engine processes the entire context window on every turn. More tokens means more computation and more latency. But the performance hit isn’t just about speed.
The Lost in the Middle Problem
The reasoning engine doesn’t read the context window with equal attention everywhere. Research shows that attention follows a U-shaped curve: strong at the beginning, strong at the end, weak in the middle.
When you chain three actions:
- Action 1’s output sits near the beginning of the action history. Decent attention.
- Action 2’s output lands in the middle. Weak attention — roughly 20% recall.
- Action 3’s output is near the end. Decent attention.
The engine is literally more likely to hallucinate about the second action’s data than the first or third. You’ll see it pick the wrong field, misinterpret a value, or ignore the data entirely. And the bugs are hard to trace because they look like random reasoning failures, not positional attention problems.
What a Violation Looks Like
Here’s a meeting scheduler plugin that chains four action activities. Each action depends on the previous one’s output, and all four responses dump into the context window.
Conversation processes are built using Agent Studio’s visual editor. The YAML below is a codified representation of what you’d configure in the UI.
Four actions chained. Each returns 2-5 KB. The reasoning engine’s context balloons to 20 KB+ of intermediate data it doesn’t need. Response time goes from 2s to 8s. The user stares at a spinner.
The Fix: Compound Actions
Compound actions move the chain out of the conversation process. The intermediate results stay outside the context window entirely. The reasoning engine only sees the final, clean output.
Move the chain into a compound action
Take the sequence of actions that were chained in the conversation process and group them into a single compound action. Each step executes in order, but the intermediate results never touch the reasoning engine’s context.
The return step is where the magic happens. Instead of dumping three full API responses into the context, the compound action returns exactly three fields. The reasoning engine sees recommended_room, room_capacity, and alternatives_count. Nothing else.
The Role of confirmation_policy
Notice confirmation_policy: true on both action activities above. This gives the user a checkpoint — they see the result and confirm before the action fires. It’s useful when you want the user to verify data before the process continues (e.g., “I found Room 4A with capacity for 8. Want me to book it?”).
The slot barrier itself comes from required_slots. When the next action activity has required slots, the engine has to stop and collect them before proceeding. That’s the natural breakpoint that satisfies the Golden Rule.
required_slots is what creates the stop point between action groups. confirmation_policy adds a user verification step before the action executes — useful, but separate from the Golden Rule’s slot barrier requirement.
Rule of Thumb
If your conversation process has two action activities back-to-back, refactor. Move the chain into a compound action, use return with an output_mapper to curate the fields the reasoning engine actually needs, and add confirmation_policy between action groups.
The context window is a finite resource. Treat it like one.
How the context window fills up and why every token has a cost.
The U-shaped attention curve and Lost in the Middle phenomenon.
Full reference for building compound actions with steps, return, and output mapping.
The full reasoning cycle and how the engine manages context.