DataStreamTemplate represents a data stream that a user adds to a data kit. It carries the stream's source references, filtering, access or ingestion type, and refresh settings. It is the stream template within the kit, not the kit definition itself.
The template connects to a source bundle and a Data Source Object (DSO), which represents the object from which data originates. Its objectCategory describes the category of the Data Model Object (DMO), not the identity of the source object. Access to this metadata type requires the Salesforce Customize Application permission.
Key Elements
| Element | What the Element Controls |
|---|---|
masterLabel |
Required. The assigned name of the data stream template. The inherited fullName, rather than this label, identifies the metadata component. |
dataSourceBundleDefinition |
Required. Reference to the DataSourceBundleDefinition to which the template belongs. |
dataSourceObject |
Required. Reference to the DataSourceObject representing the source object. |
objectCategory |
Required. The DMO category. This is separate from the DSO reference. |
dataConnectionSourceParameters |
An array of connection-source parameter inputs. Each entry exposes fullName, paramName, and value. |
filterCriteria |
A filter applied to the stream before information is sent to Data Cloud. It changes which source data is passed onward, not merely its display. |
streamType |
The access or ingestion type: DIRECT_ACCESS, DIRECT_ACCESS_ACCELERATED, or INGEST. |
refreshFrequency |
The refresh cadence. Salesforce lists Batch, NONE, MINUTES_5, MINUTES_15, MINUTES_30, HOURLY, EVERY_4_HOURS, EVERY_12_HOURS, DAILY, WEEKLY, MONTHLY, NOT_APPLICABLE, and STREAMING. Exact enum differences are described below. |
refreshMode |
The refresh mode. Salesforce lists FULL_REFRESH, UPSERT, INCREMENTAL, REPLACE, NEAR_REAL_TIME_INCREMENTAL, PARTIAL_UPDATE, NOT_APPLICABLE, and STREAMING. Its enum coverage differs from the exposed element schema. |
refreshDayOfMonth |
An integer supplying month-based refresh timing details. Interpret it with the other refresh settings. |
refreshDayOfWeek |
An integer supplying week-based refresh timing details. Interpret it with the other refresh settings. |
refreshHours |
A string supplying the duration after which the stream must be refreshed. |
refreshStartDate |
The date for retrieving data based on the refresh frequency. |
fullRefreshIntervalDays |
The separate full-refresh interval: NONE, DAYS_10, DAYS_25, or DAYS_50. |
streamingAppDataConnectorType |
The connector app type for data streaming. Salesforce lists MobileApp and WebApp; the exposed element schema also lists ServerApp. |
Behavior and Constraints
The inherited fullName identifies the template as a metadata component. masterLabel supplies its required assigned name. The fullName nested inside a dataConnectionSourceParameters entry belongs to that parameter entry, not to the enclosing template.
sourceObjectName separately records the name of the object from which data is streamed. It does not replace the required dataSourceObject reference. Similarly, objectCategory describes the DMO category rather than identifying the DSO. templateVersion is an integer storing the template's version number.
Interpret the refresh settings together:
-
streamTypeselects direct access, accelerated direct access, or ingestion. It is separate from refresh cadence and refresh mode. -
refreshFrequencysupplies the cadence, whilerefreshModesupplies the mode. -
refreshDayOfMonth,refreshDayOfWeek, andrefreshHoursadd timing details;refreshStartDatesupplies the date for retrieving data based on that frequency. -
fullRefreshIntervalDaysseparately specifies the full-refresh interval.
The available enum values do not establish that every combination of stream type, connector, frequency, and mode is supported. In particular, a value appearing in an enum is not a guarantee that it works with every connector.
Deployment and Retrieval
DataStreamTemplate components use the .dataStreamTemplate suffix and reside in the dataStreamTemplates folder.
This type does not support the wildcard character * in package.xml. Name each intended component explicitly in the manifest's members entries under DataStreamTemplate. Use the component identity, not its masterLabel. See Salesforce's manifest deployment and retrieval guidance.
The required dataSourceBundleDefinition and dataSourceObject references connect the template to its bundle and source definition. Those references are not substitutes for including the relevant components in a migration.
Deploying only DataPackageKitDefinition can leave the kit's stream content behind. The January 2025 migration report below describes an empty kit after deploying its definition alone, followed by a successful migration that explicitly included DataStreamTemplate and related components. That component set applies to the reported Ingestion API Connector scenario; it is not a universal dependency list for every template.
Relationships
The template's direct references identify its source bundle and source object. Other components included in the reported data-kit migration are deployment companions for that scenario, not additional element references from DataStreamTemplate.
References
-
DataSourceBundleDefinition:dataSourceBundleDefinition. -
DataSourceObject:dataSourceObject.
Documentation Inconsistencies
The Salesforce field reference and the exposed element schema differ in three consequential enum details:
-
refreshFrequency: Salesforce listsBatch, while the exposed schema listsBATCH. -
refreshMode: Salesforce listsSTREAMING, while the exposed schema does not enumerate it. -
streamingAppDataConnectorType: Salesforce listsMobileAppandWebApp, while the exposed schema also enumeratesServerApp.
These differences concern exact value representation or coverage. They do not establish that Batch and BATCH are interchangeable, or that a value omitted from one list is universally unsupported.
Reported Issues
-
A migrated data kit can be empty when only its definition is deployed. In a January 2025 report involving an Ingestion API Connector, multiple ingestion streams, and mappings to custom and standard DMOs, deploying
DataPackageKitDefinitionalone left out the kit content. The reporter said that Salesforce CLI and Metadata API did not automatically select the kit components as the unmanaged-package route did. The reported successful migration includedDataPackageKitDefinition,DataPackageKitObject,DataSourceBundleDefinition,DataSourceObject,DataSrcDataModelFieldMap,DataStreamTemplate,ExtDataTranObjectTemplate,FieldSrcTrgtRelationship,DataSource, andCustomObject. In that scenario,CustomObjectcovered custom DMOs and custom formula fields on standard DMOs. This is a scenario-specific result, not a required list for every migration. Read the data-kit migration discussion.
Common Questions
Can I retrieve all DataStreamTemplate components with a wildcard?
No. DataStreamTemplate does not support * in package.xml. List the intended component names explicitly.
Why is my data kit empty after deployment?
Deploying DataPackageKitDefinition alone can omit the kit content. In the reported Ingestion API Connector migration, the successful deployment explicitly included DataStreamTemplate along with kit-component, source, bundle, mapping, and related object metadata.
What permission is required to access DataStreamTemplate metadata?
The Salesforce Customize Application permission is required.
Is streamType the same as refreshMode or refreshFrequency?
No. streamType selects the access or ingestion type, refreshFrequency specifies cadence, and refreshMode specifies the refresh mode. Additional timing fields and fullRefreshIntervalDays describe other parts of the refresh configuration.
Does sourceObjectName replace dataSourceObject?
No. sourceObjectName records the source object's name. dataSourceObject remains a required reference to the DSO, and dataSourceBundleDefinition remains a required reference to the bundle.