microsoft/autogen · error · Error

Failed to create team

Error message

Failed to create team

What it means

Thrown by TeamAPI.createTeam when POST /teams/ returns falsy status. It force-injects user_id and POSTs the team JSON; failure means backend validation of the team component graph (agents, model configs, termination conditions) or persistence failed.

Source

Thrown at python/packages/autogen-studio/frontend/src/components/views/teambuilder/api.ts:60

    );
    const data = await response.json();
    if (!data.status) throw new Error(data.message || "Failed to fetch team");
    return data.data;
  }

  async createTeam(teamData: Partial<Team>, userId: string): Promise<Team> {
    const team = {
      ...teamData,
      user_id: userId,
    };

    const response = await fetch(`${this.getBaseUrl()}/teams/`, {
      method: "POST",
      headers: this.getHeaders(),
      body: JSON.stringify(team),
    });
    const data = await response.json();
    if (!data.status) throw new Error(data.message || "Failed to create team");
    return data.data;
  }

  async deleteTeam(teamId: number, userId: string): Promise<void> {
    const response = await fetch(
      `${this.getBaseUrl()}/teams/${teamId}?user_id=${userId}`,
      {
        method: "DELETE",
        headers: this.getHeaders(),
      }
    );
    const data = await response.json();
    if (!data.status) throw new Error(data.message || "Failed to delete team");
  }
}

// move validationapi to its own class

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Read data.message — component validation errors are relayed from the backend
  2. Complete required team fields: every agent needs a model component; termination must be set
  3. Test the exact payload with curl against /teams/ to see raw validation output
  4. If schema drift, rebuild the team in the UI against the current backend version rather than re-POSTing an old export
Defensive patterns

Strategy: validation

Validate before calling

// require every agent to reference a model before saving
function isTeamComplete(team: Partial<Team>): boolean {
  const agents = team?.component?.components?.agents ?? [];
  return agents.length > 0 && agents.every(a => a?.component?.components?.model != null);
}

Try / catch

try {
  return await teamAPI.createTeam(teamData, userId);
} catch (e) {
  notify(`Team not saved: ${e instanceof Error ? e.message : e}`);
  return null;
}

Prevention

When it happens

Trigger: POST /teams/ with a partially built team (agent missing its model reference, invalid component type strings), user_id unknown, or DB write failure — all surface as {status:false}.

Common situations: Saving a team straight from the builder with an incomplete agent (no model attached), component schema drift after backend upgrade rejecting the serialized team, saving before required fields are filled.

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/20714d39dcb4618b. Report an issue: GitHub.