WorkLensDocs
    Studio
    reference

    Recipe keys

    Every key a WorkLens recipe can declare, grouped the way the engine groups them, with a plain-English line for each.

    Last updated 2026-09-13 · Generated from recipe-rules.ts, guarded by check-recipe-ui-coverage · Markdown

    Summary

    A recipe is a JSON file describing what you want made. This is the full list of things it can say, in six groups: what goes in a cell, how values spread across rows, columns worked out from others, links between tables, conditions that must hold, and labels that only the receipt reads. Anything a recipe declares that the engine cannot honour is reported in the run receipt rather than silently ignored.

    41 keys, grouped the way the engine groups them. The label on the right says whether a key sits on a field, a table or the whole recipe.

    What goes in the cell

    Where a column’s values come from.
    type
    What kind of value — text, number, date, choice, identifier.
    field
    type_def
    A rule the recipe sets for this column — a check digit, or a code built in parts.
    Added through your AI assistant. Ask it to change this column.
    field
    role
    Draw real-world values of a named kind, e.g. surnames.
    Names a value kind a pack provides. If no loaded pack provides it, the recipe will not validate.
    field
    pool
    Draw from a named list supplied by a pack.
    field
    pattern
    Keep a shape without keeping the value — BR-##-A.
    # is a digit, A an uppercase letter, a a lowercase one. Everything else is copied through.
    field
    values
    The full set this column is allowed to contain.
    field
    generate
    Name the generator directly instead of inferring one.
    field
    table
    Which pack table this column is drawn from.
    Goes with type "row" — the whole row is drawn together, so suburb, state and postcode agree with each other.
    field
    column
    Which column of that pack table this one takes.
    field
    output
    CSV, or a fixed-width layout. Required.
    recipe

    How values spread

    How often each value turns up across the rows.
    weights
    How often each allowed value appears.
    One number per entry in values, in the same order. They are scaled, so 70/20/10 and 7/2/1 mean the same thing.
    field
    shape
    Bell curve, long tail, even spread, business days.
    field
    dist
    A measured spread, band by band — beats shape when both are set.
    Equal-width bands between min and max. Eight numbers means eight bands.
    field
    month_weights
    Seasonality across the twelve months.
    Exactly twelve numbers, January first.
    field
    weights_when
    A different mix per segment — gold tier skews high.
    A list of branches. Each has a condition and its own weights; the first match wins, and no match falls back to the plain weights above.
    field
    params_when
    A different range per segment — the number version of the above.
    Same branch shape, but each carries min / max / shape / dist instead of weights.
    field
    fanout
    How children spread across parents — even, or a few own most.
    field
    scenarios
    Named conditions — sparse, orphans, duplicates, boundary, volume.
    Each scenario is a named set of rates. One recipe, many datasets: pick the name at generation time.
    recipe

    Worked out from something else

    Columns computed rather than drawn.
    derive
    Worked out from other columns on the same row.
    Arithmetic over this row’s own columns. Order does not matter — the engine settles the formulas until they stop changing.
    field
    aggregate
    Totalled from a child table — sum, count, average, min, max.
    Filled in after every table exists. Chains settle deepest-first, so a total of totals works.
    field
    rollup
    Totalled up a hierarchy — itself plus everything beneath it.
    Needs the table to declare a tree or a graph.
    field

    Must hold

    Conditions the row is checked against.
    unique
    Never repeats.
    field
    nullable
    Whether the cell may be empty — false survives a blank rate.
    Turning this off protects the column from a scenario’s blank rate.
    field
    min
    The lowest a number or date may go.
    field
    max
    The highest a number or date may go.
    field
    after
    This date never falls before another one.
    A column on this table, or one hop through a link — member_id.joined_on.
    field
    present_when
    Filled in only when a condition holds — blank by rule, not by chance.
    Every condition must hold. Applied last, so it wins over calculations.
    field
    expect
    Says a rule here is meant to sit idle, so a count of zero reads as intended.
    A rule that guards a case your data never contains is correct and silent. Marking it stops the receipt reporting it as a dead rule. It does not excuse a condition that could never match anything.
    field
    constraints
    A rule across columns that every row must satisfy.
    One per line. Dates compare as dates. Rows that fail are re-rolled, and the receipt says how often.
    table
    flow
    A status that is the end of a real journey, with dates in order.
    Names the status column, the legal moves between states, and which date column marks each one.
    table
    seed
    Same recipe, same seed, same bytes — every time.
    Leave it empty and every run differs. Set it and the run is reproducible forever.
    recipe

    Notes and classification

    Recorded in the receipt; no effect on the data.
    sensitivity
    Personal, health, linked, or safe.
    field
    category
    Your own grouping for the legend.
    field
    note
    A note for your team. Ignored by the engine.
    field
    rows
    How many rows this table gets.
    table
    region
    Which country the formats and names come from.
    recipe

    Common questions

    What happens if my recipe declares something the engine cannot do?

    It is reported in the run receipt as declared but not generated, rather than dropped silently. The receipt is the place to look for what was asked and what was actually made.

    Is this the same list the studio uses?

    Yes. The studio's rules panel and this page render the same constant, and a check in CI fails if the engine gains a recipe key that constant does not describe.

    Limitations

    • This reference explains what each key means; it does not yet show a worked example per key. The studio's templates are the quickest way to see keys in use.