Child protective services (CPS) have a duty to investigate this matter. There are a couple things that can happen: your children may be removed from the home and placed in foster care or place the children immediately with a family member pending an investigation. This differs from county to county.
That said, failing a drug test most every time is sufficient evidence for a Department of Social Service's finding of neglect. However, a one-time failure does not have to be the nail in the coffin. Even if your CPS or DSS matter is deemed as 'neglect', you can still regain full custody of your children and have CPS/DSS phased out of your home life. Complying with the case plan set out by your case worker, passing all future random drug tests and completing all treatment recommendations is the sure-fire way to regain control and custody of your child.
Completing the case plan can take months and cost money. Be prepared for the long haul to prove to the court that you will do whatever necessary to regain custody.
Sign up to receive a 5-part series of useful information and advice about child custody law.