One of the more frustrating aspect of running a table top game - especially as folks get older and have more concerns going on in their life - is that life will randomly decide that the ability for 5-7 people to have the same 4 hour period available will just go away at times. Some times of year make this harder - like the holidays for everyone, and summer for people with school aged kids. There is a trick to dealing with this, and it essentially boils down to the title of this post: leave yourself room to pivot.
A Minimum Number of Players
You should decide early on what is the minimum number of players you are willing to run for. I tend to go with more than 50% of players. If I have 3/5 players (or 4/6, 4/7, 5/8, 2/3, etc) my general rule is I will run. The people who are not available will either be NPC'd for combat, or just put off to the side where they are assumed to be there, assumed to be helping (and earning XP) but are just not represented on the table. This also means those missing PCs are subject to the same penalties that befall the group. If there is a TPK, those PCs are dead too.
With time to plan other things can be put in place. I've helped coordinate my PC, or the PC of another player, being captured or otherwise having to go separate from the group to explain an absence. When that can work, it works great. But that is more for a planned missed session, not finding out within a week of the session that someone will be missing.
Plot Necessary PCs
Going into each session you should identify which PCs are necessary for the plot/plan for the session. There is no point in having the beginning of Ayumi's personal plot happen at a session Ayumi is not present for - unless that was the plan all along. At the same time, if the group is going into a heavy political situation and is missing all the social characters that might not be the most fun thing ever either.
In general I try to minimize the sessions that require a PC to be present because fate has a history of making that person unavailable on that day regardless. However, it is just going to happen sometimes. The only way for it to not happen is to never do plots that involve your PCs on a personal level aside from their own investment, and while games can be done that way they tend to not be near as fulfilling as other games.
Still, even if you are minimizing required PCs for each session you want to have them identified. Why? Because how else will you know how much you need to pivot.
High Investment PCs vs. Low Investment PCs
In every game I find there tends to be High Investment PCs and Low Investment PCs. There is nothing wrong with being either. Some games just appeal to certain playstyles more than others, or the plot shakes out in a way that you end up with some PCs being more "big deal" to the plot than others. High Investment vs. Low Investment is probably a horrible way to explain this but I don't have a better term.
My own PC in both games I'm a player in right now I'd consider a "Low Investment" PC. I love both these games. I love both these characters. However, for various reasons I feel that those characters could not be present for a session and while the group would likely feel the lack mechanically in combat (unless the DM re-balanced well) it likely would not have a huge amount of impact on the games plot progression.
This isn't the fault of the DM for either game either. In one case I was a very late addition to the campaign, so simply was not around for all the early plot movement that would get key plot items tied to my character. This is further hindered by the fact my first PC died, so the new one missed even more. In the other game, my PCs personality is just not at a place where it hooks into what the DM is doing. I, as a player, am super invested in what is going on. It just hasn't fully sank into the character yet.
Knowing which PCs your plot tends to want around though also tells you how much you can pivot. If a 'Low Investment' character (god I hate this term) is going to miss a session, and the session isn't built around their character, your plans really don't have to change much. Whereas if a High Investment PC is going to be missing - or someone the session was planned around - you need to change more.
Side Quests and Detours
So now you know which PCs you need and which you want there. You also find out you are going to be missing some PCs, enough you need to change your plans but not so much you want to miss game. So what do you do? Well, effectively you add filler. Filler can get a bad wrap from other media, but there is nothing wrong with it used well. Filler can give us a chance to learn more about characters, dispense some more items/xp, or just as a way to reveal more of the world and the people within it.
When I need filler I go for one of two things: Side Quests and Detours.
A side quest is something that will take the PCs off the quest line they're currently on to resolve something else. Normally this boils down to a sort of "one shot" inside the established game. Side Quests can be as simple as on the way to the castle the PCs find a village under attack by goblins, to as complex as being waylaid by some transdimensional/realm hopping experience and needing to find their way back. The idea is that it is content - and ideally fun content - that eats up the session until you have all your PCs back for the next main plot segment.
A detour is like a sidequest, but instead of having the PCs handle something unrelated to the plot you instead lengthen out how long it takes to do something. This is essentially adding Video Game quest logic to your current situation. Ever notice how every 'simple' thing you need to do in a video game RPG is actually like 8 separate quests that have to be done first? That is essentially what we're doing here. If the PCs are looking to recruit someone to their cause, said NPC needs stuff done before they can go. If they're trying to get from point A to point B, some obstacle has to be handled before they can get through. If they're looking to acquire maguffin X, then there is more prepratory work that needs to be done before they go to get it. They're still working on the main quest, but you're padding out the time.
In both cases you should be using the opportunity to show more about the world and find out more about the characters.
Have ideas for both in mind whenever you can. Detours tend to be easier for some people, because videogames are full of examples. However, if the PCs are traveling side quests can be remarkably easy to add in wherever you want, though enticing your PCs may be harder depending on how focused they are.