Hello Everyone I have a quick question Triggering ...
# ask-community
w
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
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
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