Just went through this over the past few days.
Most likely a fuel related issue that you need to narrow down. If it is intermittent it will be a lot harder to solve the problem without just replacing all the potential suspect parts (although the list of issues that can occur intermittent is smaller IMHO). One thing to consider; is it related to the level of the fuel tank?
You need a fuel pressure tester. I picked one up at Harbor Freight for $14.00.
Best to follow Bentley's... but if you don't have one.
You need to test the fuel pressure on the supply side ahead of the fuel rail as well as the return side. Your trying to find out if the following are working as they should.
1.The fuel pump assembly
2. The fuel check valve
3. The fuel pressure regulator
or
If there is a fuel leak in a line or an injector.
Depending on where you place the gauge and the result of pressurizing the system, it points to the problem area. Example : if the pressure falls off with it installed at the fuel pump, its the check valve. If the pressure is fine there and drops off under the hood, there is a leak between the pump and the line under the hood.
No shortcut to diagnosis the issue.
Good luck
Don
1994 530it 147,000
1983 300SD 278,000 (running soybean oil)
1980 300TD 135,000 (running soybean oil)