BatchProcessJobDefinition defines a Batch Management job: which records it selects, which process handles them, and the batch size, retry, and activation settings. It represents the job definition, not an individual execution or its results.
The type setting determines how to interpret the processing target and record-identification fields. Flow-specific settings and loyalty-specific settings do not apply universally to every job type.
Key Elements
| Element | What the Element Controls |
|---|---|
type |
The process to execute. Documented values include Flow, LoyaltyProgramProcess, Calc for Data Processing Engine, BulkUpdate, DecisionTableRefresh, and ServiceProcess. Although exposed as a string, it has documented value constraints. |
executionProcessApiName, flowApiName
|
Identify an active flow for a Flow job. Either element can specify the flow. For loyalty jobs, executionProcessApiName instead uses the transaction-journal identifier or tier-assessment process name described below. |
flowInputVariable |
Names the associated flow input variable that the job uses to uniquely identify records. |
batchSize |
Required. The documented maximum is 2000 records for Flow jobs and 250 for LoyaltyProgramProcess jobs. |
retryCount, retryInterval
|
Both are required. retryCount accepts 1-3 retries after failure. retryInterval accepts 1000-10000 milliseconds between failure and rerun. |
status |
Accepts Active and Inactive. This is separate from the active status required for the referenced flow or loyalty process. |
masterLabel, description
|
masterLabel is required and allows up to 80 characters. The optional description allows up to 255 characters. |
processGroup |
Required. Names the group for which the job processes records. Its association with Group metadata does not establish group membership or record access. |
dataSource |
Required, repeatable structure containing the source object and record-selection configuration. |
sourceObject, sourceObjectField
|
Within dataSource, sourceObject is the required object API name. For loyalty tier assessment, sourceObjectField identifies a lookup to LoyaltyProgramMember that uniquely identifies the members to assess. |
condition, criteria
|
Within dataSource, condition is the required filtering expression. criteria identifies the type of filter criteria used for record selection. |
filters, sequenceNo, operator
|
filters contains individual comparisons. Each required sequenceNo identifies a comparison for use in filter logic, not processing priority. The required operator has case-sensitive allowed values. |
fieldValue, dynamicValue, isDynamicValue, dynamicValueType
|
Control literal versus dynamic filter values. fieldValue supplies the literal value when the dynamic-value flag is false. dynamicValueType describes the data type of an input variable used as a filter. The flag name differs between the Salesforce field table and the exposed schema. |
orderFields |
Orders records before they are added to a batch. Entries identify fields through domainObjectName, fieldName, and fieldPath. This does not establish execution order across batches. |
dataSourceType |
Selects the data-source type. The Salesforce field table lists SingleSobject and MultiSobject; the exposed schema lists SingleSobject, MultipleSobjects, and File. These differences must not be silently normalized. |
Behavior and Constraints
Flow execution. For type set to Flow, either executionProcessApiName or flowApiName identifies an active flow. Precedence is not documented when both contain different values. flowInputVariable names the flow input variable used to uniquely identify records.
Loyalty transaction journals. For a LoyaltyProgramProcess job that processes transaction journals, set executionProcessApiName to Transaction_Journals and dataSource.sourceObject to TransactionJournal. The job applies the applicable active loyalty program process of type TransactionJournal. The execution-process value does not name one specific loyalty process.
Loyalty tier assessment. For tier assessment, executionProcessApiName identifies an active TierProcessing process using the pattern process name__TierProcessing__loyalty program name. For example, Update Member Tier__TierProcessing__Inner Circle contains two consecutive underscores between each part. Preserve those separators.
In that tier-assessment configuration, sourceObject identifies the object holding the relevant member details. sourceObjectField identifies a lookup field to LoyaltyProgramMember that uniquely identifies the members whose tiers must be assessed. This field's applicability is specific to loyalty tier assessment, not all job types.
Activation and retries. The job's status is distinct from the requirement for an active referenced flow or loyalty process. The retry settings control reruns after failure; they do not define a recurring schedule. The documented batch-size limits of 2000 and 250 apply to Flow and Loyalty Program Process jobs respectively, not to every process type.
Record filtering. Each filter identifies a field through the required fieldName, with domainObjectName and fieldPath providing object and path information. Its sequenceNo lets filter logic refer to that comparison. It does not prioritize records or determine execution order.
Filters can compare literal or dynamic values. When the dynamic-value flag is false, fieldValue supplies the literal comparison value. dynamicValueType describes the data type of an input variable used as a filter.
The documented operator values are case-sensitive: equals, excludes, greaterThan, greaterThanOrEqualTo, in, includes, lessThan, LessThanOrEqualTo, GreaterOrEqual, like, notEquals, and notIn. Preserve the capitalization, including the capital initial letters in LessThanOrEqualTo and GreaterOrEqual.
Ordering. orderFields orders records before they enter a batch. It does not guarantee execution order between batches. Its entries use domainObjectName, fieldName, and fieldPath to identify the relevant fields.
Access. Availability depends on Batch Management's supported products, editions, and user permissions. The required processGroup identifies the group for which the job processes records, but that association alone does not grant membership or record access.
For Industry Clouds that use managed packages, Batch Management also supports database-based Apex classes with Apex Flex Queue, which allows more than five jobs to be queued. This capability does not establish an ApexClass reference element in BatchProcessJobDefinition.
Deployment and Retrieval
Components use the .batchProcessJobDefinition suffix and reside in the batchProcessJobDefinitions folder. The type inherits fullName from the base Metadata type; masterLabel supplies the job's display name.
The package.xml manifest supports * as the member value for BatchProcessJobDefinition. A manifest can include both the job definition and its referenced Flow component.
The dataSource, filters, and orderFields structures are parts of the job definition, not separately deployable components. Their object and field names still create dependencies on the corresponding objects and fields. For Flow jobs, the flow reference is another dependency; setting the job to Active does not replace the requirement that the referenced flow be active.
When constructing a definition or interpreting a retrieval, preserve the exact process identifiers, operator capitalization, and tier-process separators. Also account for the conflicting element names, data-source values, and ordering cardinality described below. In particular, do not replace MultiSobject with MultipleSobjects on the assumption that they are documented aliases.
Relationships
The processing target, source object, filters, ordering fields, and process group create distinct reference paths. Interpret each path in the context of type: executionProcessApiName is a Flow reference for Flow jobs, but loyalty jobs use the special identifiers described above.
References
-
CustomObject:sourceObjectwithindataSource;domainObjectNamewithinfiltersandorderFields. -
CustomField:sourceObjectFieldwithindataSource;fieldNamewithinfiltersandorderFields. -
Flow:executionProcessApiNameandflowApiNamefor Flow jobs. -
Group:processGroup. This association alone does not establish membership or record access.
Documentation Inconsistencies
-
Dynamic-value flag name: The exposed schema and Salesforce's declarative example use
dynamicValue, while the Salesforce field table calls the boolean flagisDynamicValue. Both descriptions concern whether a filter value is dynamic; the naming discrepancy matters when constructing the XML. -
Data-source values: The Salesforce field table lists
SingleSobjectandMultiSobject. The exposed schema instead listsSingleSobject,MultipleSobjects, andFile.MultiSobjectandMultipleSobjectsare different serialized spellings, not documented aliases. The schema also exposesrelatedSobjects, but its role is not sufficiently defined to infer multi-object processing behavior from that element alone. -
Ordering cardinality: The Salesforce field table presents
orderFieldsas a singularBatchDataSourceOrderField, while the exposed schema represents it as an array. -
Tier-process name: The
sourceObjectFielddescription calls the applicable loyalty process typeTierProcess, while theexecutionProcessApiNamedescription and composite-name format useTierProcessing.
Common Questions
Should I use flowApiName or executionProcessApiName for a Flow batch job?
Either element can identify the active flow. Precedence is not documented when both contain different values. flowInputVariable names the flow input variable used to uniquely identify records.
What values does a transaction-journal batch job need?
Use LoyaltyProgramProcess as the job type, Transaction_Journals as executionProcessApiName, and TransactionJournal as dataSource.sourceObject. The job applies the applicable active loyalty process of type TransactionJournal, rather than naming one specific process in the execution-process element.
Do retryCount and retryInterval schedule a recurring batch job?
No. They control reruns after failure. retryCount accepts 1-3, and retryInterval accepts 1000-10000 milliseconds.
Does orderFields guarantee the order in which batches execute?
No. It orders records before they are added to a batch. It does not establish execution order across batches. A filter's sequenceNo is also not an execution priority; it identifies a comparison for filter logic.
Can I retrieve all BatchProcessJobDefinition components with a wildcard?
Yes. The type supports * in the package.xml manifest. Components are stored in batchProcessJobDefinitions with the .batchProcessJobDefinition suffix.