This documentation is available to agents as Markdown at https://docs.synthesized.io/tdk/latest/user_guide/040_reference/configuration.md. For the complete documentation index, see llms.txt.

Workflow Configuration

A workflow configuration is a YAML file that says what to do with each table. This page shows its structure on one screen. Each key links to the full Configuration Reference, which is generated from the product’s schema.

In the web UI, a workflow’s Configuration page holds this YAML. With the CLI, pass the file with --config-file.

The structure

# Run-wide settings
schema_creation_mode: CREATE_IF_NOT_EXISTS
table_truncation_mode: TRUNCATE
safety_mode: STRICT

# Settings for every table
default_config:
  mode: MASKING
  target_ratio: 1.0

# Overrides for particular tables
tables:
  - table_name_with_schema: "public.customer"
    target_ratio: 0.5
    transformations:
      - columns: ["first_name", "last_name"]
        params:
          type: person_generator
          column_templates: ["${first_name}", "${last_name}"]

A run reads this in three layers:

  1. Run-wide settings apply to the whole run: how the output schema is created, what happens to existing rows, and what to do with columns no rule matches.

  2. default_config applies to every table: its mode, its size and the rules that pick a transformer for each column.

  3. tables override default_config for the tables you list. A table’s transformations set the transformer for particular columns. Columns you don’t list get a transformer from the rules.

Run-wide settings

These keys sit at the top level of the file.

Key What it sets Default

default_config

Settings for every table. See Table settings.

-

tables

Overrides for the tables you list, including their column transformations.

none

schema_creation_mode

Whether the run creates the output schema: CREATE_IF_NOT_EXISTS, CREATE, DROP_AND_CREATE or DO_NOT_CREATE. See Schema Creation.

CREATE_IF_NOT_EXISTS

table_truncation_mode

What happens to rows already in the output tables. DO_NOT_TRUNCATE needs an empty output, TRUNCATE empties the tables first, and IGNORE ignores what’s there.

DO_NOT_TRUNCATE

safety_mode

What happens to a column no rule matches. STRICT stops the run with an error. RELAXED uses a fallback, such as passthrough in MASKING mode, which copies the original value. It has no effect on KEEP tables.

STRICT

cycle_resolution_strategy

How circular foreign keys are handled: FAIL, DELETE_NOT_REQUIRED or DEFER_FOREIGN_KEY. See Cycle resolution strategy.

-

global_seed

A Base64 string that seeds the random generators, so generation gives the same result each time it runs with the same seed and configuration.

empty

schemas

The schemas to process.

all schemas

matchers

Rules that choose a transformer by column name, table name, SQL type or a combination.

none

metadata

Relationships and mappings the database doesn’t declare: extra foreign keys, field overrides, and input-to-output schema mappings.

none

use_text_column_heuristics

Lets GENERATION pick person_generator, address_generator or finance_generator for text columns by their names.

true

flags

Run options. See Flags.

none

scripts

SQL to run on the output before (pre) and after (post) the run. The post script runs even if the run fails.

none

variables

A place to declare YAML anchors that you reuse elsewhere in the file. The run doesn’t read it.

none

A dash means the schema sets no default. Run tdk default-config to see the built-in default configuration.

Table settings

These keys go in default_config, in an entry of tables, or in both, unless the table says otherwise. A key in tables overrides the same key in default_config for that table.

Key What it sets Default

table_name_with_schema

tables only. The table, as schema.table.

required

mode

KEEP copies rows, MASKING transforms every column, GENERATION learns from the input and creates new rows. See How Masking Works and How Generation Works.

-

target_ratio

Output size as a fraction of the input. At most 1 in KEEP and MASKING; above 1 is allowed in GENERATION. Below 1, the table is subsetted.

1

target_row_number

Output size in rows. GENERATION only; overrides target_ratio.

-

transformations

tables only. Transformers for particular columns. See Column transformations.

none

filter

tables only. An SQL condition, as in a WHERE clause, that selects the input rows to process. See Filter Source Rows.

none

cycle_breaker_references

tables only. References to ignore when cycle_resolution_strategy is FAIL.

none

insert_batch_size

Rows written per insert batch.

1000

fetch

How rows are read: streaming with a fetch size, or chunking.

streaming, 1,000 rows

use_working_directory

Whether the table uses the local working directory, when TDK_WORKINGDIRECTORY_ENABLED turns it on. See Working directory.

true

locale

default_config only. Default locale for person_generator and address_generator. A transformer’s own locale overrides it.

en-GB

parent_data_mode

Which parent rows a child table uses: NEW, OLD or ALL.

ALL

checkpoint

The checkpoint for incremental masking.

none

in_memory_filter_threshold

Performance tuning: the parent table size up to which parent key values are held in memory while filtering.

-

items, additional_items

default_config only. Rules of the form "if these conditions hold, use this transformer". Rules in additional_items take precedence over items. Run tdk default-config to see the built-in rules.

built-in rules

Column transformations

Each entry in a table’s transformations sets the transformer for one or more columns.

tables:
  - table_name_with_schema: "public.payment"
    transformations:
      - columns: ["amount"]
        params:
          type: noising
Key What it sets

columns

The columns this transformer writes. Transformers that support several columns, such as person_generator, keep the values in a row consistent with each other.

params

The transformer: type: and its parameters. See Transformers.

mapping

SQL expressions applied to the value when it’s read and written. See Map Values on Read and Write.

The reference also lists id and mode for a column transformation.

Flags

Flags turn on run options. List them under flags:

flags:
  - DISABLE_DB_INDEXES_ON_WRITE
  - DISABLE_DB_TRIGGERS_ON_WRITE
Flag What it does

Writing to the output

DISABLE_DB_INDEXES_ON_WRITE

Disables non-unique indexes while rows are inserted, then re-enables them, or drops and re-creates them where re-enabling isn’t supported. SQL Server, MySQL and Oracle.

DISABLE_DB_TRIGGERS_ON_WRITE

Disables triggers while rows are inserted, then re-enables them. SQL Server only.

DISABLE_BULK_INSERT

Uses single-row prepared statements in batches instead of multi-row inserts.

USE_FILE_BATCH_INSERT

Uses file batch inserts. SQL Server only. Doesn’t work with value mapping, or with subsetting without a working directory.

When a batch fails

NOT_FALLBACK_TO_ONE_BY_ONE_INSERTS

Fails the run when a batch fails, instead of retrying its rows one by one.

SKIP_FAILED_BATCHES

Skips a failed batch instead of retrying its rows one by one.

FORCE_FALLBACK_TO_ONE_BY_ONE_INSERTS

Retries the rows of any failed batch one by one, whatever the SQL error. By default, Db2 and Oracle always retry one by one, and other databases only on integrity constraint violations and data exceptions.

Reading and learning

PROPAGATE_FILTER_TO_CHILDREN

Applies parent table filters to child tables in the database query, so fewer child rows are read. PostgreSQL and MySQL only.

DO_NOT_SELECT_COUNT_FOR_MASKING

Skips row counts that MASKING doesn’t need. Row counts in the logs can be wrong.

DO_NOT_PRELOAD_METADATA_SNAPSHOT

Loads schema metadata on demand instead of up front. Useful for Oracle and SAP HANA databases with large schemas.

DISABLE_EAGER_LOAD_TABLES

Doesn’t load small tables into memory up front. Useful with wide tables.

DO_NOT_USE_ASSISTED_JOINS

Generates child tables by fetching records from the output database instead of using assisted joins. Expect more constraint violations.

IMPRECISE_AGGREGATION

Samples tables when computing column statistics. Faster on large tables, but can miss rare values.

ENABLE_BULK_COLUMN_STATS

Computes column statistics in one query per table instead of one per column. Faster on wide schemas.

Where the output goes

SAME_DATABASE_TRANSFORMATION

Lets the input and output be the same database. Use it with schema mappings in metadata.schemas.

APPENDING_MODE

Appends transformed rows to the same table when the output schema matches the input schema. Use it with SAME_DATABASE_TRANSFORMATION. It can’t be combined with table_truncation_mode: TRUNCATE or schema_creation_mode: DROP_AND_CREATE. See Data Append Mode.

FORCE_CLAIM_SINK

Claims the output even if another run has claimed it. Two runs writing to the same output give unpredictable results.

Other

START_INT_SEQUENCE_FROM_ZERO

Starts integer sequences at 0 instead of 1, as older versions did.

DO_NOT_CONTINUE_FROM_CHECKPOINT

Ignores existing checkpoints in incremental masking, and still writes new ones. Use it for a full refresh.

INFER_UNIQUE

Treats the referenced columns of foreign keys declared in metadata as unique when the referenced table has no matching key, instead of rejecting the configuration.

Check a configuration

The CLI has commands that help you write and check a configuration. See CLI commands.

  • tdk json-schema prints the JSON schema of the configuration file. Point your editor’s YAML support at it for autocompletion and checking as you type.

  • tdk validate-config checks a file against the schema.

  • tdk default-config prints the built-in default configuration, including the rules that pick transformers.

  • tdk dry-run prints the effective configuration of a run without running it.

The inventory file

With the CLI, connection details can come from an inventory file instead of command-line options. See Inventory Configuration.