Batch Action
The Batch action allows you to execute a batch process using the Wattyo Batch Manager. This action is ideal for processing large volumes of records or performing complex calculations in a scalable and efficient manner.

Key Features
- Supports scalable batch processing using Salesforce’s batch execution framework.
- Enables dynamic configuration of batch parameters, such as SOQL queries and execution modes.
- Provides flexibility to control batch size and thread usage for optimized performance.
Configuring a Batch Action
When adding a Batch action, the following fields must be configured:
1. Common Properties
- Label:
- A user-friendly name for the action, displayed in the process flow.
- Required field.
- Name:
- A unique identifier for the action, used internally.
- Required field.
2. Inputs
The inputs section defines the parameters required to execute the batch process. The following fields are available and required:
-
SOQL Query:
- The Salesforce Object Query Language (SOQL) query to select the records to be processed by the batch.
- Example:
SELECT Id, Name FROM Account WHERE Active__c = TRUE
.
-
Batch Class:
- Select the Apex class that implements the batch logic from the dropdown list.
- The selectable Apex clas are those that implements the interface
BatchableJob
. - Example:
BillingBatch
,ConsumptionValidationBatch
.
-
Threads Number:
- The number of parallel threads to use for batch execution.
- Example:
2
(uses two threads for concurrent processing).
-
Batch Size:
- Defines the number of records processed per batch execution.
- Example:
200
(processes 200 records at a time).
-
Execution Mode:
- Configures how the batch is executed:
- Standard: Executes the batch with the salesforce standar engine.
- High volume: Executes the batch with the wattyo batch engine.
- Configures how the batch is executed:
Usage Example
Scenario: Generating Billing Records
- SOQL Query:
SELECT Id FROM Account WHERE BillingStatus__c = 'Pending'
- Batch Class:
BillingBatch
- Threads Number:
3
- Batch Size:
500
- Execution Mode:
Standard
Steps:
- Add a Batch action to the process.
- Fill in the Label and Name fields.
- Define the SOQL Query to select the records for processing.
- Select the Batch Class (
BillingBatch
) from the dropdown. - Specify the Threads Number (
3
) and Batch Size (500
). - Set the Execution Mode to
Standard
for background processing. - Save the configuration and test the process.
Best Practices
- Use optimized SOQL queries to minimize resource consumption and avoid query limits.
- Test the selected batch class independently before integrating it into the process.
- Monitor batch execution through the Orchestrator Batch Tabs to ensure successful processing.