Skip to content
Blocks

Control flow Blocks

IF / ELSE, Switch, Try / Catch, For Loop, Wait, Stop Execution and Run Workflow, with their output pins, shown with the real blocks of the app.

💡 Resource: Every field of every block is listed in the Complete Blocks Dictionary, and the execution model is in Execution Model & Best Practices.

IF / ELSE Block

Tests one condition. Condition.variable is the left operand, Condition.operator the comparison and Condition.value the right operand. The block has one output pin per branch: then, one elseif:<i> pin per ELSE IF condition (checked in order) and else. The blocks you link to a pin run when that branch is taken. Branches are free: they may rejoin on the same block afterwards, which then runs once, when every active path has arrived.

Logic & FlowIF / ELSE BlockifBlock
Condition.variable*
((guild.id))
Condition.operator
isNotEmpty
2 other fields keep their default value.
Pin then
InteractionsRespond with MessagerespondWithMessage
Content
This command is running in a server.
4 other fields keep their default value.
Pin else
InteractionsRespond with MessagerespondWithMessage
Content
Use this command in a server.
4 other fields keep their default value.

Comparisons are equals, notEquals, contains, notContains, startsWith, endsWith, greaterThan, lessThan, greaterOrEqual, lessOrEqual, isEmpty, isNotEmpty and matches (regular expression). Numeric comparisons parse operands as numbers.

The engine also understands condition groups (condition.group set to and or or, with condition.conditions) and condition.negate. The editor does not show these fields; they matter for blocks created through the API or imported from a script.

Logic & FlowIF / ELSE BlockifBlock
Condition.variable*
Value to test — use ((variableName)). E.g. ((message.content[0]))
Condition.operator
equals
Comparison operatorequalsnotEqualscontainsnotContainsstartsWithendsWithgreaterThanlessThangreaterOrEquallessOrEqualisEmptyisNotEmptymatches
Condition.value
Value to compare against (can use ((variables)))
Else If Conditions
ELSE IF — conditions checked in order before ELSE

Other flow blocks

For Loop

Repeats the blocks linked to its body pin, then follows done. The body is a closed region: no link leaves it and none enters it from outside. In simple mode it runs Iterations times; in cstyle mode it follows an initialiser, a condition and an update. The whole command has a 15 minute execution deadline.

Logic & FlowFor LoopforLoop
Mode*
simple
Iterations
3
Shown when Mode = simple
3 other fields keep their default value.
Pin body
MessagesSend MessagesendMessage
Channel Id
123456789012345678
Content
One iteration
Shown when Message Mode = message
9 other fields keep their default value.
Logic & FlowFor LoopforLoop
Mode*
simple
Loop mode: simple or cstyle. The entire command has a 15 minute execution deadline.simplecstyle
Iterations
5
Shown when Mode = simple
Init
i=0
Shown when Mode = cstyle
Condition
i < 10
Shown when Mode = cstyle
Update
i = i + 1
Shown when Mode = cstyle

Wait

Pauses the sequence. For a long slash operation, acknowledge the interaction (Defer Interaction) before waiting.

Logic & FlowWaitwait
Duration*
2s

Switch and Try / Catch

Logic & FlowSwitchswitch
Value*
Value to compare, resolved at run time
Mode
text
textint
Result Prefix
Prefix of the result written as <prefix><value>

Switch replaces the former Jump to Action and Skip Actions blocks: it compares Value (a template resolved at run time) with its case:<value> pins and follows the matching one, otherwise default. In int mode the comparison is numeric. Older commands that used the jump and skip blocks are converted to Switch nodes automatically.

Logic & FlowTry / CatchtryCatch
This block has no field.

Try / Catch runs the blocks linked to try; if one fails, error.* is filled in and the blocks linked to catch run; then done. Both are closed regions.

Stop Execution, Run Workflow

Logic & FlowStop Executionstop
This block has no field.
WorkflowsRun WorkflowrunWorkflow
Workflow Name*
Saved workflow name to execute
Entry Point
Optional entry point override (defaults to workflow entry)
Arguments
Optional key/value arguments injected as ((arg.key))

Run Workflow needs an existing workflow. Its arguments and results are not persistent ticket storage.

Stop Execution ends the whole graph that is running (a stop inside a workflow called by Run Workflow only ends that workflow). A graph cannot loop back by itself: use a loop block, and keep every loop bounded.