In the late 1980s, cartoonist Matt Groening was called into the Fox Network’s “Tracey Ullman Show” for a meeting. The sketch comedy show was using one-minute animated clips between sketches and was unhappy with its current lot. Groening had been drawing a cartoon called “Life in Hell” since 1977 that was a popular draw in alternative newspapers.

According to longtime Simpsons writer Mike Reiss, Groening was initially told it would just be a “get-acquainted meeting,” so he arrived with nothing prepared. But a few minutes before it started, one of the attendees told him they were looking forward to seeing his project.

So, with just five minutes to spare before a potentially career-altering meeting, Groening sketched out a new idea, and that’s how the Simpsons — bearing the names of Groening’s parents, Homer and Marge, and his sisters, Lisa and Maggie (Bart was his own idea) — were born.

Reiss’ new book, “Springfield Confidential: Jokes, Secrets, and Outright Lies from a Lifetime Writing for the Simpsons,” written with Mathew Klickstein (Dey Street Books), takes us on a hilarious journey through Reiss’ career, which includes writing for “The Simpsons” for most of its life. Last month, it became the longest-running scripted series in television history with its 636th episode.

Reiss was already a veteran sitcom writer, having worked on “Alf” and “It’s Garry Shandling’s Show,” when “The Simpsons” hired its first writers in the run-up to its 1989 debut. At the time, the job was hardly prestigious.

“Nobody wanted to work on ‘The Simpsons,’ ” Reiss writes. “There hadn’t been a cartoon in prime time since ‘The Flintstones,’ a generation before. Worse yet, the show would be on the Fox network, a new enterprise that no one was sure would even last.”

Reiss was so embarrassed by the job that he didn’t tell anyone he had taken it.

“The studio had so little faith in us, they housed us in a trailer,” Reiss writes. “I assumed that if the show failed, they’d slowly back the trailer up to the Pacific and drown the writers like rats.”

The night before the show’s premiere, Reiss asked the rest of the staff how long they thought it would last.

“Every writer had the same answer. Six weeks,” he writes. “Only [executive producer] Sam Simon was optimistic. ‘I think it will last 13 weeks,’ he said. ‘But don’t worry. No one will ever see it. It won’t hurt your career.’ ”

He was half-right. No one’s career was hurt, but people definitely saw it. “The Simpsons” premiered to great reviews and became the highest-rated debut in the network’s history to date.

Reiss portrays the show’s creation as a mostly peaceful process, although the first few years saw one behind-the-scenes rivalry find its way on-screen.

Groening was hailed as a genius, but Reiss writes that Simon, who died of cancer in 2015, deserved much of the credit for the show’s early success. Simon’s growing bitterness at watching Groening receive that credit temporarily made Groening a pariah on his own show and inspired the classic episode “Flaming Moe’s.”

“[Sam] pitched a story where Homer, like Sam, creates something truly extraordinary . . . and Moe gets all the credit for it. Homer becomes twisted with rage and destroys them both. [The episode] is considered one of the best ‘Simpsons’ episodes ever.”

In the book, Reiss reveals “Simpsons” secrets and inside jokes galore. He even points out one joke that has run in every episode of the series that sails past most viewers unnoticed.

“When ‘The Simpsons’ title card emerges from the cloud,” he writes, “you see the first half of the family’s name, ‘The Simps,’ before the rest of the word. So what? Well, ‘Simps’ is short for simpletons — stupid people — like the ones you’re about to see in the show.”

He also reveals answers to several of the show’s long-running mysteries. Reiss discovered why Simpsons characters are yellow by accident at an art show of a former show animator. (Every Simpsons episode features 24,000 cels hand-drawn by Korean animators.)

This woman, whose name he doesn’t reveal, received Groening’s original character drawings and was charged with finding a color for them.

She chose yellow because, ­Reiss writes, “Bart, Lisa and Maggie have no hairlines — there’s no line that separates their skin from their hair points. So the animators chose yellow — it’s kinda skin, kinda hair.”

There is also the eternal question of exactly where the Simpsons home city of Springfield is located. Reiss writes that the town name — “borrowed” from the ’50s hit sitcom “Father Knows Best” and initially chosen by Groening for its “generic blandness” — has been presented in so many ways over the years that it can’t possibly be located in any one place.

“Springfield has an ocean on its east side and its west side,” Reiss writes. “We once said that East Springfield is three times the size of Texas. And in one episode, we see Homer shoveling snow in the morning and lying in a hammock sipping lemonade that afternoon. This raises the question: What planet is Springfield on?”

‘While I’d love to do ‘The Simpsons,’ I’d never do anything to disgrace the office of the president. Sometimes they write the jokes for you.’

A book about “The Simpsons” would be incomplete without tales of the many celebrities that have appeared on the show, and Reiss does not disappoint.

When Elizabeth Taylor recorded her infamous voice cameo — she gave Maggie Simpson her first word, “Daddy,” in 1992 — she had to do six takes because it kept coming out “too sexy.”

“We had to remind her she was a baby talking to her father, not hitting on him,” Reiss writes. “Liz did hit on one guy in the crowded room — our animation supervisor, David Silverman. ‘Who is that?’ she purred.”

Reiss reveals that in “Marge vs. the Monorail,” the Conan O’Brien-penned episode regarded by fans as one of the show’s best, the infamous Leonard Nimoy cameo was actually created for one of the actor’s old co-stars, who refused.

“We asked George Takei from ‘Star Trek’ to play himself — Takei had been on an earlier episode, and he loved it,” Reiss writes. “But Takei turned us down, saying, ‘I don’t make fun of monorails.’

“Turns out he’s an impassioned fan of public transit. Instead, we went to Leonard Nimoy, who happily took the part.”

For Michael Jackson’s 1991 appearance playing a 300-pound white mental patient who thought he was Jackson, Reiss writes that Jackson had a surprising faculty for comedy.

After reading the episode’s 20-page outline, Jackson “offered some funny suggestions: He pitched the scene where Bart tells the town that Michael Jackson is coming to visit, creating an uproar, and he added a scene where ‘Michael’ writes a song with Bart.”

Jackson also made the writers change a joke that involved his fiercest entertainment rival, Prince, to make the punchline about Elvis Presley instead.

Reiss writes that Jackson wasn’t the greatest actor, but the staff was certain his singing performance would be the stuff of legend. They were right — even if the voice wasn’t his.

When they were ready to record Jackson’s vocals, the singer brought out “a little white guy” named Kipp Lennon, whom he introduced as his “authorized sound-alike.”

It’s Lennon’s voice, not Jackson’s, singing the episode’s songs.

When asked why he had Lennon sing the songs instead of doing it himself, Jackson “replied cryptically, ‘It’s a joke on my brothers.’ ”

“Let me be the first to say it,” Reiss deadpans in the book. “Michael Jackson was an odd guy.”

While “The Simpsons” have seemingly had their pick of celebrity guests, Reiss reveals the stars that have eluded them.

Bruce Springsteen is the show’s great white whale, turning them down consistently despite their attempting to bribe him with a Simpsons jacket, and even having his late sax player Clarence Clemons on the show in the hopes he would tell The Boss “how much fun it was.”

They have also never had a US president, having been rejected by every POTUS from Gerald Ford to Barack Obama.

“The closest we ever came was Bill Clinton,” Reiss writes. “After we wrote him a part and sent him the script, he notified us, ‘While I’d love to do ‘The Simpsons,’ I’d never do anything to disgrace the office of the president.’ Sometimes they write the jokes for you.”

Tom Cruise was an early fan but ultimately turned down a part, and both Prince and George Lucas asked if they could appear but changed their minds after reading the parts written for them.

As Reiss depicts it, the rejections are understandable. Lucas would have been subjected to a “Star Wars” rant by Comic Book Guy, and Prince was asked to play a second iteration of the 300-pound mental patient who thought he was Michael Jackson.

Some guest stars surprised the staff with unexpected talent — Aerosmith bassist Tom Hamilton had “great comic timing and a huge range of funny voices” — and baseball Hall of Famer Ken Griffey Jr. was “angry” about his role in the famed “Homer at the Bat” episode because, Reiss writes, “He didn’t understand his line, ‘There’s a party in my mouth and everyone’s invited.’ Adding to the pressure, his father, Ken Griffey Sr., was there trying to coach him through the line, and it wasn’t helping.”

While Reiss found most of the show’s celebrity guests a pleasure to work with, “I’ve worked with only one celeb,” he writes, “whom I considered a diva. To protect her anonymity, the publisher’s legal department will only let me give you her first name: Oprah.”