Hi! In our organization, we'd like to let users tr...
# flyte-support
b
Hi! In our organization, we'd like to let users trigger certain workflows, and then in a custom frontend we'd like to show a paginated list of executions along with their status. • Is there any way to efficiently obtain a list of executions and their status? • ideally this list would be filtered based on some metadata already to just return the list of executions for a particular user
f
Yup use the list executions api
You can filter and sort by user, date time, launchplan and workflow
All Of Flyte Ui is built using the same apis
b
basically, what I would want is, given:
Copy code
$ flytectl get execution --project project --domain flyte-workflows --details --filter.limit 1 -o yaml
and output
Copy code
closure:
...
id:
  domain: flyte-workflows
  name: f8901ad49cd16436889d
  project: project
spec:
...
do a query for executions filtering on
f8901ad49cd16436889d
did anyone find a way to do batch lookups of execution status, given a bunch of execution IDs?
f
hey @brave-engine-51755 sorry for the delay
@brave-engine-51755 let me understand you want to just retrieve the execution by name?
that is directly possible
Here is an example
Copy code
(flytekit) āžœ  wikipedia git:(whisper-actor) āœ— flytectl get execution -p flytesnacks -d development fc0c56d0277ec55a5000
 ---------------------- ------------------ ------------------------ ------------- ----------- ---------------------- -------------------------------- --------------- -------------------- --------------------
| NAME                 | LAUNCH PLAN NAME | VERSION                | TYPE        | PHASE     | SCHEDULED TIME       | STARTED                        | ELAPSED TIME  | ABORT DATA (TRUNC) | ERROR DATA (TRUNC) |
 ---------------------- ------------------ ------------------------ ------------- ----------- ---------------------- -------------------------------- --------------- -------------------- --------------------
| fc0c56d0277ec55a5000 | talk-every-hour  | vwpPVEUsZ2Q5cTKz4YBKpA | LAUNCH_PLAN | SUCCEEDED | 2024-06-13T01:00:00Z | 2024-06-13T01:00:02.373038527Z | 20.691294295s |                    |                    |
 ---------------------- ------------------ ------------------------ ------------- ----------- ---------------------- -------------------------------- --------------- -------------------- --------------------
b
not just one execution, but look up the status of say 42 different executions, in single API call, rather than 42 separate API calls
f
ohh you want a batch lookup for certain executions got it
this is not possible today
but you can retrieve by
labels
šŸ‘Œ 1
so if you assign some custom label you can filter that
flytectl get execution -p flytesnacks -d development --filter.fieldSelector="execution.phase in (FAILED;SUCCEEDED),execution.duration<200"
b
what is the field selector for labels?
f
this is something that is changing a little bit - we want to basically normalize to labels only instead of labels and tags
cc @glamorous-carpet-83516 knows about this more
b
sorry, meant to say labels (updated to clarify)
g
@brave-engine-51755 check out this PR. it allows you to filter the execution based the tags or labels. there are some examples in the pr description
b
thanks! that looks amazing! this PR will probably solve our issue, since we'll be able to set key/value and look up stats for particular keys and/or values! I see the PR is merged last week. any idea when it will make it to release?
šŸ‘ 1
g
in 2 or 3 weeks
šŸ™ 1