There are several things that can be spilled on carpet that will damage or stain it. Luckily, flour isn't one of these. In fact it is used in some cases to help absorb other types of spills like oil. If you do spill flour on your carpet, it is not difficult to remove it, provided you don't allow foot traffic on top of the spill. You can also remove flour used to absorb an oil stain without much difficulty.
Replace the bag in your vacuum to ensure maximum suction power from the machine.
Scrape the flour with a bristle brush if it was used to absorb another spill like oil. This will loosen the flour so that it can be vacuumed up. Brush with an upward motion instead of scrubbing the brush into the flooring.
Turn the vacuum on and use the hose attachment to suck up most of the surface flour.
Turn the vacuum control to the setting for hardwood floors. This will keep the brushes from possibly forcing the flour into the carpet fibers.
Lower the vacuum to its lowest setting, which is used for short carpets. This will provide more suction.
Run the vacuum over the spill area several times. You might even try leaving it in the same spot for several seconds.