synthtraffic Get started
Docs menu

Build a scenario

Defaults

Repeating the same pace, limit, seed, or locale in every generator makes a scenario harder to change. Put shared settings under defaults, then override only the generator that should behave differently.

The result we want

Our marketplace needs two customer events but only one daily promotion:

customers       CUST-00
dailyPromotion  free-shipping
customers       CUST-01

Both generators inherit a limit of two. The promotion replaces its inherited limit with one.

Share settings and override one

Shared defaults with one override

YAML defaults-inheritance.yaml
defaults:
  seed: 42
  faker:
    locale: en_GB
  maxEvents: 2

generators:
  - name: customers
    value:
      customerId: =seq(format=CUST-%02d)
      name: =faker(person.fullName)

  - name: dailyPromotion
    config:
      maxEvents: 1
    value:
      promotion: free-shipping
      market: UK

Press Try it. You should see two customers events and one dailyPromotion event.

  • defaults.seed: 42 repeats calculated random values.
  • defaults.faker.locale: en_GB applies to every Faker expression.
  • defaults.maxEvents: 2 applies to both generators.
  • dailyPromotion.config.maxEvents: 1 replaces only that generator’s inherited limit.

The override does not change customers, and it does not replace the seed or Faker locale.

Everything you can set

The entire defaults block is optional. This table shows every supported setting and what Synthtraffic uses when you leave it out.

SettingAccepted valuesValue when omitted
seedAn integer used for repeatable calculated valuesGenerates a seed and prints it so you can reuse it
clock.startAn RFC3339 timestamp such as 2026-03-01T09:00:00ZThe time the command starts
faker.localeen_US, en_IN, en_AU, or en_GBen_US
rateunlimited, a value such as 10/s, or an advanced rate-window objectunlimited
intervalA duration such as 500ms or an expression such as =uniformDuration(100ms, 500ms)Not set
maxEventsA positive event count10000 per generator when maxDuration is also omitted
maxDurationA positive duration such as 30s or 5mNot set
history.maxEventsA positive retained-event count used by relationships100000 per referenced source generator
delayDelivery-delay settingsDisabled
discardProbabilistic delivery-drop settingsDisabled
repeatProbabilistic duplicate-delivery settingsDisabled

The behavior of rate, interval, and limits is covered in Time and pace. Delay, discard, and repeat are covered in Delivery behavior.

Generator config can replace rate, interval, maxEvents, maxDuration, history, delay, discard, or repeat for that generator. seed, clock.start, and faker.locale apply to the whole scenario.

Make a run repeatable

seed and clock.start repeat different parts of a run:

  • seed repeats calculated random values from expressions such as uuid(), faker(), and uniform().
  • clock.start repeats the first scenario-clock timestamp used by now().

Set both when random values and timestamps must match:

defaults:
  seed: 42
  clock:
    start: 2026-03-01T09:00:00Z

With the same scenario, seed, and clock start, another run produces the same random choices and the same scenario timestamps. A seed alone does not freeze timestamps because the scenario clock otherwise begins when the command starts.

Choose a Faker locale

faker.locale selects the regional data used by every faker() expression:

  • en_US — United States
  • en_IN — India
  • en_AU — Australia
  • en_GB — United Kingdom

For example:

defaults:
  faker:
    locale: en_GB

Next: relate orders to customers that already exist.