# Workflow presets not working in CMakeUserPresets

**URL:** https://discourse.cmake.org/t/workflow-presets-not-working-in-cmakeuserpresets/8905
**Category:** Usage
**Created:** [September 7, 2023, 2:25pm UTC](https://discourse.cmake.org/t/workflow-presets-not-working-in-cmakeuserpresets/8905 "2023-09-07T14:25:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Braden](https://discourse.cmake.org/user_avatar/discourse.cmake.org/braden/32/358_2.png) [@Braden](https://discourse.cmake.org/u/Braden)
#### Post date: [September 7, 2023, 2:25pm UTC](https://discourse.cmake.org/t/workflow-presets-not-working-in-cmakeuserpresets/8905/1 "2023-09-07T14:25:27Z")

</div>

Has anyone had success getting workflow presets to work in `CMakeUserPresets`?

If I just include a single `configure` step, it works fine:

```json
{
  "version": 6,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 25,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-configure",
      "inherits": "v140-x64-RelWithDebInfo",
      "binaryDir": "C:/my-build",
      "installDir": "C:/my-install"
    }
  ],
  "buildPresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-build",
      "inherits": "v140-x64-RelWithDebInfo"
    }
  ],
  "workflowPresets": [
    {
      "name": "foo",
      "steps": [
        {
          "type": "configure",
          "name": "my-v140-x64-RelWithDebInfo-configure"
        }
      ]
    }
  ]
}

```

But if I add a `build` step, `cmake` then complains that the `configure` step is invalid:

```json
{
  "version": 6,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 25,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-configure",
      "inherits": "v140-x64-RelWithDebInfo",
      "binaryDir": "C:/my-build",
      "installDir": "C:/my-install"
    }
  ],
  "buildPresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-build",
      "inherits": "v140-x64-RelWithDebInfo"
    }
  ],
  "workflowPresets": [
    {
      "name": "foo",
      "steps": [
        {
          "type": "configure",
          "name": "my-v140-x64-RelWithDebInfo-configure"
        },
        {
          "type": "build",
          "name": "my-v140-x64-RelWithDebInfo-build"
        }
      ]
    }
  ]
}

```

```plaintext
>"\Program Files\CMake\bin\cmake.exe" --workflow --preset foo
CMake Error: Could not read presets from XXXXXX:
Invalid workflow step "my-v140-x64-RelWithDebInfo-configure"

```

I am using CMake 3.27.4.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [September 7, 2023, 9:24pm UTC](https://discourse.cmake.org/t/workflow-presets-not-working-in-cmakeuserpresets/8905/2 "2023-09-07T21:24:08Z")

</div>

Your build preset is invalid. The `inherits` field in a build preset can only list other _build_ presets. The `configurePreset` field is how you specify which configure preset a build preset is associated with. A build preset must have a `configurePreset` field, or one of the build presets it inherits from must have it.

EDIT: Ah, wait, I think you’ve only shown your `CMakeUserPresets.json` file and not your `CMakePresets.json` file. Maybe if you showed both, that may help uncover further details.

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [September 9, 2023, 7:46pm UTC](https://discourse.cmake.org/t/workflow-presets-not-working-in-cmakeuserpresets/8905/3 "2023-09-09T19:46:38Z")

</div>

> [@Braden](#):
>
> Has anyone had success getting workflow presets to work in `CMakeUserPresets`?

see [cmake\_template/CMakeUserPresets.json at feature/add-workflow-presets · ClausKlein/cmake\_template · GitHub](https://github.com/ClausKlein/cmake_template/blob/feature/add-workflow-presets/CMakeUserPresets.json)  
and [cmake\_template/CMakePresets.json at feature/add-workflow-presets · ClausKlein/cmake\_template · GitHub](https://github.com/ClausKlein/cmake_template/blob/feature/add-workflow-presets/CMakePresets.json)
