Tom Cavanagh has played three different main characters over the last three seasons of "The Flash," and now he's set to take on another new role as director. Cavanagh is officially directing episode 19 of this season, which is titled "The Once and Future Flash." He previously directed three episodes of the hit comedy "Ed" back in the early 2000s.

RELATED: The Flash Adds Anne Dudek as Mysterious Future Genius 

This news comes via Natalie Abrams who tweeted the episode title at PaleyFest on Saturday. Multiple Instagram photos from "The Flash" cast have also confirmed the news, which come via cast members Grant Gustin, Danielle Panabaker, and Cavanagh himself. Panabaker posted one behind-the-scenes photo saying that Cavanagh is doing a tremendous job and brings a lot of joy to the set.

Behind the scenes photo from last night's episode featuring @cavanaghtom who brings so much joy to our set AND is directing this week's episode of @cwtheflash ! And he's doing a tremendous job #theflash

A post shared by Danielle Panabaker (@dpanabaker) on

Gustin also shared a BTS image of Cavanagh directing and confirmed that Mirror Master actor Grey Damon will make an appearance in the episode.

If Golden Globe nominated Tom Cavanagh wants your coffee, you give him your coffee. Cameos by @kimiles, @greydamon, Burton and Roger. This episode was fun to make.(Ep. 319)

A post shared by Grant Gustin (@grantgust) on

Cavanagh himself shared two BTS photos of directing, both which feature Gustin in his Flash suit. It's important to note that Cavanagh tagged "The Originals" writer Carina MacKenzie in the second photo. MacKenzie is credited as the writer on "The Once and Future Flash." It is her first "Flash" writing credit to date.

"Directing Grant Gustin" Part 1. @grantgust #TheFlash

A post shared by Tom Cavanagh (@cavanaghtom) on

"Directing Grant Gustin" Part 2. @grantgust #TheFlash #319 @cadlymack

A post shared by Tom Cavanagh (@cavanaghtom) on

RELATED: Flash & Supergirl Dazzle in New Musical Crossover Portraits 

It's also important to note the title of the episode: "The Once and Future Flash." The title is likely based on the comic book issue "The Flash" #79, which was written by Mark Waid and released in 1993. In the issue, Eobard Thawne travels back in time and pretends to be Barry Allen. Wally and the other speedsters think Eobard is Barry for a time, but eventually figure out that he is Eobard. This version of Eobard has never met or fought Barry Allen, he was just Barry's super fan from the 25th century. When Eobard arrived in the past, he discovered all the terrible things that he would do in his future and went on a killing rampage.

There's been no word yet if Eobard will return for this episode -- what's more likely to happen is that Barry will travel to his future and learn something about himself. We know that Anne Dudek is joining the cast as a future scientist -- perhaps Barry meets her in the future, then looks for her when he returns to the past. Barry's desire to travel to the future likely stems from him wanting to stop Savitar from killing Iris.

Starring Grant Gustin as the Scarlet Speedster, “The Flash” airs Tuesdays at 8 pm ET/PT on The CW. The series also stars Jesse L. Martin, Tom Cavanagh, Carlos Valdes, Candice Patton, Danielle Panabaker, Keiynan Lonsdale and more.