Add Node to Topic
Add a new node to an existing Copilot Studio topic, or modify an existing one.
In Copilot Studio, the elements inside a topic's actions array are nodes (SendActivity, Question, ConditionGroup, etc.). These are different from actions (actions/*.mcs.yml), which are connector-based TaskDialogs. This skill handles nodes within topics.
For generative answers (SearchAndSummarizeContent, AnswerQuestionWithAI), use the /add-generative-answers skill instead — it has the specific patterns, follow-up ConditionGroup logic, and disambiguation guidance needed to set them up correctly.
Instructions
Auto-discover the agent directory:
Glob: **/agent.mcs.yml
NEVER hardcode an agent name.
Parse the arguments to identify:
- The node type (SendActivity, Question, SetVariable, ConditionGroup, etc.)
- The target topic file
- If modifying an existing node, which node to modify
Look up the node schema:
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve <NodeType>
Read the existing topic file to understand its current structure.
Generate or modify the node with:
- A unique ID (format:
<nodeType>_<6-8 random alphanumeric>)
- All required properties from the schema
- Appropriate default values
Determine the correct insertion point in the actions array and present the plan to the user before writing.
Common Node Types
| Node |
Purpose |
Key Properties |
SendActivity |
Send message |
kind, id, activity |
Question |
Ask user input |
kind, id, variable, prompt, entity |
SetVariable |
Set/compute value |
kind, id, variable, value |
SetTextVariable |
Set text with interpolation (YAML-only, no canvas) |
kind, id, variable, value |
ConditionGroup |
Branching logic |
kind, id, conditions |
BeginDialog |
Call another topic |
kind, id, dialog |
EndDialog |
End topic |
kind, id |
CancelAllDialogs |
Cancel all topics |
kind, id |
Generative Orchestration Guidelines
When the agent has GenerativeActionsEnabled: true:
- Prefer AutomaticTaskInput over Question nodes for collecting user info (the orchestrator handles prompting automatically).
- Still use Question nodes when: conditional asks (ask X only if Y), or end-of-flow confirmations.
- Prefer topic outputs over SendActivity for returning results.
- Do NOT use SendActivity to show final outputs unless it's a precise mid-flow message.
Power Fx Quick Reference
- Expressions start with
=: condition: =System.FallbackCount < 3
- String interpolation uses
{}: activity: "Error: {System.Error.Message}"
- Variable init on first assignment:
variable: init:Topic.MyVar
- Common:
Text(), Now(), IsBlank(), !IsBlank()
Example: Adding a Question Node
- kind: Question
id: question_k7xPm2
variable: init:Topic.UserName
prompt: What is your name?
entity: StringPrebuiltEntity
alwaysPrompt: true
interruptionPolicy:
allowInterruption: false
Important Notes
- Unique IDs: Use random 6-8 alphanumeric characters. Duplicate IDs cause Copilot Studio errors.
- Verify the node type exists in the schema before generating.
- For ConditionGroup, include at least one condition item with its own unique ID.
1---2name: add-node3description: Add or modify a node in an existing Copilot Studio topic. Use when the user asks to add a question, message, condition, variable, or other node to a topic. Do NOT use this for generative answers or knowledge search — use /add-generative-answers instead.4---56# Add Node to Topic78Add a new node to an existing Copilot Studio topic, or modify an existing one.910In Copilot Studio, the elements inside a topic's `actions` array are **nodes** (SendActivity, Question, ConditionGroup, etc.). These are different from **actions** (`actions/*.mcs.yml`), which are connector-based TaskDialogs. This skill handles nodes within topics.1112**For generative answers (SearchAndSummarizeContent, AnswerQuestionWithAI)**, use the `/add-generative-answers` skill instead — it has the specific patterns, follow-up ConditionGroup logic, and disambiguation guidance needed to set them up correctly.1314## Instructions15161. **Auto-discover the agent directory**:17 ```18 Glob: **/agent.mcs.yml19 ```20 NEVER hardcode an agent name.21222. **Parse the arguments** to identify:23 - The node type (SendActivity, Question, SetVariable, ConditionGroup, etc.)24 - The target topic file25 - If modifying an existing node, which node to modify26273. **Look up the node schema**:28 ```bash29 node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve <NodeType>30 ```31324. **Read the existing topic file** to understand its current structure.33345. **Generate or modify the node** with:35 - A unique ID (format: `<nodeType>_<6-8 random alphanumeric>`)36 - All required properties from the schema37 - Appropriate default values38396. **Determine the correct insertion point** in the actions array and present the plan to the user before writing.4041## Common Node Types4243| Node | Purpose | Key Properties |44|------|---------|----------------|45| `SendActivity` | Send message | `kind`, `id`, `activity` |46| `Question` | Ask user input | `kind`, `id`, `variable`, `prompt`, `entity` |47| `SetVariable` | Set/compute value | `kind`, `id`, `variable`, `value` |48| `SetTextVariable` | Set text with interpolation (YAML-only, no canvas) | `kind`, `id`, `variable`, `value` |49| `ConditionGroup` | Branching logic | `kind`, `id`, `conditions` |50| `BeginDialog` | Call another topic | `kind`, `id`, `dialog` |51| `EndDialog` | End topic | `kind`, `id` |52| `CancelAllDialogs` | Cancel all topics | `kind`, `id` |5354## Generative Orchestration Guidelines5556When the agent has `GenerativeActionsEnabled: true`:5758- Prefer **AutomaticTaskInput** over Question nodes for collecting user info (the orchestrator handles prompting automatically).59- Still use Question nodes when: conditional asks (ask X only if Y), or end-of-flow confirmations.60- Prefer **topic outputs** over SendActivity for returning results.61- Do NOT use SendActivity to show final outputs unless it's a precise mid-flow message.6263## Power Fx Quick Reference6465- Expressions start with `=`: `condition: =System.FallbackCount < 3`66- String interpolation uses `{}`: `activity: "Error: {System.Error.Message}"`67- Variable init on first assignment: `variable: init:Topic.MyVar`68- Common: `Text()`, `Now()`, `IsBlank()`, `!IsBlank()`6970## Example: Adding a Question Node7172```yaml73- kind: Question74 id: question_k7xPm275 variable: init:Topic.UserName76 prompt: What is your name?77 entity: StringPrebuiltEntity78 alwaysPrompt: true79 interruptionPolicy:80 allowInterruption: false81```8283## Important Notes8485- **Unique IDs**: Use random 6-8 alphanumeric characters. Duplicate IDs cause Copilot Studio errors.86- Verify the node type exists in the schema before generating.87- For ConditionGroup, include at least one condition item with its own unique ID.