"I have invited President Zelensky to attend the G20 summit," said Indonesian President Joko Widodo.
In a phone call with Widodo, Putin confirmed that he would attend the summit on Bali, the Indonesian leader added.
Meanwhile, Kremlin spokesman Dmitry Peskov said Russia is preparing for this year's G20 summit in Indonesia but has not yet decided whether Mr. Putin will attend in person or online.
At the end of March, the Russian Ambassador to Indonesia said that Russian President Vladimir Putin planned to attend the G20 summit in Indonesia later this year.
This week, Ukrainian President Zelensky announced on Twitter that he had been invited by Indonesia to attend the summit during a phone call with the Indonesian president on April 27.
Mr Zelensky did not say whether he would accept an invitation to attend the November summit in Bali, and if so, he would attend in person or online.
Russia is a member of the G20, while Ukraine is not.
Since Russia launched its military campaign in Ukraine, Indonesia has faced strong pressure from Western countries to ban Russia from attending the summit. However, Jakarta has stressed that as host, the country must maintain fairness.