Introduction
Power Automate is the backbone of process automation in Dynamics 365 CE. While simple flows are easy to build, real-world projects demand patterns that handle concurrency, error handling, and complex business logic.
Here are five proven patterns every CE consultant should know.
Pattern 1: Retry with Exponential Backoff
When calling external APIs or processing large datasets, transient failures are inevitable. Build resilience with a retry pattern.
Configure this in your HTTP action's settings:
{
"Retry_Policy": {
"type": "exponential",
"count": 3,
"interval": "PT5S",
"minimumInterval": "PT5S",
"maximumInterval": "PT1H"
}
}For Dataverse actions, wrap critical operations in a Do Until loop with a counter:
- Initialize a
retryCountvariable to 0 - Use Do Until with condition
retryCount >= 3 OR success == true - Add a Delay action with duration calculated as
mul(60, retryCount)seconds - Increment
retryCountafter each attempt
Pattern 2: Parent-Child Flow for Batch Processing
When you need to process hundreds of records — say, deactivating expired quotes — use a parent-child pattern to avoid timeouts.
Parent Flow (Scheduled):
- Query Dataverse for records to process
- Loop through results in batches of 50
- Call the child flow for each batch using Run a Child Flow
Child Flow (Instant):
- Accept a JSON array of record IDs
- Process each record with error handling
- Return a success/failure summary
This keeps each flow execution under the 30-minute timeout and makes debugging significantly easier.
Pattern 3: Approval with Escalation
Build robust approval workflows that don't get stuck when approvers are unavailable:
1. Send approval to primary approver
2. Add a parallel branch:
a. Wait for approval response
b. Add a Delay of 48 hours
3. If timeout branch completes first:
a. Send reminder to primary approver
b. Send escalation to manager
c. Wait for either response
4. Process the approval outcome
Pro Tip: Store approval status in a custom field on the record so users can see the current state directly in the model-driven app form.
Pattern 4: Change Detection with Trigger Conditions
Avoid unnecessary flow runs by using trigger conditions. Instead of triggering on every update, only fire when specific fields actually change.
In your When a row is modified trigger, add a trigger condition:
@not(equals(triggerOutputs()?['body/statuscode'], triggerOutputs()?['body/_previousstatecode_value']))
For more complex scenarios, maintain a "last processed" hash:
- Add a custom field
ce_processhashto your entity - In your flow, compute a hash of the relevant fields
- Compare with the stored hash — only proceed if different
- Update the hash after processing
This dramatically reduces flow runs and keeps you well within API limits.
Pattern 5: Error Handling and Notification
Every production flow should have comprehensive error handling:
Main Scope
├── [Your business logic actions]
│
Error Handler Scope (Run After: Main Scope has failed/timed out)
├── Get flow run URL
├── Compose error details:
│ - Flow name
│ - Run ID
│ - Error message
│ - Record ID/URL
│ - Timestamp
├── Create a record in a custom "Flow Errors" entity
└── Send Teams notification to admin channel
Structure every flow with a Scope for business logic and a parallel Scope for error handling configured to run after failure.
Bonus: Naming Conventions
Keep your flows maintainable with consistent naming:
| Type | Pattern | Example |
|------|---------|---------|
| Automated | [Entity] - [Trigger] - [Action] | Quote - On Expire - Deactivate |
| Scheduled | [Schedule] - [Entity] - [Action] | Daily - Lead - Score Update |
| Instant | [Entity] - [Action] - Manual | Case - Escalate - Manual |
| Child | Child - [Entity] - [Action] | Child - Contact - Sync to External |
Summary
These patterns form a solid foundation for production-grade Power Automate solutions in Dynamics 365 CE. Start with error handling (Pattern 5) on every flow, then layer in the others as your requirements demand.
The key takeaway: treat your flows like code — with structure, error handling, naming conventions, and documentation.