I assume you have a 400ISL; if you are a CAT engine the following partially applies.
A bit of my knowledge to add what has already been said......
Unfortunately the surge/limp mode (albeit temporary) can be caused by many engine parameters out of range. Typically a code will be set in the ECM/ECU. A reader is required to check for codes; I have not pulled codes for my ISL however there should be a log for active and historical codes.
Performing all the routine maintencance - fuel/oil filters, all level checks etc is a good start to eliminate any of those contributing to out of range sensor/switch. As mentioned shorts in sensors/switches or wiring harness/connectors will also cause the ECM to read/act on a false positive. These are sometimes intermittent faults - really difficult to troubleshoot.
One additional consideration - hose/connectors on engine air (filter/turbo/intercooler boots) should also be checked to make sure no leaks.
Having ECM/ECU checked for codes will zero you in on the contributing factor.
Hopefully someone with more knowledge of ISL ECM/ECU engine code reading/troubleshooting will chime in.....
Towr: 2007 Country Coach Allure 470 - 37 Sunset Bay Cummins 400 ISL, Coach #31563
Toad: 2016 F150 King Ranch - 3.5L EcoBoost 4x4 Supercrew (curb weight 4,775 lbs)
Toad: SOLD 2007 Jeep Grand Cherokee (yes, it has a Hemi) (curb weight 4,720 lbs)