Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Multiengine
Communication Breakdown; Confusion; Distraction; Fatigue; Training / Qualification; Physiological - Other
Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Clearance
Air Traffic Control Provided Assistance; Flight Crew Executed Go Around / Missed Approach; Flight Crew Requested ATC Assistance / Clarification; Flight Crew Became Reoriented
Human Factors; Environment - Non Weather Related
Soon after departure from ZZZ; we were given a lower cruise altitude. All of these changes spanned the climb; cruise and descent segments; so PF accomplished numerous FMS program changes. Prior to ZZZZZ; we were given a vector for spacing - heading 290; I think - and subsequent descents and speed changes. At some point during the changes; PF lost track of things and turned toward ZZZZZ waypoint without clearance. ATC issued a turn back to heading 300. PM noticed the turn; but was in third leg since returning from five months leave; so did not intervene or call out the discrepancy as he; also; was not certain the turn was incorrect. Crew was subsequently cleared to ZZZZZ and to descend VIA ZZZZZ arrival and landed XXR without incident.  I think even the Controller lost track of all of the instructions. I attribute the error to task saturation; hunger and some dehydration. I was also a little distracted by some personal issues going on which I started to think about while we were waiting during flow control from ZZZ-ZZZ1. I think we will have lots of issues going forward as pilots come off of extended leaves of absence. I should not have let myself get distracted and dehydrated.
Air Carrier Captain reported a track deviation and cited task saturation; hunger and lack of flying as contributing factors.