Docs menu
Build a scenario
Scenario file Generators vars and const Time and pace Defaults Relationships Schedules Instances Lifecycle Collections Connections Delivery behaviorGetting started
Quickstart
Goal: print three JSON events on your machine in a few minutes.
1. Install and set a license
Follow Install if you have not already — get the CLI or Docker image, then set your license.
2. A tiny scenario
Save this as hello-world.yaml:
generators:
- name: events
config:
interval: 1s
value:
eventId: =uuid()
source: =oneOf(web, mobile, api)
score: =uniform(0, 100, round=1)
createdAt: =now(format=RFC3339Milli)
No connection yet — this file only describes the events. Values beginning with = are expressions that Synthtraffic calculates for each event. interval: 1s moves createdAt forward by one second each time.
The command below also asks sample for at most three events across the whole file.
3. Sample
sample requires the license configured in step 1. Pick CLI or Docker; the sample command prints preview events to your terminal.
Run the sample
Requires Install and License from step 1 (binary on
PATH, SYNTHTRAFFIC_LICENSE_FILE set).
synthtraffic sample hello-world.yaml --events 3 --seed 42 Run the sample
Requires Install and License from step 1 (image pulled,
--env-file on every run).
docker run --rm \
--env-file ./license.env \
--volume "${PWD}/hello-world.yaml:/work/hello-world.yaml:ro" \
synthtraffic/synthtraffic:latest \
sample /work/hello-world.yaml --events 3 --seed 42 --rmRemoves the stopped container after the sample finishes.
--env-filePasses license variables from license.env into the container.
--volumeMounts hello-world.yaml inside the container as a read-only file.
sample ...Prints three preview events to stdout.
4. What you should see
JSON Lines — one object per event. With --seed 42, the random fields match a second run. createdAt is started at current time and steps forward one second each line, so it changes on every run:
{"eventId":"a3e390d7-1f37-4053-88fb-d0a3c4728058","source":"mobile","score":95.7,"createdAt":"2026-01-02T03:04:05.000Z"}
{"eventId":"04c54733-c8e5-4a14-9f04-bd9c4607f04e","source":"mobile","score":53.5,"createdAt":"2026-01-02T03:04:06.000Z"}
{"eventId":"c47f2c8d-22e7-4a1d-b034-2479e6bb38ef","source":"web","score":81.0,"createdAt":"2026-01-02T03:04:07.000Z"}
Next
You have a working preview. Choose one path:
- Overview — from event shape to connections, with Try it beside the YAML
- Scenario file — start the authoring path, one section at a time