https://dagster.io/ logo
#ask-community
Title
# ask-community
s

Son Giang

05/20/2022, 10:23 AM
Hi there, what is the best way to trigger a job when all jobs in a backfilling are finished?
🤖 1
d

daniel

05/20/2022, 4:04 PM
Hi Son, you could use the Dagster GraphQL API for this potentially. Here's an example query that returns the status of each run in a backfill:
Copy code
query backfillRuns {
  partitionBackfillOrError(backfillId: "your-backfill-id-here") {
    ... on PartitionBackfill {
      runs {
        status
      }
    }
  }
}
s

Son Giang

06/01/2022, 4:17 AM
Hi, but how can I apply this into sensor?
Ah ok, i see there are python lib for dagster graphql
But seems like
DagsterGraphQLClient
does not support for querying partitionBackfill tho
seems like it can using the
_execute
method, however, seems like you cannot use it with trigger because it doesn’t have enough filter. You can only filter it with
status
and
cursor
d

daniel

06/01/2022, 1:37 PM
You can query graphql without using the DagsterGraphQLClient - the DagsterGraphQLClient class is just for convenience. Libraries like https://github.com/graphql-python/gql can work as a client
👍 1
s

Son Giang

06/02/2022, 2:57 AM
Thanks for the information, I’ve just done a workaround with this
3 Views