Creates a new waterfall dialog following the server/dialogs/mainDialog.js pattern. Scaffolds a ComponentDialog subclass with WaterfallDialog, adds it to the dialog set, and wires up run(context, accessor). Use when user says 'add dialog', 'new dialog flow', 'create waterfall', or adds files to server/dialogs/. Do NOT use for modifying the OAuth/login flow in mainDialog.js directly.
Creates a new waterfall dialog following the server/dialogs/mainDialog.js pattern. Scaffolds a ComponentDialog subclass with WaterfallDialog, adds it to the dialog set, and wires up run(context, accessor). Use when user says 'add dialog', 'new dialog flow', 'create waterfall', or adds files to server/dialogs/. Do NOT use for modifying the OAuth/login flow in mainDialog.js directly.
bot-dialog
Critical
New dialogs MUST extend ComponentDialog (or LogoutDialog if logout-interrupt is needed), never TeamsActivityHandler.
this.initialDialogId MUST be set to the WaterfallDialog ID in the constructor or the dialog will never start.
The run(context, accessor) method is required — DialogBot calls this.dialog.run(context, this.dialogState) directly.
Dialog ID constants MUST be module-level const strings, not inline literals.
Do NOT modify server/dialogs/mainDialog.js or server/dialogs/logoutDialog.js for new flows.
Instructions
Create a new dialog file in server/dialogs/ using this exact skeleton:
Call via stepContext.prompt(TEXT_PROMPT, 'Your question?') in the step before the one that reads stepContext.result.
Verify: every prompt constant is declared at module level and registered with this.addDialog.
Wire the dialog into DialogBot — in the file that instantiates DialogBot (typically server/bot/teamsBot.js or server/index.js), import and pass the new dialog:
Wire: const { TicketDialog } = require('../dialogs/ticketDialog'); new DialogBot(cs, us, new TicketDialog())
Result: Bot asks for title, then description, then confirms — all state managed by the waterfall step context.
Common Issues
Dialog never starts / silent no-op: this.initialDialogId is missing or doesn't match the string passed to new WaterfallDialog(...). Verify both are identical.
TypeError: this.dialog.run is not a function: The new dialog class is missing the async run(context, accessor) method. Copy it verbatim from the skeleton in Step 1.
Error: DialogSet.add(): A dialog with an id of '<Name>Dialog' already exists: Two dialogs share the same ID string. Rename one of the module-level ID constants.
Step reads stepContext.result as undefined: The previous step returned stepContext.next() instead of stepContext.prompt(...). Ensure the prompting step returns the prompt call, and the reading step is the one immediately after.
Lint error 'DialogTurnStatus' is defined but never used: Only import what you use. If there's no results.status check, remove DialogTurnStatus from the destructure.