Hi there folks! :graphql: :google_snake_blob: `tl...
# ask-community
g
Hi there folks! graphql google snake blob
tl;dr; Passing arbitrary run_id via GraphQL Python Client
Is there anyway of using
executionMetadata
with the GraphQL client? I want to provide an user generated
run_id
to a job execution. I can fallback to using a raw GraphQL mutation if it's not implemented yet.
c
hey - you can execute a run via graphql using the
launchRun
mutation documented here: https://docs.dagster.io/concepts/dagit/graphql#launch-a-run but we don't have a way to specify an arbitrary run_id when doing this. What's the reason you need to set your own run_id? I'm wondering if any other dagster machinery can be of use there
g
Hi @chris! It's kind of an odd use but I wanna use my provided
run_id
in a
run_config
for a dbt dbt job. In this job I have something like
--vars 'dbt_run_id: <my_fancy_id>'
so I can get an extra audit trail with a
dbt_run_id
column in my model.
Copy code
launchRun(
          executionParams: {
            selector: {
                repositoryName: $repositoryName,
                repositoryLocationName: $repositoryLocationName,
                jobName: $jobName
            },
            runConfigData: $runConfigData,
            executionMetadata: {
                runId: $runId
            }
        }
      ){
This worked by the way.
c
Ah interesting - didn't realize that executionMetadata had a runId field already. Glad it worked for you!