upsert_stage
Create or update conversation stages in BotUyo agents to define AI behavior at specific steps, managing stage configurations and connections between stages.
Instructions
Create or update a named stage in an agent's conversation flow.
A stage defines what the agent does at a particular step in the conversation. Stages are nodes in a graph connected by edges (connections).
Examples of stage names: "welcomeStage", "salesStage", "hostStage", "checkoutStage"
The stage config is merged with existing stages — existing stages you don't specify are kept unchanged. Connections and channelFlows replace existing values when provided.
Requires role: owner, admin, or developer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentId | Yes | The MongoDB ID of the agent | |
| stageName | Yes | Name key for this stage (e.g. "welcomeStage", "salesStage") | |
| stageConfig | Yes | Full stage configuration object. | |
| connections | No | Graph edges between stages. Replaces ALL existing connections. | |
| channelFlows | No | Per-channel flow overrides. Key = channel name, value = { connections: [...] }. Replaces ALL existing channelFlows. |