---
schema_version: "1"
id: d3855241c68d19b8cd268efef6283e39e915d2f586f2f0f17fffcc7925f8ac79
title: BatchProcessJobDefinition
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_batchprocessjobdefinition.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_batchprocessjobdefinition.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 515e4c3d88bc3dfd9349aa1997be8cb6bab30afbb5c42d2c37c6ab4f83e7497f
description: Represents the details of a Batch Management job definition.
---
# BatchProcessJobDefinition

Represents the details of a Batch Management job definition.

This type extends the Metadata metadata type and inherits its fullName field.

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

## File Suffix and Directory Location

BatchProcessJobDefinition components have the suffix .batchProcessJobDefinition and are stored in the batchProcessJobDefinitions folder.

## Version

BatchProcessJobDefinition components are available in API version 51.0 and later.

## Special Access Rules

To know the products and user permissions needed to access this type, See [Supported Editions and Permissions for Batch Management](https://help.salesforce.com/s/articleView?id=ind.concept_batch_management_editions.htm&language=en_US).

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d185638e105">Field Name</th>

              <th class="featureTableHeader  " id="d185638e108">Field Type</th>

              <th class="featureTableHeader  " id="d185638e111">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">batchSize</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">integer</td>

              <td class="entry" headers="d185638e111" data-title="Description">Required. Number of records that each Batch Management job can process. Flow
                type Batch Management jobs can process up to 2000 records and Loyalty Program
                Process type Batch Management jobs can process up to 250 records.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">dataSource</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">
                <a class="xref" href="#batchdatasourceID">BatchDataSource</a>[]
              </td>

              <td class="entry" headers="d185638e111" data-title="Description">Required. Source of information whose records must be processed by the Batch
                Management job.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">Description of the Batch Management job, up to 255 characters.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">executionProcessApiName</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">API name of process that must be executed by the Batch Management job. This
                field is available in API version 55.0 and later.<ul class="ul bulletList">
                  <li class="li">If the batch job’s type is Flow, enter the API name of an active flow that the
                    batch job must execute.</li>

                  <li class="li">If the batch job’s type is Loyalty Program Process, enter:<ul class="ul bulletList">
                      <li class="li">Transaction_Journals if you want the batch job to process Transaction
                        Journal records by applying the applicable active loyalty program process of
                        the type TransactionJournal.</li>

                      <li class="li">API name of an active loyalty process of the type TierProcessing if you
                        want the batch job to run the loyalty program process to assess the tier of
                        eligible members. The API name consists of the name of the process, the
                        process type, and the name of the loyalty program separated by two
                        consecutive underscores. For example, the process API name is <samp class="codeph nolang">Update Member Tier__TierProcessing__Inner
                          Circle</samp> if the process name is Update Member Tier, the process
                        type is TierProcessing, and the loyalty program name is Inner Circle.</li>

                    </ul>
                  </li>

                </ul>
                <p class="p">You can use database-based APEX classes that let you use&nbsp;flex queues&nbsp;in the
                  Batch Management job, allowing to place more than 5 jobs in a queue. This
                  functionality is applicable to all Industry Clouds that use managed packages. See
                  <a class="xref" href="https://help.salesforce.com/s/articleView?id=platform.code_apex_flex_queue.htm&amp;type=5&amp;language=en_US" target="_blank" title="HTML (New Window)">Apex
                    Flex Queue</a>.
                </p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">flowApiName</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">API name of an active flow process that must be executed by the Batch
                Management job.<p class="p">You can either specify the flow API name in the <samp class="codeph nolang">executionProcessApiName</samp> field or in the <samp class="codeph nolang">flowApiName</samp> field.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">flowInputVariable</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">Input variable of associated flow that is used by the batch job to uniquely
                identify records.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">masterLabel</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">Required. Name of the Batch Management job, up to 80 characters.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">processGroup</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">Required. Name of the group for which the Batch Management job processes
                records. </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">retryCount</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">integer</td>

              <td class="entry" headers="d185638e111" data-title="Description">Required. Number of times this Batch Management job must be rerun in case it
                fails. The maximum retry count is 3. Valid values are 1–3.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">retryInterval</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">integer</td>

              <td class="entry" headers="d185638e111" data-title="Description">Required. Number of milliseconds after which the Batch Management job must be
                rerun in case it fails. Valid values are 1,000–10,000. </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">status</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e111" data-title="Description">Indicates the status of the Batch Management job. Valid values are <samp class="codeph nolang">Active</samp> and <samp class="codeph nolang">Inactive</samp>.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e105" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d185638e108" data-title="Field Type">string (enumeration of type string)</td>

              <td class="entry" headers="d185638e111" data-title="Description">The type of process that the Batch Management job must execute. This field is
                available in API version 55.0 and later. Valid values are:<a name="ul_xv4_wfr_y3c"><!-- --></a>
                <ul class="ul bulletList" id="ul_xv4_wfr_y3c">
                  <li class="li"><samp class="codeph nolang">BulkUpdate</samp></li>

                  <li class="li">
                    <samp class="codeph nolang">Calc</samp>—Data Processing Engine
                  </li>

                  <li class="li"><samp class="codeph nolang">ConsumptionOveragesCalculation</samp></li>

                  <li class="li"><samp class="codeph nolang">DecisionTableRefresh</samp></li>

                  <li class="li"><samp class="codeph nolang">DeepCloneSalesAgreement</samp></li>

                  <li class="li"><samp class="codeph nolang">FlattenAccountIOUHierarchyBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">Flow</samp></li>

                  <li class="li"><samp class="codeph nolang">EnergyUseRecordCreationBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">EntitlementCreationBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">HighScaleBreProcess</samp></li>

                  <li class="li"><samp class="codeph nolang">IndustriesLSCommercial</samp></li>

                  <li class="li"><samp class="codeph nolang">InvoiceDTPRunBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">InvoiceRecoveryRunBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">InvoiceRunBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">LifeSciProviderActivityGoalSharingBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">LoyaltyProgramProcess</samp></li>

                  <li class="li"><samp class="codeph nolang">NetUnitRateCalculation</samp></li>

                  <li class="li"><samp class="codeph nolang">NextGenCommitmentBatchProcessingJob</samp></li>

                  <li class="li"><samp class="codeph nolang">ManagerProvisioning</samp></li>

                  <li class="li"><samp class="codeph nolang">PbbToOptyConversion</samp></li>

                  <li class="li"><samp class="codeph nolang">ProductCatalogCacheRefresh</samp></li>

                  <li class="li"><samp class="codeph nolang">PromotionChannelPropagationBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">RatableSummaryCreation</samp></li>

                  <li class="li"><samp class="codeph nolang">ServiceProcess</samp></li>

                  <li class="li"><samp class="codeph nolang">StoreAssortmentPropagationBatchJob</samp></li>

                  <li class="li"><samp class="codeph nolang">SummaryCreation</samp></li>

                  <li class="li"><samp class="codeph nolang">WorkDotComToHRManagerProvisioning</samp></li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## BatchDataSource

Represents the source of information whose records must be processed by the Batch Management job.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d185638e470">Field Name</th>

              <th class="featureTableHeader  " id="d185638e473">Field Type</th>

              <th class="featureTableHeader  " id="d185638e476">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name"><span class="keyword parmname">condition</span></td>

              <td class="entry" headers="d185638e473" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e476" data-title="Description">Required. Criteria defined to filter the records.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name"><span class="keyword parmname">criteria</span></td>

              <td class="entry" headers="d185638e473" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e476" data-title="Description">Type of filter criteria that’s used to filter records for processing.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name"><span class="keyword parmname">dataSourceType</span></td>

              <td class="entry" headers="d185638e473" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e476" data-title="Description">Type of data source that's used to create the batch job definition. Valid
                values are:<ul class="ul bulletList">
                  <li class="li">SingleSobject</li>

                  <li class="li">MultiSobject</li>

                  <li class="li">File—Available in API version 67.0 and later.</li>

                </ul>
                <p class="p">Available in API version 64.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name"><span class="keyword parmname">filters</span></td>

              <td class="entry" headers="d185638e473" data-title="Field Type">
                <a class="xref" href="#batchdatasrcfiltercriteriaID">BatchDataSrcFilterCriteria</a>[]
              </td>

              <td class="entry" headers="d185638e476" data-title="Description">Filter criterion that decides which records must be processed by the Batch
                Management job.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name">orderFields</td>

              <td class="entry" headers="d185638e473" data-title="Field Type"><a class="xref" href="#BatchDataSourceOrderField">BatchDataSourceOrderField</a></td>

              <td class="entry" headers="d185638e476" data-title="Description">Fields that are used to order the records before the records are added to a
                batch in a job.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name"><span class="keyword parmname">sourceObject</span></td>

              <td class="entry" headers="d185638e473" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e476" data-title="Description">Required. API name of an object whose records must be processed by the batch
                job. <p class="p">If the batch job type is Loyalty Program Process, the source object must
                  be:</p>
                <ul class="ul bulletList">
                  <li class="li">TransactionJournal if the batch job is used to process transaction journals by
                    applying the applicable loyalty program process.</li>

                  <li class="li">An object that stores the details of loyalty program members whose tier must
                    be assessed by the loyalty program process specified in the
                    executionProcessApiName field.</li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e470" data-title="Field Name"><span class="keyword parmname">sourceObjectField</span></td>

              <td class="entry" headers="d185638e473" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e476" data-title="Description">API name of the source object field that uniquely identifies records for which
                the batch job is executed. This field is available in API version 57.0 and
                later.<p class="p">This field is only applicable when the batch job’s type is Loyalty
                  Program Process and a TierProcess type active loyalty program process is specified
                  in the <span class="keyword parmname">executionProcessApiName</span> field. Specify the API name of
                  a field that is a lookup to the LoyaltyProgramMember object and uniquely
                  identifies the members whose tier must be assessed.</p>
              </td>

            </tr>

          </tbody>

        </table>

## BatchDataSrcFilterCriteria

Represents the filter conditions that decide which records must be processed by the Batch Management job.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d185638e643">Field Name</th>

              <th class="featureTableHeader  " id="d185638e646">Field Type</th>

              <th class="featureTableHeader  " id="d185638e649">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name">domainObjectName</td>

              <td class="entry" headers="d185638e646" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e649" data-title="Description">Name of the object the field is associated with. Available in API version 64.0
                and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">dynamicValueType</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e649" data-title="Description">Data type of the input variable used as a filter. </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">fieldName</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e649" data-title="Description">Required. Name of the field that must be used to filter records.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">fieldPath</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e649" data-title="Description">Stores the path to a field in the object. Available in API version 64.0 and
                later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">fieldValue</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">string</td>

              <td class="entry" headers="d185638e649" data-title="Description">Required. Value of the field that must be filtered. Specify the field if
                <samp class="codeph nolang">dynamicValue</samp> is set to <samp class="codeph nolang">false</samp>.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">dynamicValue</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">boolean</td>

              <td class="entry" headers="d185638e649" data-title="Description">Required. Indicates whether the filter criteria is dynamic.</td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">operator</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">string <span class="ph" id="enum_link_component"><a name="enum_link_component"><!-- --></a>(enumeration of type string)</span>
              </td>

              <td class="entry" headers="d185638e649" data-title="Description">Required. Operator that is specified in the filter criteria. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">equals</samp></li>

                  <li class="li"><samp class="codeph nolang">excludes</samp></li>

                  <li class="li"><samp class="codeph nolang">greaterThan</samp></li>

                  <li class="li"><samp class="codeph nolang">greaterThanOrEqualTo</samp></li>

                  <li class="li"><samp class="codeph nolang">in</samp></li>

                  <li class="li"><samp class="codeph nolang">includes</samp></li>

                  <li class="li"><samp class="codeph nolang">lessThan</samp></li>

                  <li class="li"><samp class="codeph nolang">LessThanOrEqualTo</samp></li>

                  <li class="li"><samp class="codeph nolang">GreaterOrEqual</samp></li>

                  <li class="li"><samp class="codeph nolang">like</samp></li>

                  <li class="li"><samp class="codeph nolang">notEquals</samp></li>

                  <li class="li"><samp class="codeph nolang">notIn</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d185638e643" data-title="Field Name"><span class="keyword parmname">sequenceNo</span></td>

              <td class="entry" headers="d185638e646" data-title="Field Type">integer</td>

              <td class="entry" headers="d185638e649" data-title="Description">Required. Sequence number used to refer the criteria in a filter.</td>

            </tr>

          </tbody>

        </table>

## BatchDataSourceOrderField

Represents the fields that are used to group data.

## Fields

| Field Name | Field Type | Description |
| --- | --- | --- |
| domainObjectName | string | Required. Name of the object the field is associated with. Available in API version 64.0 and later. |
| fieldName | string | Required. Name of the field that must be used to filter records. Available in API version 64.0 and later. |
| fieldPath | string | Required. Stores the path to a field in the object. Available in API version 64.0 and later. |

## Declarative Metadata Sample Definition

The following is an example of a BatchProcessJobDefinition component.

<?xml version="1.0" encoding="UTF-8"?>
<BatchProcessJobDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
   <batchSize\>10</batchSize\>
   <dataSource\>
      <condition\>1</condition\>
      <criteria\>all</criteria\>
      <filters\>
         <dynamicValue\>false</dynamicValue\>
         <dynamicValueType\>string</dynamicValueType\>
         <fieldName\>Name</fieldName\>
         <fieldValue\>abcd</fieldValue\>
         <operator\>equals</operator\>
         <sequenceNo\>1</sequenceNo\>
      </filters\>
      <sourceObject\>Account</sourceObject\>
   </dataSource\>
   <flowApiName\>Flow1</flowApiName\>
   <flowInputVariable\>recordId</flowInputVariable\>
   <masterLabel\>BatchJob1</masterLabel\>
   <processGroup\>Loyalty</processGroup\>
   <retryCount\>2</retryCount\>
   <retryInterval\>1000</retryInterval\>
   <status\>Inactive</status\>
   <description\>test</description\>
   <type\>Flow</type\>
   <executionProcessApiName\>testFlow</executionProcessApiName\>
</BatchProcessJobDefinition\>

The following is an example of a Flow object used in Metadata API.

<?xml version="1.0" encoding="UTF-8"?>
<!--
   ~ Copyright 2020 Salesforce, Inc.
   ~ All Rights Reserved
   ~ Company Confidential
-->
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
   <apiVersion\>51.0</apiVersion\>
   <interviewLabel\>Flow1 {!$Flow.CurrentDateTime}</interviewLabel\>
   <label\>Flow1</label\>
   <processMetadataValues\>
      <name\>BuilderType</name\>
      <value\>
         <stringValue\>LightningFlowBuilder</stringValue\>
      </value\>
   </processMetadataValues\>
   <processMetadataValues\>
      <name\>OriginBuilderType</name\>
      <value\>
         <stringValue\>LightningFlowBuilder</stringValue\>
      </value\>
   </processMetadataValues\>
   <processType\>AutoLaunchedFlow</processType\>
   <recordLookups\>
      <name\>getAcc</name\>
      <label\>getAcc</label\>
      <locationX\>614</locationX\>
      <locationY\>465</locationY\>
      <assignNullValuesIfNoRecordsFound\>false</assignNullValuesIfNoRecordsFound\>
      <filterLogic\>and</filterLogic\>
      <filters\>
         <field\>Id</field\>
         <operator\>EqualTo</operator\>
         <value\>
            <elementReference\>recordId</elementReference\>
         </value\>
      </filters\>
      <getFirstRecordOnly\>true</getFirstRecordOnly\>
      <object\>Account</object\>
      <storeOutputAutomatically\>true</storeOutputAutomatically\>
   </recordLookups\>
   <start\>
      <locationX\>73</locationX\>
      <locationY\>213</locationY\>
      <connector\>
         <targetReference\>getAcc</targetReference\>
      </connector\>
   </start\>
   <status\>Draft</status\>
   <variables\>
      <name\>recordId</name\>
      <dataType\>String</dataType\>
      <isCollection\>false</isCollection\>
      <isInput\>true</isInput\>
      <isOutput\>false</isOutput\>
   </variables\>
</Flow\>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
   <types\>
      <members\>\*</members\>
      <name\>BatchProcessJobDefinition</name\>
   </types\>
   <types\>
      <members\>Flow1</members\>
      <name\>Flow</name\>
   </types\>
   <version\>51.0</version\>
</Package\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").