Process batches on a schedule with watermark tracking
Recipe ToolsMarketingDatabaseUtilities
What it does
When a scheduled time arrives, this automation reads a watermark from the Lookup Table to find where the last batch ended. It pulls data in batches, filters it, logs the results, and updates the watermark so the next run continues from that point.
Who it's for
Operations teams who need to process large data sets on a schedule without manual intervention.
How teams use this
Process daily customer records
Run the batch every morning to pull new customers from the source system, filter by region, and sync them to the CRM. The watermark ensures no customer is processed twice.
Archive old support tickets
Adjust the schedule to run nightly and replace the filter to find closed tickets older than 90 days. Send them to cold storage instead of the active system.
Add approval before batch runs
Include a condition to check if the batch size exceeds a threshold, and only proceed if someone approves it in Slack. This prevents large unexpected changes.
How it works
- Run on a set schedule. The automation starts every 5 minutes. Change the scheduler to match how often batches need to be processed.
- Read the watermark position. Look up the last position stored in the Lookup Table so the batch knows where to start pulling data from the source.
- Collect and filter the batch. Pull data into a collection, filter it for the use case, and store it for processing in this run.
- Update the watermark. Store the end position in the Lookup Table so the next batch run starts from this point, not the beginning.