SCHED_E_TOO_MANY_NODES (0x8004131D) fix for Task Scheduler
Task Scheduler throws 0x8004131D when your exported XML has too many repeated event triggers. Trim the duplicates or switch to a custom trigger.
When this error hits
You're trying to import or create a scheduled task in Windows Task Scheduler — maybe you exported a task from one machine and are bringing it to another. Or you built a custom XML with multiple event triggers. The error pops up as SCHED_E_TOO_MANY_NODES (0x8004131D) with the message "The task XML contains too many nodes of the same type."
I've seen this most often when someone exports a task that has been edited multiple times — each edit can leave a ghost trigger. Had a client last month whose backup task had 14 identical "On event" triggers because his admin kept re-saving the job. The import failed every time until I cleaned it.
What's actually happening
Task Scheduler has a hard limit on how many repeating XML nodes of the same type it will accept inside a single trigger. The exact limit varies by Windows version, but anything over 10-12 identical <EventTrigger> or <TimeTrigger> nodes will throw this error. It's not a bug — it's a safety cap so the scheduler doesn't choke on a runaway XML.
The fix: trim the duplicate triggers
- Export the task to XML — Right-click the task in Task Scheduler and select Export. Save it as a
.xmlfile. - Open the XML in Notepad++ or any text editor — Don't use the default Windows editor because you need to see line numbers and duplicate structures clearly.
- Look for duplicate trigger blocks — Search for
<Triggers>and then count the<EventTrigger>or<TimeTrigger>entries inside. If you see more than one with the same<Subscription>or<StartBoundary>, those are your problem. - Delete the extras — Remove all but one copy of each unique trigger. Keep only one instance of each
<EventTrigger>that fires on the same event. - Save the file — Then go back to Task Scheduler, click Import Task, and pick your cleaned XML.
- Test the task — Run it manually to make sure it still fires correctly.
If that doesn't work
Sometimes the XML is clean but the scheduler itself has cached garbage. Try this:
- Open an admin PowerShell and run
schtasks /query /vto see all tasks. If you see the corrupted task still listed, delete it withschtasks /delete /tn "TaskName" /f. - Restart the Task Scheduler service:
Restart-Service Schedulein PowerShell. - Rebuild the task from scratch instead of importing. Use the GUI to recreate the trigger manually — sometimes exporting and re-importing just propagates the same bug.
I've also seen this error when the XML has an empty <Triggers> tag or a malformed <Enabled> flag. Check for extra spaces or missing closing tags if the visuals look right but the import still fails.
Was this solution helpful?