Hello. I’m trying to use conditional workflows triggered by curl but running into an issue that circleci is interpreting the boolean value in my JSON payload as string. Basically the same problem as this person had: Unable to trigger conditional workflow with boolean value
#!/bin/sh -eo pipefail
# Type error for argument run_backend: expected type: boolean, actual value: \"true\" (type string)
#
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false
Exited with code 1
Here is the relevant part of my config.yml:
version: 2.1
parameters:
run_backend:
type: boolean
default: false
jobs:
backend:
docker:
- image: circleci/node:12.10
steps:
- run: |
echo foo
workflows:
version: 2
backend:
when: << pipeline.parameters.run_backend >>
jobs:
- backend
And this is how I’m triggering the build:
curl -u ${CIRCLE_TOKEN}: -X POST \
--header "Content-Type: application/json" \
-d '{"parameters":{"run_backend":true}}' \
https://circleci.com/api/v2/project/git/raine/education-platform/pipeline