from dagster import Config from dagster_graphql import DagsterGraphQLClient, DagsterGraphQLClientError class MyAssetConfig(Config): date_col_name: str pred_col_name: str steps_to_predict: int lags: int def execute_job(): url = "https://my_cloud/prod" token = os.environ["USER_TOKEN"] client = DagsterGraphQLClient( url, transport=RequestsHTTPTransport( url=url + "/graphql", headers={"Dagster-Cloud-Api-Token": token} ), ) try: new_run_id: str = client.submit_job_execution( job_name="ts_predict", repository_location_name="whatever", repository_name="__repository__", # by default run_config={"ops"= "timeseries_predict": MyAssetConfig(date_col_name="Date", pred_col_name="bla", steps_to_predict=10, lags=10)} ) print("executed") return "

Job executed!

" except DagsterGraphQLClientError as exc: print(exc) return f"

{exc}

"