Hi guys! I'm trying to run a flow using the GraphQ...
# prefect-community
m
Hi guys! I'm trying to run a flow using the GraphQL API in Prefect Cloud by executing:
Copy code
mutation {
  create_flow_run(input: {
    flow_run_name: "Test"
    version_group_id: "81261519-e91c-4fe3-bf85-10cc3a2d5016"
  }) {
    id
  }
}
But I get the following error:
Copy code
{
  "graphQLErrors": [
    {
      "path": [
        "create_flow_run"
      ],
      "message": "Version group 81261519-e91c-4fe3-bf85-10cc3a2d5016 has no unarchived flows.",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR"
      }
    }
  ],
  "networkError": null,
  "message": "GraphQL error: Version group 81261519-e91c-4fe3-bf85-10cc3a2d5016 has no unarchived flows."
}
I'm sure the group ID is correct, and that there is a version of a test flow I created. I can even run it manually. What am I doing wrong? Thanks!
BTW: There is only 1 version of said flow.
z
Hi @Matias Godoy, taking a look now! If possible, could you DM me your team name?
m
Sure!
Ok, the problem was that I was using the
flow_group_id
, when in reality what you need is the
version_group_id
. For anyone having this problem, you can find it using the following query:
Copy code
query {
 flow(distinct_on: name) {
   name
   id
   version_group_id
 }
}
Thanks a lot to @Zachary Hughes for the help!
🎉 2