Scenario – Complex batch scheduling
In this scenario, the customer has enterprise processes that span multiple systems. The job is initiated in legacy systems that must be completed before Dynamics 365 runs subsequent batch jobs. Multiple batch jobs in Dynamics 365 need to run, but they can’t overlap.
Patterns
When you’re building a centralized batch control system to orchestrate external systems (such as Logic Apps or Power Automate), the patterns (best practices) that you should follow are to:
- Call the needed system to generate the batch task. For Dynamics 365, the system should call a custom service to create a non-recurring batch task.
- Wait/listen for batch completion. For Dynamics 365, batch business events are available (a poll for finished status is an alternative).
- Trigger the subsequent task.
Further information
Finance and operations apps only handle batch task dependencies within a single batch job; they’re not designed to orchestrate external systems.
If you can reasonably schedule based on time, it would be a simpler approach.
Anti-pattern
In this scenario, an anti-pattern (pitfall) would be to schedule batch jobs for external systems in finance and operations apps.