Reference

Built-in Functions

UUIDs, timestamps, random generators, and EN-locale faker data for dynamic test data.

UUIDs

Expression Output Deterministic
{{ $uuid }} Random UUID v4 Yes (seeded)
{{ $uuid_v4 }} Same as $uuid Yes (seeded)
{{ $uuid_v7 }} Time-ordered UUID v7 (Unix-ms prefix + random suffix) Partial (real-time prefix)

Use in request bodies and capture assertions:

body:
  idempotency_key: "{{ $uuid }}"
  event_id: "{{ $uuid_v7 }}"

Timestamps

Expression Output Deterministic
{{ $timestamp }} Unix timestamp (seconds since epoch) No (real-time)
{{ $now_iso }} ISO 8601 datetime string No (real-time)

Random generators

Expression Output Deterministic
{{ $random_hex(8) }} N-character random hex string Yes (seeded)
{{ $random_int(1, 100) }} Random integer in [MIN, MAX] Yes (seeded)
{{ $alpha(8) }} N lowercase ASCII letters Yes (seeded)
{{ $alnum(8) }} N lowercase alphanumeric characters Yes (seeded)
{{ $choice(a, b, c) }} Pick one option randomly Yes (seeded)
{{ $bool }} Random "true" or "false" string Yes (seeded)

Faker generators (EN locale)

Expression Output Example
{{ $email }} Random free email address jane.doe@example.com
{{ $first_name }} Random first name Jane
{{ $last_name }} Random last name Doe
{{ $name }} Random full name Jane Doe
{{ $username }} Random username jane_doe_42
{{ $phone }} Random phone number +1-555-123-4567
{{ $word }} Random single word qui
{{ $words(3) }} N random words joined by space lorem ipsum dolor
{{ $sentence }} Random sentence (4-10 words) Lorem ipsum dolor sit amet.
{{ $slug }} Hyphen-joined lowercase slug (2-4 words) lorem-ipsum-dolor
{{ $ipv4 }} Random IPv4 address 192.168.1.1
{{ $ipv6 }} Random IPv6 address fe80::1

Faker example in a request body:

body:
  name: "{{ $name }}"
  email: "{{ $email }}"
  username: "{{ $username }}"
  role: "{{ $choice(admin, user, viewer) }}"
  tags: "{{ $words(3) }}"

Determinism

Set TARN_FAKER_SEED=<u64> environment variable (highest priority) or faker.seed: <u64> in tarn.config.yaml to freeze every RNG-backed built-in for the process:

# tarn.config.yaml
faker:
  seed: 42

With a seed, these become reproducible:

  • $uuid / $uuid_v4 (v7 is partially real-time)
  • All $random_* and $choice / $bool
  • All faker generators ($name, $email, etc.)

These remain real-time even with a seed:

  • $timestamp — wall clock
  • $now_iso — wall clock
  • v7 UUID timestamp prefix — wall clock
Tip

Use a deterministic seed in CI to make test failures reproducible. Use no seed during local development for varied data.