Mayor Bill de Blasio’s security detail got a workout Monday as they fended off police union protesters during his stroll from his favorite Park Slope coffee shop to the neighborhood YMCA.

“Mayor de Blasio: We’re at work, where are you?” chanted roughly 200 members of the Patrolmen’s Benevolent Association — which is feuding with the mayor over a contract that expired in July — while Hizzoner ate a pastry and sipped espresso with wife Chirlane McCray at Colson Patisserie.

“He’s eating a bowl of courage,” one demonstrator quipped as others shouted the mayor is a “liar” and taunted him to “come out and play.”

De Blasio has taken flack for taking his car from Gracie Mansion to Park Slope to hit the gym — and for starting his working day later than his predecessors.

He got to the 9th Street bakery around 7:45 a.m., and ate with McCray and spokesman Eric Phillips before heading to the YMCA on the other side of 6th Avenue at about 8:20 a.m. He left the gym at 10 a.m.

Cutting through the unruly crowd, de Blasio kept stone-faced as his security detail pressed in close. The bakery and Y are both on 9th Street, but de Blasio’s retinue first walked south on 6th Avenue before crossing and heading back up to 9th Street.

“He is no friend of labor and we will follow him until he negotiates,” PBA President Pat Lynch shouted at one point. “We went to Iowa. We’re out here in Park Slope. We’ll be in Manhattan. Where he is, we’ll be there ready to bargain, while he’s taking a break.”