In CircleCI 2.0, teams now have more flexibility than ever in how they choose to run Workflows. Your jobs can be complex (or as simple as you’d like) and jobs don’t necessarily run sequentially.
When we delivered Workflows, we wanted to offer you a way to break up your jobs and choose when and how you’d like to orchestrate your configurations. BUT you were still stuck– it was still up to you to figure out a way to run your jobs in a way that doesn’t break anything, or that you’re not wasting time waiting for them to run. You were forced to make many separate decisions about how and when to run jobs, even jobs you ran daily.There are solid reasons to choose to manually approve jobs, and just as many reasons you might want to schedule workflows in advance:
|Manual Approvals||Scheduling Jobs|
|Enabling controls and layers of risk reduction for jobs which require some level of monitoring||Resource-intensive workflows|
|The assurance that someone on your team can check and confirm the details of a job before deploying into production||Regularly-run tasks you’d like to automate, ex: generating a report that runs on a schedule rather than on every commit|
|Automating jobs to run without manual oversight|
So now we are introducing the ability to require manual approvals and to schedule workflow runs. This allows you to create the most appropriate schedule for your team. Now you can customize your workflow to make it work optimally for you.
Setting up Scheduling
Running your workflows on a schedule is an easy way to automate repetitive tasks in your daily task load. To get started, just add a workflow with a
scheduletrigger. For more detailed information,check out the docs.
version: 2 commit-workflow: jobs: - build scheduled-workflow: triggers: - schedule: cron: "0 1 * * *" filters: branches: only: try-schedule-workflow jobs: - build
Setting up Manual Approvals
For times when you’d prefer to keep manual approvals in place, easily configure the manual approval process by adding to your workflow a special job containing a
type: approvalentry. See the example below andreview the docsfor further details.
version: 2 release-branch-workflow: jobs: - build - request-testing: type: approval requires: - build - deploy-aws: requires: - request-testing
Don’t see your specific use-case or already using these options to orchestrate your workflows in a different way? Share it with us and the rest of the CircleCI community onDiscuss!