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

Wojtek

02/15/2024, 7:57 PM
Hello Everyone I have a quick question Triggering job via graphql API - I want to share dagster API with another team so they will be able to launch jobs when needed. I'm using more or less something like this:
Copy code
mutation LaunchPipelineExecution {
    launchPipelineExecution(
        executionParams: {
            selector: {
                repositoryName: "__repository__"
                repositoryLocationName: "definitions"
                jobName: "example_job"
            }
        }
    ) {
        ... on LaunchRunSuccess {
            run {
                id
            }
        }
    }
}
and it works perfectly The only problem I see that it's possible to launch many same jobs by just submitting this mutation. Is it possible to prevent launching the same job again if the job is already launched ? thank you
w

Wojtek

02/25/2024, 6:02 PM
Thank you @Zach I tested i and it works - however i think it's not enough, meaning there is still possibility to send 1000 queries - the only difference is that they are not processing immediately but are queued. So still, someone who uses graphQL can submit hundreds of queries and brake the pipeline. Ideally would be perfect to return an error instead of putting job in a queue.
z

Zach

02/25/2024, 8:03 PM
I think you'll have to implement that yourself with some kind of API gateway / microservice in front of Dagster. As far as I know there isn't anything built in to do this
👍 1
2 Views