https://flyte.org logo
#ask-the-community
Title
# ask-the-community
e

Erich Shan

10/09/2023, 8:51 PM
hey everyone, I'm new to flyte and im looking to add logic to an existing flyte workflow. this logic needs to depend on the domain. I dug around here and found that i can retrieve the domain using `os.getenv("FLYTE_INTERNAL_TASK_DOMAIN", "dev")`in the code. im considering just creating an environment class which stores a bunch of fields (table name, pathname etc.) and have it be indexed by
development
or
production
. is this a good approach? i didn't see much else on domains but i also wanted to double check if there's no better way or storing variables into environments that's built-into flyte
k

Ketan (kumare3)

10/09/2023, 11:49 PM
do you want the runtime domain information or registration time
if you want runtime, then in a task you can use
Copy code
@task
def foo():
  flytekit.current_context().execution_id.domain