Hey folks, is there a way to add metadata tags/lab...
# ask-community
n
Hey folks, is there a way to add metadata tags/labels to Flows/Flow Groups? Adding a Label to a Flow Group has the added feature of helping decide which Agent to run on, but I'm looking for something that's purely informational. The goal is to be able to query GraphQL for flows with specific tags and do something with that list of IDs. For example, if we want to pause all jobs for Client X, but not Client Y or Z (and there's nothing in the flow naming convention to indicate), we want to be able to just run a query for all jobs with tag "Client-X" and then run a mutation to pause/delay those flows. Or maybe we want to track slow flows -- so we query for flows running 50% slower than their past monthly average runtime and add a "slow" tag so we can make some changes. Does this exist? Is there a place in a flow for arbitrary information? Maybe a "tags" parameter that just never gets used?
z
Hey @Nathan Walker -- this is an interesting use-case! This is something I've been thinking of as a better version of projects. There is a "description" on the "Flow" object that does not get used, but it's a string type and you'll probably want JSON for a fast lookup here (substring searches will be slow without specific indices on our end)
🙌 1
A hack might be to use "Parameters" with default values (eek) since you can query them on flows and flow runs
n
Oooo, I like both of these. Hacky, sure, but they'll get the job done!
z
They're stored as JSONB so you can use the
_contains
operator for a fast lookup
👀 1
Although they're only stored on the flow run if they're non-default... hmm.
n
OH, speaking of JSONB, is there a way to use JSONB for query variables in the Apollo playground? I can get it to work in Hasura and in Python, but the Apollo playground tells me my JSONB object isn't JSONB...
z
You've gotta put it in a string e.g.
"{\"foo\": 2}"
✅ 1