Why i cant get structured output from Squad Agents...
# support
m
Its only gives me last agent structured output, however i need all structured output together, did i miss something? its really basic required thing. I creaded a squad with two agents. First one making german interview and handoff second one which is making english interview. I can get english structured output however cant get german structured outputs? Do you have any idea? @Vapi @VAPI Tech @Vapi Support Bot thanks.
v
To ensure you get structured outputs from both agents in your Squad, make sure each agent's structured output is attached in the squad configuration. For example, your squad setup should look like this:
Copy code
json
{
  "squad": {
    "members": [
      { "assistantId": "german-interview-id", "structuredOutputIds": ["german-output-id"] },
      { "assistantId": "english-interview-id", "structuredOutputIds": ["english-output-id"] }
    ]
  }
}
Check that each agent has its own
structuredOutputIds
configured. If you still only see the last agent's output, this may be a platform limitation—please reach out to Vapi support for further assistance.
More details: [Structured outputs quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart) Source: - [Structured outputs quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart)
m
is there anybody faced with same issue?
r
Sounds like only the final agent’s output is being returned in your flow. You’ll need to explicitly store the German agent’s structured output (e.g., in a variable or memory) before the handoff, then merge or return both outputs at the end. I’ve handled similar multi-agent setups—happy to help you fix it quickly. @muratsk
s
Hi, thanks for reaching out.
Could you please share the squad/call ID?
That'd help us investigate this further
a
Hi @muratsk Can you share your squad ID and a call ID where this happened? That'll help us look into why the German agent's structured output isn't coming through.
m
@Deadroom hi my friend, please can you share our squad id and example call id, i appreciate it.
d
Hi @Ak_Unitzero Of course, these are the information that u are asking for it. Squad ID: e6572e97-6d05-49ff-87f8-13ba87003a8f Call ID:019d9b88-6b96-7aac-80b6-915e6b1121dc
m
Perhaps we overlooked something regarding squad ID and structured outputs, as this issue should have been resolved simply. To summarize, there are two agents, one speaking English and the other German. The German agent finishes their task first and hands it over to the English-speaking agent. Both are assigned to a squad. Both agents have structured outputs, but our goal is to receive both structured outputs when one squad finishes its task. If this isn't possible, could we create a structured output for the squad? I look forward to your valuable support. @Deadroom has already shared the squad ID and example call ID information, thank you. @Shaunak @Ak_Unitzero
s
Hi there, I investigated your call (019d9b88-6b96-7aac-80b6-915e6b1121dc) and your squad configuration. You haven't missed anything basic - you’ve actually run into a specific platform behavior regarding how Squads handle data. Why you only see the last output When using a Squad, each agent is treated as a separate "turn" within the same call.
The German Agent runs, finishes, and generates its structured output. It then hands off to the English Agent, which runs and generates its own output. The Issue: When the call finally ends, the top-level Call object (GET /call/{id}) only saves the structured output from the last active agent. The German agent's output is generated, but it isn't merged into that final call artifact.
How to get both outputs To capture both, you need to rely on the webhooks that fire at the moment of handoff. 1. Monitor the end-of-call-report Webhook Every time an agent in a squad finishes their part (even if they are just handing off to another agent), Vapi fires an end-of-call-report to your Server URL. 2. The Workflow: When the German Agent hands off, your server will receive a webhook. This payload will contain message.artifact.structuredOutputs for the German interview. When the English Agent eventually hangs up, your server will receive a second webhook. This payload will contain the structured output for the English interview. Example Webhook Logic:
Copy code
javascript
if (message.type === 'end-of-call-report') {
  const assistantId = message.call.assistantId; 
  const outputs = message.artifact?.structuredOutputs;

  // Save these to your database, keyed by assistantId 
  // so you can combine them on your side.
  console.log(`Received output for ${assistantId}:`, outputs);
}
One important note: In your call logs from April 17, I noticed your webhook server returned several HTTP 502 errors at the start of the call. If your server is down when the German agent hands off, you will miss that first end-of-call-report. Make sure your endpoint is stable so you can catch both events! In summary: The data isn't lost, it's just sent in real-time as each agent finishes. By listening for the end-of-call-report for each assistant ID in the squad, you'll have the full picture.