Skip to content

Sequential counter ​

Draws the next number of a shared counter — to build a case, quote or reservation identifier (R-2026-0042).

The Sequential counter node draws the next number of a shared counter, to build an identifier: a case, quote or reservation number (CASE-2026-0042). {{ }} expressions cannot count by themselves: a preview in the editor would consume a number at every keystroke. The counter is therefore a node, with three guarantees.

  • Atomic. Two simultaneous runs never get the same number.
  • No gap on retry. A step retried after an incident gets ITS number back instead of consuming a second one.
  • Shared. Two workflows naming the same counter in the same scope draw from the same sequence: the online reservation workflow and the phone reservation one number after each other.

The scope is the whole instance, or a Table: one sequence per Table (lots, reservations). A yearly reset starts again from the “First number” on January 1st; the period is read on the instant the run started, in the time zone of the instance calendar — a run started on December 31 at 11:59 pm draws in the year that ends.

At a glance ​

  • Type: data.sequence · version 1
  • Category: Data
  • Kind: Step — one stage of a run
  • Effect: Writes outside (external_write) — writes outside Loop & Roll; described instead of performed during a test run
  • Needs a carrier email: No
  • Connection: None
  • Inputs: main
  • Outputs: main
The ports of “Sequential counter”: what comes in on the left, what goes out on the rightInput: main. Outputs: main. An error output appears when its failure setting is “Follow the Error output”.Sequential counterdata.sequencemainmainerror · only with “Follow the Error output”
The ports of “Sequential counter”: what comes in on the left, what goes out on the right

Parameters ​

counter ​

Counter name — Two workflows that use the same name (in the same scope) share the same sequence of numbers.

  • Type: Text (string)
  • Required: Yes
  • 80 characters at most
  • Example: cases
  • Expressions: {{ }} accepted

scope ​

Scope

  • Type: One choice (options)
  • Required: Yes
  • Default: instance
  • Options:
    • instance — The whole instance: A single sequence for the whole team.
    • table — A Table: A sequence of its own for one Table — reservation numbers, lot numbers.

table ​

Table

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (table)
  • Shown when: scope is table

reset ​

Reset

  • Type: One choice (options)
  • Required: Yes
  • Default: never
  • Options:
    • never — Never
    • yearly — Every year: R-2026-0001, …, then R-2027-0001 on January 1st.
    • monthly — Every month

start ​

First number — The value of a new sequence, or of a new period.

  • Type: Number (number)
  • Required: No
  • Default: 1
  • Whole number, from 0 to 1000000000
  • Shown under “Advanced” in the editor

padding ​

Digits — Left-padded with zeros: 4 → 0042. 0: the number as is.

  • Type: Number (number)
  • Required: No
  • Default: 4
  • Whole number, from 0 to 12

prefix ​

Prefix — Accepts {{ }} expressions: R-{{ now | date:"yyyy" }}- (the year of the run).

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 80 characters at most
  • Example: R-{{ now | date:"yyyy" }}-
  • Expressions: {{ }} accepted

suffix ​

Suffix

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 80 characters at most
  • Shown under “Advanced” in the editor
  • Expressions: {{ }} accepted

Outputs ​

  • main

Data produced ​

What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).

  • {{ data.<step>.id }} — string. The ready-to-use identifier: the prefix, the zero-padded number, the suffix (CASE-2026-0042).
  • {{ data.<step>.value }} — number. The number drawn, bare (42).
  • {{ data.<step>.padded }} — string. The number left-padded with zeros according to “Digits” (0042).
  • {{ data.<step>.period }} — string. With a reset: the period of the draw, 2026 (yearly) or 2026-05 (monthly). Absent otherwise.
  • {{ data.<step>.counter }} — string. The counter name, normalised (lowercase, no accents).
  • {{ data.<step>.scope }} — string. instance or table.
  • {{ data.<step>.simulated }} — boolean. Test runs only: true — the number shown is the one the next real run would get, nothing is consumed.

Example ​

Number each new reservation CASE-2026-0001, CASE-2026-0002… and start again at 1 every year. Add a Sequential counter node named Number:

counter:  reservations
scope:    instance
reset:    yearly
padding:  4
prefix:   CASE-{{ now | date:"yyyy" }}-

{{ data.number.id }} is CASE-2026-0042. Write it into the reservations Table (Table — insert a row) and into the confirmation subject: “Your reservation {{ data.number.id }}”.

Tips ​

  • Compose the identifier as you like from value: {{ data.number.value | pad:6 }}, {{ now | date:"yy" }}{{ data.number.padded }}.
  • Renaming the counter opens a new sequence that starts from the first number. Keep the same name wherever numbers must follow each other.
  • Deleting a Table does not delete its counter: recreating a Table with the same identifier does not renumber cases already issued.
  • In test runs, nothing is consumed: the node shows the next number (simulated: true).

Loop & Roll — the workflow builder for email.