Hi! Im trying to start a run though gql. I am usin...
# ask-community
d
Hi! Im trying to start a run though gql. I am using this mutation where the input is a variable: Anyone know what the type is supposed to be for the input?
Copy code
mutation MyMutation($input: any) {
    create_flow_run(
      input: $input
    ) {
      id
    }
  }
k
There is an example usage here
d
thanks but I need the input to be a variable 🤔 Is there an example of that?
k
Kind of. The source code of
client.create_flow_run()
here
Or really you can just use that method?
The input will be a pain to construct I think because it will be JSON. Think like RunConfig
d
ah thanks! That was what I was looking for:)
This input is a bit pain indeed. I am trying to construct it with nested strings. I am getting an error:
"dictionary update sequence element #0 has length 1; 2 is required"
do you know what that means?
the input variable looks like this:
Copy code
{
  "input": {
    "flow_id": "3668605b-e14d-4afd-bec8-1de691faaa28",
    "parameters": "{\"project\": \"xxx\", \"jsonata\": \" { \"name\": first_name } \"}"
  }
}
I managed to get it to work btw:p
k
Lol glad you got it figured out
Actually, this is a good topic for Discourse, our new knowledge base. Would you be willing to post your solution there because handling that JSON input is always tricky. This will help me link other people to it
upvote 1