On this page
Synthetic Data
Workflow reference | Cached product-search samples
Kind: SyntheticData
Configuration object: syntheticData
Cache a reusable synthetic dataset and run its nested generator only when the collection is empty or an explicit rebuild is requested.
Inputs
The step receives its current input and named bindings. Its input expression selects the generator input. The generator receives that typed value as input and inherits the parent's named bindings.
A populated collection is reused by name regardless of changes to the current seed. Enable Start from scratch when edited seed data should replace the saved dataset.
Configuration
| Property | Default | Usage |
|---|---|---|
collection |
"synthetic-data" |
Shared collection name, 1-128 ASCII letters, digits, periods, hyphens, or underscores. |
startFromScratch |
false |
Ignore saved data and generate a replacement on this run. Turn it off to resume reuse. |
input |
Input expression | Typed input supplied to the generator on a miss or rebuild. |
generator |
Empty workflow named "Generate synthetic data" |
A nested schema-version-1 workflow with at least one step when runnable. Edit it on its own canvas. |
Both app modes use the syntheticData table of BenchiusWorkflowData in IndexedDB. Web Locks serialize generation across tabs. Server and exported hosts supply IWorkflowDataStore, using the configured file store by default.
Outputs
The step returns its saved or newly generated typed value. One active terminal output defines the generator result. An empty result (null, empty object, empty array, or blank string) fails and preserves any prior collection.
A cache hit emits reuse activity and marks generator steps skipped. A rebuild commits after successful generation; failures preserve the prior saved data. The step and generator deadlines remain active, including while waiting for a collection lock.
The cache stores synthetic, non-sensitive JSON and can include inline images. Each collection must fit 16 MiB and the host's workflow text budget. Credentials remain in Vault or runtime credential bindings.
Example
{
"id": "synthetic-products",
"name": "Cache sample products",
"kind": "SyntheticData",
"syntheticData": {
"collection": "sample-products",
"startFromScratch": false,
"input": { "function": "input", "value": "input" },
"generator": {
"schemaVersion": 1,
"id": "seed-product-body",
"name": "Seed products",
"nodes": [
{
"id": "copy-products",
"kind": "Expression",
"expression": { "function": "input", "value": "input" }
}
],
"edges": []
}
}
}
The first run with [{"id":"P1","title":"Synthetic lamp"}] saves that array. Subsequent workflows using sample-products reuse it. Starting from scratch replaces it after the generator completes.
Generator variables must remain inside the generator. Return needed values in its cached output. Cached generators cannot acquire their own collection recursively or form cycles of collection locks.