Canada to US land border

Hi,

Has anyone recent travelled from Canada to US on H1-B visa via the land border. I need to travel from US to Canada and stay in Canada for 3-4 weeks before I return back. I am a dependent on Canadian work permit so I can enter as essential worker going to join family. I am on US H1-B. My question is would US border patrol consider the stay in Canada and returning back as essential travel?
Please share if you have similar experience.