← Example scenarios

Mark the habit, the bot keeps the streak

Type «done», get the count of days in a row. Not one model call, so a run costs almost nothing.

What the scenario looks like

Отметка о привычке
СерияS
Единица
Плюс один▶
Сохранить серию▶
Ответ▶
Ответ▶
  • Execute + Data
  • Data
Open in your workspace →

A streak works better than reminders: forty days in a row is too much to lose over one missed evening. There are plenty of apps for this, and what is actually needed is one message in the messenger you already have open.

What is inside

  1. Habit check-in — the entry.
  2. Streak — a variable scoped to thread. That scope is what makes it memory: session lives for one run, thread is stored in the database and outlives it.
  3. Plus one adds one to the streak. Plain arithmetic, no model.
  4. Save the streak writes the new value back.
  5. The answer prints the result with the right word ending.

There is no model here at all, and that is the point. A run costs one flat charge for the run and nothing more: for a counter poked every day, that is the difference between pennies and a noticeable line on the bill.

What to set up for yourself

  • The answer text. The word forms are handled in the template.
  • Resetting the streak. It currently only grows. An honest counter resets on a missed day, which needs the date of the last check-in stored and compared with today.
  • Several habits. Give each one a variable and branch on the message text.

What to connect

Nothing. A thread-scoped variable is stored on the platform and tied to the conversation: yours is yours, anybody else’s is theirs.