Hello :wave:, I register my flow to the cloud and ...
# ask-community
p
Hello 👋, I register my flow to the cloud and start the agent directly from a python process. The flow is directly build in a docker container by my own. However, at each build and new invocation, a different agent is spinning up in the cloud UI. How can I tell the UI it's the same one which have disconnected and then reconnected?
c
Hi Pierre! This is a great question; right now agents are only tracked based on the labels they have so we don’t have a way of identifying agents across restarts. It is a very near term roadmap item to begin tracking them based on some form of stable ID (exact implementation TBD)
p
Thanks Chris, is there any way to set a label through the
flow.start_agent()
method? (via virtual env or other)
Or do I have to start it via the CLI/supervisor?
c
we typically recommend
flow.start_agent()
only for quick testing /development of your flow, otherwise the CLI is preferred. That being said, you can set labels through environment variable using
PREFECT__CLOUD__AGENT__LABELS="['one', 'two']"
👍 1