---
title: 'Scheduled reconciliation'
description: 'Run bounded recurring batches, preserve a business checkpoint and verify recovery after missed or partial runs.'
category: 'Guides'
---

Use this pattern for a recurring import or cross-system check that must resume safely after a missed or partial run. The schedule creates runs; your handlers read and update business data. You need a durable business checkpoint, idempotent target writes and a continuously available application worker.

## Start with a bounded batch

Choose a small source window, such as customer profiles changed since a stored checkpoint. Implement three stages:

| Stage | Responsibility | Completion evidence |
| --- | --- | --- |
| Read source window | Capture a bounded range and batch reference | Stable range/record identifiers for retries |
| Apply updates | Write using stable per-record operation keys | Confirmed target outcomes, including existing writes |
| Record result | Save the summary and advance the business checkpoint | Checkpoint advances only after required writes succeed |

Store the checkpoint in your business database, not only in pipeline history. If the update stage partially succeeds, retry the same batch safely before advancing the cursor. Keep any business exceptions visible rather than calling an incomplete import successful.

## Define the schedule

1. Register the handlers on an application worker and verify readiness.
2. Register a named schedule from a controlled producer/deployment path using [.NET scheduling](https://pipelogiq.com/docs-next/net/schedules/) or the runnable [Java schedule recipes](https://pipelogiq.com/docs-next/java/schedules/).
3. Start with a modest interval or five-field cron, an explicit IANA time zone, `Skip` overlap and no jitter while checking behavior. Review the [overlap and catch-up contract](https://pipelogiq.com/docs-next/schedules/) before choosing alternatives. Queue is not a verified serialization mechanism.
4. Trigger one test batch manually and follow its pipeline to completion.
5. Leave the worker running and verify one automatic tick separately. A manual trigger does not prove automatic overlap, catch-up or worker-availability behavior.

The orchestration worker, schedule definition and business worker are separate requirements. An online worker for the application does not prove it registers every required handler.

## Keep a worker available

Read the schedule history, not just its next-run timestamp. A `Skipped/NoWorker` row is not a failed or completed pipeline: no pipeline was created for that tick. Restore the worker, inspect the business backlog and decide whether a controlled manual run is needed.

Do not rely on catch-up to enumerate every missed business record after an outage. Its history is bounded. The handler's durable checkpoint/backlog is what lets a later run reconcile gaps.

## Make the result useful to business users

Expose the batch reference, time window, records examined, records updated and exceptions requiring attention. Keep sensitive individual records in their authoritative business system.

Support should distinguish three outcomes: no run was created; a run stopped at a stage; or a run completed with a recorded business exception. Developers can use the same run's attempts and logs for deeper diagnosis.

## Test before scheduling production data

| Test | Required observation |
| --- | --- |
| Run the same batch twice | No duplicate target records or effects |
| Stop the application worker before an automatic tick | History records the actual skipped outcome |
| Fail halfway through target updates | Retry reconciles existing writes; checkpoint does not skip unfinished records |
| Use the deployment's exact cron/time zone | Expected behavior at daylight-saving transitions |
| Trigger manually, then wait for an automatic tick | Different trigger semantics are understood; business locking handles any unwanted overlap |

Back up both Pipelogiq's database and the business checkpoint. Rehearse recovery with the application worker stopped, then reconcile data before allowing new automatic writes. See [deployment](https://pipelogiq.com/docs-next/deployment/).
