At the same time, there has been a battle between pluralist Muslims, and those who would see the state as an enforcer of a puritanical and often intolerant religious piety.
Indonesia is the biggest Muslim nation in the world with 187 million voters from 350 ethnic groups, with more than 700 languages across 17,000 islands: staging an election there is never easy and involves a massive bureaucracy and scores of political parties – from the most liberal to the most conservative and intolerant.
In election after election, Indonesians have never really given majority support to those parties who would seek to join conservative Islam with political power.
However, this year’s poll in some ways harks back to 2004, a watershed year in Indonesian politics when the new government headed by Susilo Bambang Yudhoyono – or “SBY” – allowed the religious dynamics in Indonesia to shape the political regime.
The new President took the remarkable step of empowering the “Ulama Council”, which until then had been a largely sidelined Islamic organisation set up by Suharto.
The council was charged with deciding what should be solely government business, and what should be deemed religious affairs.
On the council, Islamic vigilante organisations such as the Islamic Defenders Front and other groups promoting sharia law were given equal standing with mainstream Islamic organisations like Muhammadiyah – which boasts millions of members across the country.
The council was quick to label any liberal policies that displeased them as “sipilis” – western ideas that undermine Indonesian society – a term purposely designed to sound like “syphilis”.
On Wednesday, Indonesia goes to the polls debating exactly these issues: what is Islam, what is Islamic, what is Indonesian?
For the first time, the President, Vice President, and members of Parliament will be elected on the same day.
Sectarianism continues to play a part in politics, and Islamist groups once considered fringe players have now joined the mainstream. But this time, perhaps, the poll seems unlikely to descend into a piety contest.
As in 2014, incumbent Joko Widodo is running against retired General Prabowo Subianto, whose military background (his father-in-law was Suharto) and ties with hardline Islamist groups make him a popular choice in some parts of the country – especially in the west of Java, which alone contains around 17 percent of the country’s voters.
Despite Subianto’s claims to “Make Indonesia Great Again” Widodo looks set to hold power bolstered by a clever choice in running mate: 76-year old muslim cleric Ma’ruf Amin, who is the man behind a fatwa against Christian Jakarta mayor “Ahok” (who eventually had to step away from his campaign for re-election, and was later jailed for insulting the Quran).
Widodo – known universally as “Jokowi” – still faces major opposition among conservative Islamists, who see him as too liberal, too friendly to the west, and too chummy those who would exploit Indonesia and its people for financial gain.
He’s the first Indonesian leader to come from outside the country’s political and military elites, and has faced accusations he’s a communist, and a traitor who has allowed “millions” of Chinese workers into the country. Almost every day he faces a new scandal on social media, claims that are later shown to be hoaxes designed to derail his campaign.
Despite his liberal platform, liberal supporters of Widodo have harshly criticised what they see as his pandering to the conservatives, harking back to SBY’s empowerment of the Ulama Council, and the eroding of Indonesia’s reputation as pluralist and tolerant.
Jokowi faces an electorate wanting to move forward, but who in many ways are attached to a conservative past where the Islamic faith had a vastly more idealistic influence over politics.
Despite this, it seems political Islam in Indonesia may be about to face its biggest defeat in some time, as both main candidates come from a nationalist perspective, not an Islamic one.
The hardline Islamic parties are losing voters to both of them.
Most Islamic parties are unlikely to pass the 4 percent threshold and will be out of Parliament.
Every Indonesian presidential election since 2004 has ended in a legal challenge of the result, and General Subianto has already signalled he will mount a court challenge if the results don’t go his way.
His campaign paints a picture of Indonesia as a country where a corrupt elite have failed time and again to manage the economy and take care of the people.
A similar criticism has been hurled at every Indonesian president since independence, but Joko Widodo moved quickly in his first term, taking the controversial step of scrapping fuel subsidies to Indonesians, and using the resultant revenue to build roads, airports, and other public infrastructure.
Has it been enough? At a time when the world’s largest Muslim-majority nation is being shaped by an increasingly populist zeitgeist, he has had to make some hard decisions. And while he has not constricted the rights of minority groups he has been accused of doing very little to defend them.
In enabling the Ulama Council more than a decade ago, President SBY was seeking stability in Indonesia at a time when the echoes of the Bali bombing had only just receded, and the country was still struggling with the fallout from the Suharto years. SBY shied away from real change, and in so doing sowed the seeds of Jokowi’s initial victory in 2014.
Mr Widodo’s reputation as a reformer goes before him, his challenge this week is to assure Indonesians he is not a prisoner of history.