If this happens, call your vet as soon as possible, explain what you saw, and make an appointment to bring your dog or puppy in for treatment very soon. (If you see small, rice-size worms in your dog's stool, rather than roundworms these could be a common parasite called tapeworms that are carried by fleas.
More useful articles on a similar topic 👇
Can dogs throw up intestinal worms?Can you have Threadworms without symptoms?