is it possible to set custom environment variables...
# ask-community
a
is it possible to set custom environment variables to be used in my flow in the
serve
method?
b
Hi Aviv that is a great question I'm also looking for that answer. Let me know if you find the answer!
u
hey aviv, i don't think it's possible to set environment variables directly on the serve method, but you should be able to configure the environment just before you start the serve process:
Copy code
import os

from prefect import flow


@flow
def my_flow():
    word = os.environ.get("WORD")
    print(word)


if __name__ == "__main__":
    os.environ["WORD"] = "hi"
    my_flow.serve("my_flow")
does that work for what you're trying to do?