Test flow
test_flowRuns a flow as a test without changing anything, to check that it does what it should. The flow runs with a fake trigger: the command with the options, the event of an event listener, a webhook request, or a click on a button or select menu of a message template. Reads from Discord are real, like members and roles. Nothing is sent or changed: messages, role changes and every other change are returned as effects of their block, with warnings when Discord would reject them, like a missing permission or a role above the bot's. Stored variables are read, and changes to them only last for the test. Use variables to start the test with other stored values, like a balance, XP or the time a cooldown started. Blocks that call services other than Discord, like Send API Request, AI and integrations, don't run and have no result unless you mock them. Mock blocks to test each branch, like the error branch of an Error Handler or the answers of AI Check and AI Choice. Waits are skipped. Use then to click the buttons, use the select menus and submit the modals the flow showed, which runs those parts of the flow. Returns each run of the flow with the blocks that ran in order, their results, errors and effects. After building or changing a flow, test the branches that matter and fix what fails before telling the user it works.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"app_id": "<app_id>"
},
"name": "test_flow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dm | No | Runs a command in a DM with the bot instead. | |
| then | No | What the user does after the flow ran, in order: {"click": "<label or custom ID of a button>"}, {"select": "<placeholder or custom ID of a select menu>", "values": [...]}, or {"submit": {"<custom ID or label of an input>": "value"}} for the modal the flow showed. user_id makes someone else do it. | |
| event | No | Merged into the Discord event of an event listener, or the interaction of a command, in Discord's gateway format. Like {"content": "hi"} for message_create, or {"emoji": {"name": "⭐"}, "message_id": "123"} for reactions. | |
| mocks | No | What blocks do instead of running, by block ID. {"result": ...} is the block's result, in the format of its result_schema, like a Discord member object for Get Member, or {"status_code": 200, "body": {...}} for Send API Request. {"error": "..."} makes the block fail. For AI Check the result is "yes", "no" or the probability of yes, for AI Choice the name of an option, and for Verify Webhook "valid" or "invalid". | |
| app_id | Yes | The ID of the app, from list_apps. | |
| values | No | With message_id: the values picked in the select menu. | |
| options | No | The arguments of a command by name, like {"user": "123", "amount": 5}. IDs as strings, attachments as the URL of a file. | |
| user_id | No | Who triggers the flow, a member of the server. By default the user of the API token. | |
| webhook | No | The request that triggers a webhook event listener. | |
| guild_id | No | The server, from list_servers. Needed if the bot is in more than one. | |
| variables | No | Values of stored variables when the test starts, in place of the stored ones, like {"variable_id": "...", "scope": "<server ID>:<user ID>", "value": 95}. The scope is the scope setting of the block as it would be filled in, and only for variables with a value per scope. A value of null means the variable has no value. | |
| channel_id | No | The channel, by default the server's system channel or first text channel. | |
| command_id | No | ||
| message_id | No | ||
| flow_source_id | No | With message_id: the flow_source_id of the button or select menu to use. | |
| event_listener_id | No |