Dirty Computer and other projects (2017–2022)
While filming these two movie roles, Monáe remained active in music with features on Grimes' "Venus Fly" from her Art Angels album and also the soundtrack for the Netflix series The Get Down with a song titled, "Hum Along and Dance (Gotta Get Down)". Monáe was also on the tracks "Isn't This the World" and "Jalapeño" for the Hidden Figures soundtrack.
In an interview with People, Monáe revealed that she was already working on her third studio album when she received the scripts for her two first acting roles; therefore, she put the album on hold. Monáe also revealed in the interview that she would be releasing new music sometime in 2017, although by the end of the year no album or single was announced. On February 16, 2018, Monáe revealed her third studio album, titled Dirty Computer, through a teaser video on YouTube. The album was accompanied by a narrative film project, and the teaser video aired nationwide in select theaters prior to screenings of Black Panther. She held a series of "top-secret" listening sessions in Los Angeles and New York in support of the album. On February 22, 2018, Monáe released "Make Me Feel" and "Django Jane" as the first two singles from Dirty Computer, both accompanied by music videos and announced that the album would follow on April 27, 2018. Monáe stated in an interview with BBC Radio 1: "Prince was actually working on the album with me before he passed on to another frequency, and helped me come up with some sounds. And I really miss him, you know, it's hard for me to talk about him. But I do miss him, and his spirit will never leave me." Its short film earned a Hugo Award nomination for Best Dramatic Presentation – Short Form.
Monáe appeared in the episode "Autofac" of the 2017 anthology series based on the work of Philip K. Dick, Electric Dreams, which premiered on Channel 4 in the UK and on Amazon Video in the US.
On April 27, 2018, Monáe released a sci-fi film companion "emotion picture" to her new record Dirty Computer. The album debuted at the number six of the Billboard 200 with 54,000 equivalent units and on the top ten charts of Canada, United Kingdom and Ireland. It was chosen as the best album of the year by three publications: the Associated Press, New York Times, and NPR. The album received the nomination for Album of the Year at the 61st Annual Grammy Awards. She also contributed to the soundtrack to the dark comedy film Sorry to Bother You, collaborating with The Coup. In 2018 her Wondaland Pictures production company was signed to a first look deal with Universal.
On November 15, 2018, it was announced that Monáe would receive the Trailblazer of the Year award at the 2018 Billboard Women in Music event, which was held on December 6, 2018. Also in 2018, Monáe co-starred in the fantasy drama feature film Welcome to Marwen, by filmmaker and screenwriter Robert Zemeckis alongside Steve Carell and Leslie Mann. On January 3, 2019, the Coachella Valley Music and Arts Festival announced that Monáe will co-headliner the stage with Childish Gambino. Glastonbury Festival also confirmed Monáe's presence as headlining the West Holts stage of the festival. Four days after the Coachella setlist announcement, Monàe released a new music video for the song "Screwed". She replaced Julia Roberts in the second season of the Amazon Prime Video series, Homecoming, playing "a tenacious woman who finds herself floating in a canoe, with no memory of how she got there or who she is." On March 29, 2019, in Brooklyn, NY, she inducted Janet Jackson into the Rock & Roll Hall of Fame. Also in 2019, she co-starred in the film Harriet, about abolitionist Harriet Tubman. Monáe returned to the big screen twice in 2020, with her first lead role in September 2020 with horror film Antebellum, and another supporting role with biopic The Glorias.
On February 9, 2020, Monáe opened the 92nd Academy Awards with a performance featuring Billy Porter that highlighted the many films nominated as well as films that were snubbed by the Academy, including Dolemite Is My Name and Midsommar. In September 2020, Monáe released the music video Turntables as part of the Amazon Studios' bipartisan voter registration campaign. The song is used over the end credits of the Stacey Abrams-backed film, All In: The Fight for Democracy. More recently, she signed global deal with Sony Music Publishing.
On July 4, 2021, We The People, a 10-part series of animated music videos premiered on Netflix, created by Chris Nee, with Kenya Barris as a showrunner and produced by Barack and Michelle Obama. Monáe performed a number of songs for the series. This included a reggae-influenced number, titled "Stronger," which focuses on the "fight for justice and unity ... unity, liberty and equality" and the title track for the series. She won the Children's and Family Emmy Awards for Outstanding Short Form Program as one of the writers.
In 2022, Monáe portrayed twin sisters Helen and Cassandra "Andi" Brand in Glass Onion: A Knives Out Mystery, for which she received critical acclaim. In April 2022, Harper Voyager published her first book, The Memory Librarian: And Other Stories of Dirty Computer, which "explores how different threads of liberation—queerness, race, gender plurality, and love—become tangled with future possibilities of memory and time in such a totalitarian landscape ... and what the costs might be when trying to unravel and weave them into freedoms." In May 2022, Deadline reported Monáe was set to act as Josephine Baker in the TV series De La Resistance.