Tran decided to run for the House in 2017 after the election of Donald Trump. She ran in the 42nd district, which was then an open seat after Republican Delegate Dave Albo announced his retirement. She faced retired social worker Tilly Blanding in the June 2017 Democratic primary and won with 54 percent of the vote. Tran faced Republican Lolita Mancheno-Smoak, an engineer and Ecuadoran immigrant, in the general election. Republicans accused Democrats of racist smears after the Democratic Party of Virginia sent a mailer to voters depicting Mancheno-Smoak's face next to images of a werewolf and a hockey mask reminiscent of a horror movie with the headline, "This Halloween season, protect your family from the scariest threats." Tran denied that the mailer was racist, saying, "The mailer highlights the frankly scary policies that my opponent supports that would threaten funding for schools, threaten access to affordable health care, and threaten funding for Planned Parenthood. This is what is at stake in our election." Tran defeated Mancheno-Smoak in the general election, receiving 61% of the vote.
On the first day of the 2019 legislative session, Tran introduced the Repeal Act, a bill that would have reduced the number of physicians required to approve a third-term abortion in Virginia, and lower the threshold for approval to "any medical reason" from the previous requirement of the pregnant woman being “substantially and irredeemably” harmed by continuing the pregnancy. The Repeal Act would have also allowed second-trimester abortions to be performed in clinics instead of hospitals and would remove the requirement that an ultrasound be performed before an abortion. While testifying in the House of Delegates, questioned by Republican Delegate Todd Gilbert, Tran replied to questions about the contents of the bill, saying it allowed abortions up to the point of dilating, which drew accusations from Republicans of attempting to legalize infanticide. "My bill would allow that, yes," Tran said in response to Gilbert's question. The bill failed to pass the state legislature, but video of Tran's exchange with Gilbert went viral after being shared by conservative media outlets. Tran suspended her social media accounts in response to threats against herself and her family.