Adopt a Spring scheduled job
This pattern moves operational control from @Scheduled to Synapsys while keeping
the existing service method intact. It is useful when a team needs an on-demand job,
execution history, and visible output instead of an automatic fixed schedule.
Before
@Component
public class InvoiceImportSchedule {
private final InvoiceService invoices;
@Scheduled(cron = "0 0 2 * * *")
public void importInvoices() {
invoices.importNewInvoices();
}
}
Add the starter and connection
Install the Spring Boot starter, then inject the Core URL and worker token:
synapsys:
core-url: ${SYNAPSYS_CORE_URL}
core-token: ${SYNAPSYS_CORE_TOKEN}
After
@SynapsysProcess(name = "invoice-import")
public class InvoiceImportProcess extends AbstractProgressiveProcess {
private final InvoiceService invoices;
public InvoiceImportProcess(InvoiceService invoices) {
this.invoices = invoices;
}
@Override
protected void run() {
invoices.importNewInvoices();
}
}
The business service did not change. Remove the @Scheduled entry—or disable it in
the same release—so the old scheduler and Synapsys cannot run the job concurrently.
Roll it out safely
- Deploy to a non-production environment and confirm the process appears as
idle. - Start it from Core and verify the result and execution output.
- Confirm a second click or repeated heartbeat does not create a duplicate run.
- Deploy the change that disables the old schedule and enables the Synapsys process together.
- If the job is long-running, add
checkCancelled()between batches before making Stop available to operators.
Synapsys does not provide cron scheduling. If the job must still run on a clock, keep your scheduler as the caller or use your automation platform to invoke the control API under an operator integration designed for that purpose.