Architectural Overview

The DataObjectBuildOrgTemplate metadata type accelerates environment automation and continuous integration (CI) workflows for Salesforce Data Cloud. In enterprise development pipelines, spinning up ephemeral scratch orgs or automated packaging build orgs requires initializing foundational Data Cloud structures—including Data Lake Objects (DLOs), Data Model Objects (DMOs), and initial schema mappings.

Rather than running lengthy manual setup wizards or brittle post-deployment UI automation, DataObjectBuildOrgTemplate provides a declarative definition of the target Data Cloud org shape. The packaging and deployment engines consume this template to provision standardized data schemas, ensuring integration test suites execute against reliable, repeatable data architectures.

sf org create scratch CI/CD Pipeline (GitHub Actions / GitLab) Ephemeral Build Org Deploy DataObjectBuildOrgTemplate Instant Pre-provisioned DLO & DMO Schema Automated Apex & Data Cloud Integration Tests 2GP Package Version Creation

Directory and File Suffix Conventions

In SFDX source format, DataObjectBuildOrgTemplate files reside in the dataObjectBuildOrgTemplates directory:

Property Value
Metadata Type Name DataObjectBuildOrgTemplate
SFDX Source Directory force-app/main/default/dataObjectBuildOrgTemplates/
SFDX File Suffix .dataObjectBuildOrgTemplate-meta.xml
Manifest Member Name <name>DataObjectBuildOrgTemplate</name>

Key Metadata Fields

Field Name Type Required Architectural Guidance
masterLabel string Yes Descriptive label for the build template.
developerName string Yes Unique programmatic identifier referenced in CI scripts.
description string No Architectural purpose and target release notes.
templateVersion string No Version number indicating template schema alignment.
status string No Lifecycle flag (Active or Draft).

Declarative XML and Manifest Examples

Source Format XML (CI_Build_DataCloud_Template.dataObjectBuildOrgTemplate-meta.xml)

force-app/main/default/dataObjectBuildOrgTemplates/CI_Build_DataCloud_Template.dataObjectBuildOrgTemplate-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<DataObjectBuildOrgTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
    <developerName>CI_Build_DataCloud_Template</developerName>
    <masterLabel>CI Build Data Cloud Template</masterLabel>
    <description>Scaffolds standardized customer and sales DMO schemas for automated packaging builds.</description>
    <templateVersion>1.0</templateVersion>
    <status>Active</status>
</DataObjectBuildOrgTemplate>

Manifest (package.xml)

manifest/package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>CI_Build_DataCloud_Template</members>
        <name>DataObjectBuildOrgTemplate</name>
    </types>
    <version>68.0</version>
</Package>

Retrieval and Deployment Commands

Use the Salesforce CLI to retrieve and deploy DataObjectBuildOrgTemplate metadata:

Terminal
# Retrieve all build org templates from an environment
sf project retrieve start --metadata DataObjectBuildOrgTemplate

# Retrieve a specific build template
sf project retrieve start --metadata DataObjectBuildOrgTemplate:CI_Build_DataCloud_Template

# Deploy build template metadata to an ephemeral build org
sf project deploy start --metadata DataObjectBuildOrgTemplate:CI_Build_DataCloud_Template

Senior Architect Best Practices and Gotchas

  • CI Pipeline Optimization: Deploy DataObjectBuildOrgTemplate at the beginning of ephemeral build org provisioning scripts immediately after scratch org creation to establish data foundations before test execution.
  • Maintain Parity with Production: Ensure build org templates stay strictly aligned with production Data Cloud schema definitions. Use automated scheduled retrievals to catch drift between production DMOs and template definitions.
  • Combine with Data Kits: Pair build org templates with DataPackageKitDefinition artifacts to validate both internal schema building and external package distribution workflows in the same CI cycle.

Note

Ephemeral scratch orgs must enable Data Cloud features in their project-scratch-def.json configuration file before deploying DataObjectBuildOrgTemplate components.

Frequently asked questions

What is the role of DataObjectBuildOrgTemplate?

It automates the scaffolding and instantiation of Data Cloud object structures and DLOs in ephemeral build orgs and CI pipelines.

Where are DataObjectBuildOrgTemplate files saved in SFDX?

They are saved in force-app/main/default/dataObjectBuildOrgTemplates/ with the file suffix .dataObjectBuildOrgTemplate-meta.xml.

How does DataObjectBuildOrgTemplate benefit CI/CD pipelines?

It allows automated test pipelines to spin up complex Data Cloud data models rapidly without manual configuration wizard steps.

How do you retrieve DataObjectBuildOrgTemplate metadata?

Execute sf project retrieve start with the metadata flag DataObjectBuildOrgTemplate.

Comments

Questions, corrections and tips are welcome. Comments are GitHub Discussions, so you sign in with GitHub.