Hi everyone! I'm looking to add some metadata to m...
# prefect-getting-started
l
Hi everyone! I'm looking to add some metadata to my flow runs or deployments, like developer contact info and a brief description. I know there's a description field for deployments, but I need something that other flows can easily parse and use programatically. I thought about using a JSON block for each deployment that can be called by using the deployment ID, but it feels a bit messy and inefficient. Also thought of using tags but I don't think it would be appropiate for my use case. Has anyone else dealt with this? How did you solve it?
1
c
Hey Lucas! I think prefect Variables are a good fit for what you're describing -- they're basically super lightweight JSON blocks.
Copy code
from prefect.variables import Variable

var = Variable.set(name="test", value=dict(x=42))

var_value = Variable.get("test") # returns the dictionary
^^^ this code is valid in 3.0+, for 2.x the value is required to be a string (so maybe the output of
json.dumps
)
🙌 1
l
Great thank you!
🫡 1