---
name: journal-sequences
description: Load it when a sequence is run, stepped or written. Steps the agent follows in order, one at a time, started by hand or when something happens.
keywords: sequences, sequence
commands: sequences
---

# Sequences

Steps the agent follows in order, one at a time, started by hand or when something happens.

A template says how to do something or where to start; a sequence is a way of executing: steps in order, handed to you one at a time. Its parts are its steps, the title naming the step and the body saying what to do.

Write sequences for the project you work in. When the user describes a routine ("every time we deploy, first ..."), or you find yourself doing the same steps a second time (a release, a review, setting up a new feature), write it down as a sequence: one step per thing to do, each saying exactly what to run or check, and set how it starts, by a row's moment or by a trigger on the words that mean it is time. Tell the user in one line that you wrote it, so they can change it; a sequence that only you know about helps no one.

journal sequence create "<name>" --brief "<what it is for>" writes one, and journal sequence section <n> "<step>" "<what to do>" adds each step. Steps another sequence already has are not written twice: journal sequence include <n> <other> [--steps 2-3] adds a step that hands out that sequence's steps, or only the ones named, in its place. journal sequence run <n> --about <ref> hands you the first step, and your writes wait until you take it up with journal sequence follow <n> --about <ref>; journal sequence next <n> --about <ref> marks the step in hand done and hands the next, and the last one ends it. A step you never took up cannot be moved past. --set starts_on starts it by itself, about the row it started on: <type>.created or <type>.completed for any row type (dump.created, plan.completed), or trigger:<n> to start when trigger n fires. Any other value is refused. To start on words or a command, such as a deploy, make a trigger that only starts it: journal trigger create "<what it watches for>" --set words="<word>,<word>" --set words_in=commands --set does=start, then set the sequence's starts_on=trigger:<its n>. Sequences nest like function calls: one that starts while another runs is handed to you first, and the one it interrupted comes back when it ends; starting one already running about the same row starts it again. Finishing a sequence comes before anything else you do. Stopping with a step in hand, or leaving it standing still, earns a reminder every minute until it moves on. journal sequence abandon <n> --about <ref> --why "<why>" gives one up that no longer applies: it names the steps it would skip, and takes --sure once you have read them. Some sequences ship with the journal; they are system sequences and cannot be changed or removed.

Its lines and guards are for the main agent only; none reach a subagent.
