Hi there, what is the best way to trigger a job wh...
# ask-community
s
Hi there, what is the best way to trigger a job when all jobs in a backfilling are finished?
🤖 1
d
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
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
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
Thanks for the information, I’ve just done a workaround with this