Skip to main content

Control flow

Add conditions, loops and pauses to your flow.

If​

Runs the "then" actions when the condition is true, otherwise runs the "else" actions.

Inputs

NameTypeRequiredDetails
ConditionYes/NoYesYes/No value to evaluate.

Branches

NameDetails
ThenRuns when the condition is true.
OtherwiseRuns when the condition is false. Optional.

Switch​

Runs the branch whose case value matches the input value.

Inputs

NameTypeRequiredDetails
ValueTextYesValue to compare against the case values.

Branches

NameDetails
Default caseRuns when no case matches. Optional.
Case valueRuns this branch when the input value equals this value. Added by you, one per entry.

If it has a value​

Runs "Has a value" when the value is not empty (an empty text or list still counts as set), with the value available there as never empty, and "Is empty" when it is empty.

Inputs

NameTypeRequiredDetails
ValueAnyYesThe value to check.

Branches

NameDetails
Has a valueRuns when the value is set. Provides to its steps: Value (The value, known not to be empty here)
Is emptyRuns when the value is empty. Optional.

Switch on kind​

Runs the branch for the kind of value it gets, for a value that can be one of several kinds (a user or a role, one kind of audit log details). Each branch has the value as that kind. A value that is empty runs no branch, not even Other kinds, as with an audit log entry that has no details.

Inputs

NameTypeRequiredDetails
ValueAnyYesThe value whose kind decides the branch.

Branches

NameDetails
Other kindsRuns for every kind without its own branch. It does not run when there is no value, such as an audit log entry without details. Optional.
KindRuns this branch when the value is this kind. Added by you, one per entry. Provides to its steps: Value (The value, as this branch's kind)

Branch on subcommand​

Runs the branch matching the subcommand (or subcommand group) that invoked this command. The branches are derived automatically from the command's own subcommands - one per invocable subcommand - so there is nothing to add by hand.

Inputs

NameTypeRequiredDetails
InteractionSlash commandYesThe slash-command interaction that invoked this flow.

Branches

NameDetails
GroupThe subcommand group this branch matches (empty when the subcommand has no group). Added by you, one per entry.
SubcommandThe subcommand this branch matches. Added by you, one per entry.

For each item​

Runs the body once for each item in the list.

Inputs

NameTypeRequiredDetails
ItemsList of AnyYesList to go through.

Branches

NameDetails
BodyRuns once per item. Provides to its steps: Item (Current item being iterated), Index (Position of the current item (starting at 0))

For each lookup table entry​

Runs the body once for each key and value of the lookup table.

Inputs

NameTypeRequiredDetails
Lookup tableLookup table of Text to AnyYesLookup table to go through.

Branches

NameDetails
BodyRuns once per entry. Provides to its steps: Key (Current entry's key), Value (Current entry's value)

Wait​

Pauses the flow for the given duration.

Inputs

NameTypeRequiredDetails
DurationDurationYesHow long to wait, up to 30 days. A wait of 5 seconds or more pauses the flow and picks it up again later, even after a restart. Inside a loop, only a few seconds are possible. Value: 0 to 2592000000. Default: 1000.

Stop flow​

Immediately stops the rest of the flow.

Note​

A comment shown in the editor. Has no effect at runtime.

Inputs

NameTypeRequiredDetails
NoteTextYesText of the note. Maximum length: 1000 characters.

Repeat​

Runs the body a fixed number of times.

Inputs

NameTypeRequiredDetails
TimesWhole numberYesHow often the body runs (1-10000). Value: 1 to 10000.

Branches

NameDetails
BodyRuns once per iteration. Provides to its steps: Index (Number of the current iteration (starting at 0))

Try​

Runs the attempt actions; when one of them fails, the error branch runs instead of failing the whole flow.

Branches

NameDetails
AttemptActions to try.
On errorRuns when an action inside "Attempt" fails. Optional. Provides to its steps: Error code (Machine-readable code of the error), Error message (Human-readable description of the error)

Random branch​

Randomly runs at most one branch based on the branch weights. If the weights add up to less than 100, the remainder is the chance that no branch runs.

Branches

NameDetails
WeightChance of this branch running, in percent (0-100). Added by you, one per entry.

Break loop​

Stops the current loop immediately and continues after it. Only valid inside a loop.

Continue loop​

Skips the rest of the current iteration and moves on to the next one. Only valid inside a loop.

Need more help?
Can't find what you're looking for? Our team is happy to help.