Actually it looks like you can do it with a shell script. Alfred passes in the first param from the command to the script which is then inputted into the VPN prompt window if you're using 2 factor auth or a password or something. Here's the shell script from my workflow:
on alfred_script(q)
set theConnection to "My VPN Connection" -- Change this to the name of your VPN connection
set connectionWindowTitle to "VPN Connection"
set theApp to "UserNotificationCenter"
set thePassword to q
open_vpn_connection(theConnection, thePassword, theApp, connectionWindowTitle)
end alfred_script
-- Find a window containing specific static text, in a given application
on find_window_by_static_text(appname, staticText)
log "Searching " & appname & " for " & staticText
tell application "System Events"
set allApps to (get name of every application process) -- get all apps
if allApps contains appname then -- find the app if it's running
set allWin to (get every window of application process appname) -- get all the windows for our app
set numWin to count allWin -- count the number of windows
repeat with winNum from 1 to numWin
set aWin to window winNum of application process appname
set allText to (get value of every static text of aWin)
if allText contains staticText then
log "fwbst winnum: " & winNum
return winNum
end if
end repeat
end if
end tell
return null
end find_window_by_static_text
-- Open a given VPN connection and enter the password
on open_vpn_connection(theService, thePassword, theApp, connectionWindowTitle)
set scutilCommand to "scutil --nc start '" & theService & "'"
do shell script scutilCommand
if (thePassword is null) or (thePassword = "") then
-- No need to do anything else with the window here...
return null
end if
delay 2
repeat with x from 1 to 20
log "vc loop " & x
delay 0.1
set winNum to find_window_by_static_text(theApp, connectionWindowTitle)
log "winNum is: " & winNum
if winNum is not null then
exit repeat
end if
end repeat
if winNum is null then
display dialog "Could not find the VPN Connection window"
return null
end if
tell application theApp to activate
tell application "System Events"
perform action "AXRaise" of item winNum of (get every window of application process theApp)
keystroke thePassword
key code 36
end tell
end open_vpn_connection