Run (Teletype) is used to execute code following a run command from Teletype. It takes one optional argument which specifies which decorated function to execute.


From DETA lib version 21 the convention is For all earlier lib versions the convention is You can find a program's lib version by the deta.lib field in the INFO tab. The latest lib version is 22.


  • action: str indicates which function to execute.

Usage example:

from deta.lib import app
def main_handler(event):
    return "Willkommen in Berlin.""kreuzberg")
def main_handler(event):
    return "Willkommen in Kreuzberg!""steglitz")
def main_handler(event):
    return "Willkommen in Steglitz!"

Command (Teletype Studio)


Command (Teletype Dash)



"Wilkommen in Berlin!"

Command (Teletype Studio)

run kreuzberg

Command (Teletype Dash)

prog_name kreuzberg


"Wilkommen in Kreuzberg!"

event attributes

  • event.json: dict provides the json payload as a Python dict.
  • event.body: str provides the raw json payload.
  • event.type: str will be instantiated to "run".
  • event.action: str bears the action provided by the user or an empty string if no action is provided.


See primitive responses.