K
Docs
🔁

Loop

base.loopBase SetLogic

Repeat after me! Takes a list and runs the connected flow once for each item in it. Great for sending messages to multiple users, processing a list of scores, or doing anything that needs to happen more than once.

When to use this
  • After this piece, {{item}} (or whatever you named it) is a Spark in the Each path
  • Vault lists expose {{item.column}} too — e.g. {{item.coins}} when looping {{result}}
  • Connect the All Done path to run something after the whole loop finishes

On the canvas

This is what Loop looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🔁
Loop
base.loop
Logic
listrequired
{{result}}
asrequired
item
each
done

Config fields

FieldTypeReqWhat it does
list
{{result}}
textyesThe list to loop through 📋
as
item
textyesCall each item… 🏷️

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{item}}stringCurrent item in the loop

Output ports

eachRuns for every item in the list (one at a time)
doneRuns once after every item has been processed
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
for (const item of items) {
  // Each iteration — {{item}} or {{item.coins}} per row
  await channel.send(`User ${item.user_id}: ${item.coins} coins`);
}