Process a list of topics or links in Kotia with a loop
Repeat a writing step for each topic in a list or run several links per run. Set loop repeats, pass data between cards, and save each result separately.
On this page8
One Kotia workflow can process several topics or links in a single run: the loop repeats the chosen steps for each piece of material. For example, a list of topics can become a series of separate posts with one writing task and shared requirements for the format.
To do this, set up a repeating section and the card that hands out the next item. The same mechanism works for revising one text step by step, but the data-passing settings are different. Both cases are covered here. To run the workflow on different days, set up a schedule.
Example: three topics, three posts in a folder
For the blog of a pottery studio, we will prepare posts on the topics "How the first class goes," "What you can make in one workshop," and "How to care for a ceramic mug."
Workflow: Start → [Hand out one at a time → New step → Folder]. Square brackets mark the section that repeats. On each pass, the first card hands out the next topic, the AI writes a post, and the "Folder" card saves it as a separate document. If all three passes complete successfully, the folder will contain three texts.
How to build a loop from a list of topics
- Add the "Hand out one at a time," "New step," and "Folder" cards. Connect them in the order listed, and connect the first card to "Start."
- In "Hand out one at a time," open the list and add the topics as separate lines. Make sure all three topics are waiting to be handed out. For this example, leave "Split what arrives into rows" turned off, since you have already entered the topics by hand.
- In "New step," set the post format. For example: "Write a useful post for a pottery studio blog based on the topic you receive. Explain the topic with a clear example, then give practical tips. Do not make up the schedule, prices, or terms of our studio. Return only the text of the post."
- In "Folder," choose the folder in the Workspace where the documents will be saved.
- Select the three connected cards and click "Wrap in a loop." They will appear in a frame marked with ∞.
- Open the settings with the gear icon on the frame. In the "Repeats" field, choose three passes. Leave the "External material" field set to "once," and set "Next" to "Last result." In this example, saving happens inside the section.
- Check that everything is ready and run the workflow. When it finishes, open the folder and reread each post.
"Hand out one at a time" keeps its position in the list. A repeated full run continues handing out items and does not automatically start again from the first topic. To process earlier topics again, first return the rows you need to the queue. For details, see instructions for the task list.
How to choose repeat settings
Settings open with the gear icon on the frame or on a collapsed loop. The number on the frame itself only shows the selected number of passes.
| Setting | What it does |
|---|---|
| "Repeats" | The section runs from 2 to 99 times. This is a set number of passes, not an instruction to run "until the end of any list" |
| "External material" → "once" | The external source arrives on the first pass. After that, the section works with the result of the previous pass. Cards with their own list, as in our example, take the next item |
| "External material" → "every pass" | External data arrives again on every pass, together with the result of the previous pass. Useful when the original requirements should stay in front of the AI |
| "External material" → "per item" | The batch that arrives at the first card of the section (news, topics, products) is split into items, and each pass gets its own. Extra passes are not run. If there are more items than repeats, the first ones are taken, up to the number of repeats. If several connections arrive at the first card, select the one that carries the batch in the "List" line. The others will arrive whole on every pass. The "How to split" field is optional, for example: "each news item is a separate item, skip ads" |
| "Next" → "Last result" | Cards after the loop receive the final result |
| "Next" → "All results together" | All the results of the passes are passed beyond the section together |
| "Next" → "Each when ready" | Results are passed as they become ready. The next steps may run and be charged separately for each result |
Connected style, skill, and memory apply on every pass, regardless of the External material setting. When results are passed one at a time, consider what the receiving card is for. For example, "Ask me" after the section collects the results and asks one question, not a separate question on each pass.
If the list comes as one text
When topics or news arrive from the previous card as one block of text, for example a set of search results, set "External material" to "per item" on the loop. Each pass gets its own news item, so the task is written for a single item: "Write a note based on the news item you received." You do not need to write "on pass N, take item N" in the task, and it will not help. The batch has no numbers the AI could use to find its item.
Each pass works only with its own item. The result of the previous pass is not passed to it, but the AI sees what has already been done in the short "what's done" lines from earlier passes. This way, a pass will not confuse its news item with someone else's.
How the batch was split is shown in the title of the loop frame: "items 5 · taken 5." Click this line to open all the items, marked with which pass received what. If the line is red, with the text "could not split the batch," the passes did not run and were not charged. The most common cause is a piece of text with no line breaks that is longer than 200,000 characters.
After a run, run history shows which item each pass received and what was done with it. To check this, open the result of the pass. "Hand out one at a time" is not needed as the first card in such a loop. It is a different way to hand out items one by one, and it suits a queue between runs.
How to edit one text several times
For step-by-step editing, one "New step" card is enough. Pass it the original text, and describe the specific edit in the task:
Improve the readability of the text: replace heavy wording, remove repetition, and shorten sentences that are hard to understand on the first read. Keep the facts, numbers, links, and meaning. Return the full edited text without a report of the changes.
In the "More" menu of this card, choose "Wrap in a loop." Set the number of repeats, leave "External material" set to "once," and set "Next" to "Last result." A "Document" card connected after the loop will receive the final version.
Each next pass will work with the previous edit. A larger number of passes does not guarantee a better text by itself, so start with a small number and compare the result with the original.
Where to save all results
A separate document for each pass: place the "Folder" card last inside the section, as in the post example. Each successful pass will save a new document.
All texts in one document: use the "Document" card inside the loop in "Append to the end of the document" mode. If the content is replaced, only the last saved version will remain.
One final text: keep the document outside the loop, and set "Next" to "Last result." This suits editing a single piece of material.
What to check before you run
The section must have one starting step and one ending step. Several unconnected chains in one frame do not form a working loop. Connect to the next step outside the section from the last card.
Inside a loop you have already created, you do not need to add a feedback connection: the move between passes happens automatically. "Compare two versions" is not supported inside a loop. You can use the "Ask me" card, but the run will wait for an answer.
To test only the section, open its gear icon and choose "Run." The set repeats of the loop itself will run, but the cards after it will not. If the section has no suitable input data, prepare it first.
How repeats affect usage
Each run of a paid card is charged separately. In the topic example, the AI writes several posts, which means it performs several separate jobs. "Each when ready" mode can also add repeated runs for cards after the loop.
After each pass, for cards that use AI, a low-cost model writes a short "what's done" line so that the following passes can see the previous ones. This is a small task, and it is charged based on actual usage. In "per item" mode, the same low-cost model splits the batch once per run, also charged based on actual usage. Extra passes that did not get an item are not run and are not charged.
In some loops made of several cards, the first card runs one more time to accept the result of the last pass. For example, a document at the start of the section saves the latest prepared version this way. If this extra run is paid, it also uses tokens. So the number of repeats does not always match the number of runs of each card.
"Hand out one at a time," the first card in our example, has no such extra run: it hands out the items of its own list one after another. Check the actual result and the status of the work on the cards and in run history.