Possible to set a maximum build time limit?

Using workflows (2.1), is it possible to specify a time limit for builds, after which CircleCI cancels/fails the build?

A recent bug in a build tool meant that a build job that normally would take 5 minutes to run was never completing. Essentially, the build script was stuck in an infinite loop.

I would like to specify a maximum execution time for build jobs, after which CircleCI kills the build. This would prevent getting charged for hours of CI time, when the job should have completed in a few minutes.

Thanks!

Does this link https://www.tecmint.com/run-linux-command-with-time-limit-and-timeout/ help?

yes and no - I was hoping this could be done at the workflow level (this build pipeline should never take longer than 30 minutes, for example). While using timeout - we’d need to add it to each command in our build scripts.