Overview
Seeds let you export and import objects across all of CXF. Use them to move configuration and data between environments — for example, to promote a setup from one instance to another, seed a new environment, or load large volumes of records. There are two types of seed, with different trade-offs between functionality and speed.Seed types
| Structural seeds | Instance seeds | |
|---|---|---|
| What it’s for | Exporting and importing the structure and configuration of objects | Inserting very large quantities of data |
| Feature coverage | Supports all features; can get very complex | Limited — reserved for template instances only |
| Processing | One by one | Bulk insert (leverages MongoDB bulk insert) |
| Speed | Slower, higher fidelity | Fast, high volume |
Structural seeds
Structural seeds support every feature in CXF and can represent complex objects in full detail. Because each object is processed one by one, they carry more functionality at the cost of speed. Use them when fidelity matters — exporting and importing the structure and configuration of your objects.Instance seeds
Instance seeds are built for volume. They take advantage of MongoDB’s bulk insert to load large quantities of records quickly. In exchange, feature support is more limited, and they are reserved for instances of templates only.Building a structural seed
A structural seed is a JSON array. Each item declares anobject_type and a
data object holding the record’s fields — the same fields documented on that
object’s reference page. Items are processed in order, so a record can
reference another that was created earlier in the same seed.
Because ids aren’t known ahead of time, structural seeds use reference
helpers — {{...}} expressions that resolve to a record’s id at insert time:
| Helper | Resolves to |
|---|---|
getRecordAttribute(object_type, field, value) | The id of a record matched by a field — used for template_id. |
getAttributeGroup(object_type, group_slug, template_slug, template_type) | The id of a parent group attribute — used for parent_id. |
getContentInstance(template_slug, field, value) | The id of a content instance. Content instances (and documents) live in a per-template collection, so the template slug is required — getRecordAttribute can’t resolve them. |
Content attributes are defined against the
content_versions object type and
scoped to their content template through template_id. Nested fields point to
their group with parent_id and use a dotted full_slug
(for example, default.cover_image).Building an instance seed
An instance seed is a flat JSON array of records inserted in bulk into a single template’s instances. Unlike a structural seed, it has noobject_type
wrapper and no reference helpers — every record targets the same template
(chosen when you run the seed), so there are no ids to cross-reference.
For content, each record’s values live inside its versions, and attribute
values are grouped under their attribute group’s slug (for example default):
Instance seeds are reserved for template instances and don’t support
hierarchy. To create parent-child relationships (for example between
Taxonomies), use a structural seed or set them in the UI afterward.
Behaviour & rules
- A seed is authored as a JSON array and pasted directly into the importer — there’s a live preview that validates the JSON as you type, so only valid input can be imported.
- Structural seeds are processed one record at a time, in array order, so a later record can reference one created earlier via reference helpers; instance seeds are inserted in bulk into a single template’s instances.
- Seeds are idempotent — re-importing the same seed won’t create duplicates.
- A seed can run synchronously, or asynchronously as a background job whose progress you follow under Jobs. A synchronous import is limited to 50 objects; for larger seeds, run it asynchronously (no limit).
Where to find it
Seeds are imported from Docs Explorer → Schemas. Click Import structure seeds to open the Import Structure Seeds panel:- Import — paste your JSON array into JSON Input; the Preview pane updates automatically. Toggle Run asynchronously (background job) for large imports, then click Import Seeds.
- Jobs — track the status of asynchronous import jobs.
Governance & permissions
Only a super admin or Master can import seeds.Related
Schemas
The shape of the data seeds carry.
Content Templates
Instance seeds operate on template instances.