is it possible to set custom environment variables to be used in my flow in the
serve
method?
b
Bruno Fidrmuc
03/04/2024, 4:09 PM
Hi Aviv that is a great question I'm also looking for that answer. Let me know if you find the answer!
u
Uriel Mandujano
03/06/2024, 8:57 PM
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")
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.