The function of a pyloric stomach in a starfish is to receive partially digested food from the cardiac stomach and pass it either to the pyloric ceca for further digestion or to the rectum for excretion. It connects all the other parts of the digestive system together.
According to A Snail's Odyssey, the pyloric stomach is located above the starfish's cardiac stomach, which itself is located directly above the mouth. In many cases, the cardiac stomach can actually be turned inside out to make contact with the prey and begin digestion outside of the body, such as when a starfish is prying open a clam or other bivalve and cannot extract the meat as a solid piece. The food is passed to the pyloric stomach once it is partially liquefied. Larger starfish with more than five arms often ingest prey items whole rather than inverting their cardiac stomachs.
After food is further digested in the pyloric stomach, it travels down tubes that extend from the pyloric stomach at the center of the body, with two tubes down each arm. The pyloric ceca are a series of small pouches branching off the tubes. These pyloric ceca are lined with glands that produce digestive enzymes. These enzymes complete the digestion begun in the cardiac stomach.