Putin and Xi previously declared a "no limits" partnership between their countries
"Xi Jinping will come. President Putin has also told me he will come," Mr Widodo, also known as Jokowi, told Bloomberg News in an interview.
This is the first confirmation that both leaders will attend the summit.
It will be the first global summit since Russia's invasion of Ukraine and the heightened tensions over Taiwan.
It would also be the first time Mr Xi has left China since January 2020 when the country shut its borders at the start of the Covid pandemic. Since then, he only left the mainland to mark the 25th anniversary of Hong Kong's return to China on July 1 this year.
The November summit will be much-awaited given that US President Joe Biden is also expected to attend - it's unclear if he will meet Mr Putin.
But reports have hinted at the possibility of a face-to-face meeting between Mr Biden and Mr Xi soon - ahead of the summit or on its sidelines.
Relations between Washington and Beijing have soured over human rights, trade and most recently US politician Nancy Pelosi's visit to Taiwan - the historic trip prompted China to conduct nearly a week of military drills around the self-ruled island, which it claims as part of its territory.
The US condemned the drills, which Taiwan described as a rehearsal for an invasion, as "irresponsible".
The summit is also happening in the wake of China and Russia declaring a "no limits" strategic partnership even as much of the world condemns Mr Putin's decision to invade Ukraine.
Washington earlier called for the G20 to remove Russia's membership and withdraw Mr Putin's invitation to the summit over the Ukraine war.
Indonesia, meanwhile, has positioned itself as a peacemaker between the countries.
"The rivalry of the big countries is indeed worrying," Jokowi told Bloomberg News in the interview. "What we want is for this region is to be stable, peaceful, so that we can build economic growth."
Earlier this week, the Indonesian leader said both Russia and Ukraine had accepted his country as a "bridge of peace".
In June, he was the first Asian leader to travel to Kyiv and Moscow to meet with Ukrainian president Volodymyr Zelensky and Mr Putin. During the meetings, he called for an end to the war and solutions to the global food crisis.
-- Courtesy of BBC News