Power Automate bulk import fails when triggering conditional workflows

I’m using Power Automate to bulk import 5,000+ lead records into Dynamics 365 Sales (version 9.1), and the flow keeps failing halfway through. Each lead record triggers a conditional workflow that assigns leads based on territory rules and sends notification emails.

The flow runs fine for the first 800-1,000 records, then I get this error:


ActionFailed: The execution of template action 'Create_Lead' failed
Status: 429 TooManyRequests
Retry-After: 45 seconds

When I check the lead records, about 60% imported successfully, but 40% are missing with no error logs in Dynamics. The partial data migration is causing major issues because our sales team doesn’t know which leads are actually in the system. I’ve tried adding delay actions between create operations, but that makes the import take forever. How do I handle Power Automate error handling for bulk imports with parallel branch workflows?

I’ll address all three critical aspects of your bulk import challenge:

1. Power Automate Error Handling Implementation:

First, restructure your flow to use proper error handling patterns. Add a ‘Scope’ action to wrap your lead creation logic, then add a parallel ‘Configure run after’ path that only runs on failure:

// Scope: Create Lead with Workflows
// Configure run after settings:
{
  "runAfter": {},
  "type": "Scope",
  "actions": {
    "Create_Lead": { "type": "ApiConnection" },
    "Trigger_Territory_Assignment": { "type": "Workflow" }
  }
}

Add error capture:

// Parallel branch - runs on failure
"Log_Failed_Record": {
  "runAfter": { "Create_Lead_Scope": ["Failed", "TimedOut"] },
  "type": "Compose",
  "inputs": {
    "LeadEmail": "@{items('Apply_to_each')?['email']}",
    "ErrorCode": "@{outputs('Create_Lead')?['statusCode']}",
    "ErrorMessage": "@{body('Create_Lead')?['error']?['message']}"
  }
}

2. Parallel Branch Design for Scalability:

The key is separating immediate import from deferred workflow processing:

  • Flow 1 (Import Only): Handles lead creation without triggering workflows

    • Set concurrency control on ‘Apply to each’ to 4 (sweet spot for Dataverse)
    • Disable all real-time workflows on Lead entity before starting
    • Add retry policy: exponential with 4 retries, starting at 10 seconds
  • Flow 2 (Workflow Processor): Scheduled every 2 minutes

    • Queries leads created in last 5 minutes with status=‘New’ AND assigned=null
    • Processes territory assignment in batches of 50
    • Updates lead status to ‘Processed’ after workflow completes

This architecture prevents the cascading API calls that cause throttling.

3. Error Logging for Failed Records:

Implement a comprehensive logging mechanism:

  • Create a custom Dataverse table ‘Import Error Log’ with fields:

    • Source Record ID (text)
    • Error Type (option set: Throttling, Validation, Timeout)
    • Error Details (multiline text)
    • Retry Count (number)
    • Import Batch ID (GUID)
  • In your flow, after each failed create operation, insert a record into this table

  • Create a companion flow that runs every 10 minutes, queries error logs with RetryCount < 3, and reattempts the import

  • For 429 errors specifically, respect the Retry-After header value

Immediate Fix for Your Current Situation:

  1. Export the list of successfully imported leads (800-1,000 records)
  2. Use Excel to identify the missing 40% from your source data
  3. Create a new CSV with only the failed records
  4. Temporarily disable territory assignment workflows
  5. Import the failed records using the updated flow with concurrency=1
  6. Re-enable workflows and let Flow 2 process assignments

Additional Recommendations:

  • Use the Dataverse ‘CreateMultiple’ action (available in 9.1) instead of individual creates - it batches up to 1,000 records in a single API call
  • Monitor your flow runs in the Power Automate admin center to track API consumption
  • Consider using the ‘Postpone’ pattern for workflows - store workflow parameters in a queue table and process them asynchronously

This approach has successfully handled imports of 50,000+ records for multiple clients without hitting throttling limits.


This draft is based on general Microsoft Dynamics 365 Sales knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

The 429 error means you’re hitting API throttling limits. Power Automate has service limits for Dataverse connections - 6,000 requests per 5 minutes per user. When your conditional workflows fire for each lead, they multiply the API calls. You need to implement batch processing with proper retry logic.

Add a ‘Configure run after’ setting on your Create Lead action to handle failures gracefully. Set it to run even if the previous action fails, times out, or is skipped. Then add a condition to check the status code and log failures to a SharePoint list or Excel file. This gives you visibility into which records failed without stopping the entire flow.

Your parallel branch design is the issue. When multiple workflows trigger simultaneously for each imported lead, you’re creating a cascading effect that overwhelms the API limits. Instead of triggering workflows during import, disable the workflows temporarily, complete the bulk import, then enable workflows and use a scheduled flow to process territory assignments in batches of 100 records every 5 minutes. This separates data import from business logic execution.

Disabling workflows isn’t an option because we need real-time lead assignment for the sales team. Is there a way to implement retry logic within Power Automate itself? I looked at the ‘Configure run after’ but couldn’t figure out how to retry the same record after the 429 error clears.

Use the ‘Apply to each’ control with concurrency control set to 1 or 2 maximum. This throttles your flow to process leads sequentially or in small batches, preventing the API overload. Also implement exponential backoff - when you get a 429 error, use the Delay action with the retry-after value from the error response before attempting the next batch.