On 10 May 1728 he took up the position he was to hold for the rest of his life, as Kapellmeister at the Esterházy court in Schloss Esterházy in Eisenstadt.[2] The appointment "opened a new era for music"[3] at the court; previously, there had been seven years of relative inactivity following the death of Prince Joseph in 1721; his widow Maria Octavia, serving as co-regent for her young son Paul Anton, had instituted economies in the musical establishment.[4]Robbins Landon and Jones suggest that Werner was hired at the then 17-year-old prince's instigation.[4]

Werner set to work, bringing new music to the court from Vienna and composing prolifically.[3] He remained in full charge of the Esterházy musical establishment until 1761, when he entered a period of semi-retirement, his responsibilities limited to church music.[2] Throughout this time he worked for a prince who was himself highly musical: Paul Anton had received musical training from the court musicians as well as from music masters imported from abroad; he played the violin and the flute.[5]

Werner wrote a cappellamasses in a strict contrapuntal style,[2] as well as church music with instrumental accompaniment and symphonies. His work includes a series of twenty oratorios, all composed for performance on Good Friday, usually in the Esterházy chapel.[6] Jones discerns a bifurcated style, with most of the work taking the form of severe, "weighty" contrapuntal pieces, but a minority (written for lighter occasions such as Advent and the Nativity) that "employ a distinctly homespun idiom, invoking elements of Austrian and indeed Eastern European folk music."[6] Works by Joseph Haydn in both genres exist, and may have been influenced by Werner.[6]

As an employee of the Esterházy family Werner published little, but a few works did see print.[6] These include his set of twelve orchestral suites depicting the twelve months of the year (Neuer und sehr curios-Musicalischer Instrumental-Calender ("New and very curious musical instrument calendar"),[7] which appeared in Augsburg in 1748.[6]

Autograph scores and parts by Gregor Joseph Werner have found their way into the collection of the Országos Széchényi Könyvtár, Budapest,[10] as well as the public archives in Győr, Hungary.[citation needed]

Werner's period of semi-retirement began in 1761 when the Esterházy family hired the 29-year old composer Joseph Haydn as their Vice-Kapellmeister. The contract by which Haydn was hired shows the family's loyalty to their elderly musical servant by retaining him, at least on a titular basis, in the top post of Kapellmeister. However, after this time Werner's musical duties were limited to church music, and Haydn, 39 years younger than Werner, had the primary duties, with full control over the secular musical events of the household, including the orchestra.[11]

This was a time of changes probably unwelcome to Werner. His longtime patron Paul Anton died in March 1762, succeeded by his younger brother Nikolaus Esterházy. Nikolaus was also a very musical prince, but his interests (Jones) "lay with Haydn and the development of instrumental music."[6] Haydn initially received the same salary (400 florins per year) that Werner had long received, but in June 1762 this was increased to 600.[12]

In addition, Werner had lived to see the kind of music he composed become outmoded. His own work emphasized the contrapuntal textures of the Baroque era, whereas by 1761 the new forms of the Classical period, often with a single melody set over an accompaniment figure, had come to the fore. Jones says, "he had become too old to appreciate the rapidly developing fashion for symphonies, quartets, and keyboard sonatas, genres in which Haydn was already acquiring a name for himself."[13] Werner expressed his distaste by calling Haydn a "G'sanglmacher" (writer of little songs) and "Modehansl" ("fashion follower," literally "little Hans of fashion").[6]

Werner's discontent reached its climax in October 1765, a few months before his death, when he wrote a letter to Prince Esterházy denouncing Haydn for his slackness in running the Esterházy musical establishment. The letter begins:

I am forced to draw attention to the gross negligence in the local castle chapel, the unnecessarily large princely expenditures, and the lazy idleness of the musicians, the principal responsibility for which must be laid at the door of the present director, who lets them all get away with everything, so as to receive the name of a good Heyden [sic]: for as God is my witness, things are much more disorderly than if seven children were around.[14]

While it is natural to detect bitterness and envy in Werner's letter, Jones points out that the criticisms might well have been legitimate, and that the letter produced a useful bureaucratic response. Haydn was spread thin between serving the Prince's interests in secular music (mostly in his palace in Vienna) and in covering for the now-frail Werner the church music at the family seat in Eisenstadt. Prince Nikolaus arranged for his administrator Rahier to deal with the situation. Rahier (with whom Haydn had a difficult relationship) issued an official document,[15] which reprimanded Haydn. However, it also provided a helpful clarification of Haydn's responsibilities and designated a subordinate (Joseph Dietzl) to take on the task of keeping track of the music and instruments in Eisenstadt.[16]

The reprimand also led Haydn to begin to keep a draft catalog of all his works (the "Entwurf-Katalog").[17] In response to a particular detail of the reprimand, Haydn began writing a great number of works in the Prince's favorite genre at the time, the baryton trio.[18]

Werner today is an almost-forgotten composer. The Penguin Guide to Recorded Classical Music[19] reviews no recording of any works by him; and few recordings are commercially available. The reference sources listed below tend to emphasize Werner's troubled relationship with Haydn over his own career.

The noted choreographer Twyla Tharp used a prelude and fugue by Werner for her 1976 dance Give and Take.[20]

Haydn himself clearly held Werner in high esteem, whatever their personal difficulties may have been. In his own old age (1804) Haydn published "six introductions and fugues for string quartet, taken from Werner’s oratorios".[2] The title page read that the works were "edited by his successor J. Haydn out of particular esteem towards the famous master."[6]