The boy's mum had shared a heartfelt post on a mums' Facebook group about no one turning up for his party.
Rachelle Briannan, from Melbourne, Australia, said she was sat in her room "quietly crying".
"Twelve kids were invited to my son’s party today, and an hour before every one of them cancels or just doesn’t reply to my messages," she wrote on Midnight Mums.
"My son just turned four and this is the first time he's really understood the whole party and friends thing. My heart is really broken for him!"
But thanks to the power of social media, just one hour later Briannan's son Taenon had more than 30 children celebrate his birthday with him.
The people behind Midnight Mums reposted Briannan's Facebook post alongside the update.
"One hour after Rachelle Briannan posted this heartfelt post on our Midnight Mums Facebook support group, up to 30 young children with their parents turned up at Melbourne's McDonald's to help celebrate the fourth birthday party of Rachelle's son Taenon," it read.
"Some families travelled from as far as Boronia and Ringwood - 30 minutes away."
And it wasn't only parents and children who came together to celebrate Taenon's birthday.
A local party shop donated a bunch of number four helium balloons and the local emergency service turned up and invited the children to explore their trucks.
The post continued: "The Midnight Mums community rallied together online with hundreds of birthday wishes for Taenon and touching the hearts of our members with this feel good story."
Members of the Midnight Mums group were pleased to witness the random act of kindness.
"I would hate to be one of those mums right now who didn't even bother showing up or letting her know," one mother wrote. "Great work to everyone who made an effort, brings tears to my eyes."
Another wrote: "I love the power of social media, this has made me cry!
"So pleased for your little boy and the others are just wonderful, wonderful human beings."