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:
-
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.
-
default_configapplies to every table: its mode, its size and the rules that pick a transformer for each column. -
tablesoverridedefault_configfor the tables you list. A table’stransformationsset 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 |
|---|---|---|
Settings for every table. See Table settings. |
- |
|
Overrides for the tables you list, including their column |
none |
|
Whether the run creates the output schema: |
|
|
What happens to rows already in the output tables. |
|
|
What happens to a column no rule matches. |
|
|
How circular foreign keys are handled: |
- |
|
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 |
|
The schemas to process. |
all schemas |
|
Rules that choose a transformer by column name, table name, SQL type or a combination. |
none |
|
Relationships and mappings the database doesn’t declare: extra foreign keys, field overrides, and input-to-output schema mappings. |
none |
|
Lets GENERATION pick |
|
|
Run options. See Flags. |
none |
|
SQL to run on the output before ( |
none |
|
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 |
|---|---|---|
|
required |
|
|
- |
|
Output size as a fraction of the input. At most |
|
|
Output size in rows. GENERATION only; overrides |
- |
|
|
none |
|
|
none |
|
|
none |
|
Rows written per insert batch. |
|
|
How rows are read: |
streaming, 1,000 rows |
|
Whether the table uses the local working directory, when |
|
|
|
|
|
Which parent rows a child table uses: |
|
|
The checkpoint for incremental masking. |
none |
|
Performance tuning: the parent table size up to which parent key values are held in memory while filtering. |
- |
|
|
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 |
|---|---|
The columns this transformer writes. Transformers that support several columns, such as |
|
The transformer: |
|
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 |
|
|
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. |
|
Disables triggers while rows are inserted, then re-enables them. SQL Server only. |
|
Uses single-row prepared statements in batches instead of multi-row inserts. |
|
Uses file batch inserts. SQL Server only. Doesn’t work with value mapping, or with subsetting without a working directory. |
When a batch fails |
|
|
Fails the run when a batch fails, instead of retrying its rows one by one. |
|
Skips a failed batch instead of retrying its rows one by one. |
|
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 |
|
|
Applies parent table filters to child tables in the database query, so fewer child rows are read. PostgreSQL and MySQL only. |
|
Skips row counts that MASKING doesn’t need. Row counts in the logs can be wrong. |
|
Loads schema metadata on demand instead of up front. Useful for Oracle and SAP HANA databases with large schemas. |
|
Doesn’t load small tables into memory up front. Useful with wide tables. |
|
Generates child tables by fetching records from the output database instead of using assisted joins. Expect more constraint violations. |
|
Samples tables when computing column statistics. Faster on large tables, but can miss rare values. |
|
Computes column statistics in one query per table instead of one per column. Faster on wide schemas. |
Where the output goes |
|
|
Lets the input and output be the same database. Use it with schema mappings in |
|
Appends transformed rows to the same table when the output schema matches the input schema. Use it with |
|
Claims the output even if another run has claimed it. Two runs writing to the same output give unpredictable results. |
Other |
|
|
Starts integer sequences at 0 instead of 1, as older versions did. |
|
Ignores existing checkpoints in incremental masking, and still writes new ones. Use it for a full refresh. |
|
Treats the referenced columns of foreign keys declared in |
Check a configuration
The CLI has commands that help you write and check a configuration. See CLI commands.
-
tdk json-schemaprints the JSON schema of the configuration file. Point your editor’s YAML support at it for autocompletion and checking as you type. -
tdk validate-configchecks a file against the schema. -
tdk default-configprints the built-in default configuration, including the rules that pick transformers. -
tdk dry-runprints 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.