I hunted around for how to do this and the only thing I could find was how to do it with iTerm. There is some talk about how to do it with Warp but the consensus was that you just can't because Warp "has no AppleScript support".
There is actually a way to do it. (Though this is a workaround because you can't use AppleScript to script Warp)
I found this on GitHub; most of the code is unnecessary unless you want to customize tab and window behavior.
Here's a simplified version I made. GitHub gist here.
on alfred_script(q)
tell application "System Events"
tell application "Warp" to activate
set numWin to count (windows of process "Warp")
if numWin < 1 then keystroke "n" using command down
delay 0.5
keystroke q
keystroke return
end tell
end alfred_script
About the delay...
If Warp is already running, you don't need the delay. If it's not already running, the minimum delay for it to work is 0.3 (at least on my machine).
I don't know how to check if an app is running using AppleScript, but if I did, I would add an if statement before the activation to set the delay only if the app isn't running yet.
If anyone knows how to do that we can save 0.3 precious seconds.