She was finishing her workout; he was just starting his.

An Upper West Side woman in post yoga, meditative bliss was allegedly rudely awoken by a maintenance worker masturbating next to her mat, a new lawsuit claims.

Keiko Herskovitz, a regular yogi at Equinox’s Pure Yoga on W. 77th Street, was in the corpse pose called shavasana, laying down with her eyes closed on Jan. 26, when she “heard someone walk into the room.”

At first Herskovitz, 55, ignored the noise until “she felt that there was a person next to her, and she opened her eyes to find a Pure Yoga employee, a maintenance associate, about two feet away, masturbating,” the suit alleges.

Herskovitz “confronted the maintenance employee and asked, ‘what are you doing?!'” she recalls in the court papers. The man, described as a 19-year-old, “quickly covered himself with a yoga blanket and ran out of the room,” the documents allege.

Herskovitz immediately told a manager about the encounter. The supervisor allegedly dismissed the accusation and said that the man “was a good employee,” court papers state.

The yogi, who’d been stretching at the studio weekly for three years, reported the incident to the police. She later received an email from the studio noting the seriousness of the incident, but management “has not reported the offender to the police or has taken any action against the offender,” Herskovitz claims in the suit.

Her attorney, Eric Creizman, is hiring a private investigator to determine if the maintenance worker “has been involved in additional incidents.”

Herskovitz is suing Related Companies, which owns Equinox, for unspecified damages.

A spokesperson for Pure Yoga said the studio is “aware of the allegations and takes them seriously. Police have told us there’s no evidence of a crime.”

Related Companies did not return calls for comment.