My ducks free range during the day and I pen them at night. They will not go inside until dusk unless i take them by surprise and pick up one and put him in --a specific one -- the boss duck then rounds up the other and they follow inside. But the duck I pick up is too wily to pull that trick on more than once in a blue moon!! So I usually go out an hour before dark, hose down the patio where they like to make their little messes, fill up their water tubs and food dish, and leave them to it.
I then drive to my son's 15 minutes away, where his ducks are much better behaved. They will go inside any time from mid afternoon, if I go through their routine of filling the water tubs, covering their wading pool and filling their food saucer. We are currently introducing a new female to the flock and so I have to pick up the drake and put him in his side of the pen [he's completely docile about that] and then the new little duck comes in like the good girl she is.
If by chance I am late -- as I have once been -- the original three are in the pen and the new little girl [a muscovy] is sitting on the roof waiting for the drake to be moved.
Once my son's ducks are tucked up for the night, I go home and if its twilight my ducks are in their pen and I close the door. If i am early, they are usually wending their way slowly to their pen. They have to stop off and dabble in the water from hosing down the patio. But by that time, boss duck is good about rounding them up and marching them in when I say go in.
Tonight, I got back and it was twilight but I could hear an owl in a tree in my front garden. I was glad the ducks were being good and inside where they should be.
Our main predators are raccoons, owls and hawks. There are domestic cats around too, but I think they are too timid to challenge a duck in full attack mode. There is always the risk of a fox or a skunk too, but I haven't seen them around my garden [yet]. So I won't leave the pen open after dark.