Skip to main content

How to give a workflow a nickname

Naming Workflows

If you're looking to add clarity and organization to your CircleCI configurations, naming your workflows can significantly improve readability. This article will guide you on how to properly assign names to your workflows in your CircleCI configuration file (`.circleci/config.yml`), ensuring that you maintain an easily navigable CI/CD setup.

Assigning Meaningful Names to Workflows

Syntax for Naming Workflows

To give a name to a workflow, use the following syntax in your .circleci/config.yml file:

workflows:
  your_workflow_name: # This is where you name your workflow
    jobs:
      - job1
      - job2

In this structure, replace your_workflow_name with your desired name for the workflow. Ensure that the name follows proper YAML syntax rules to avoid parsing errors.

Example Configuration

Here's a more concrete example from CircleCI documentation to illustrate this:

workflows:
  build_test_deploy: # this can be any name you choose
    jobs:
      - build_and_test
      - deploy:
      requires:
        - build_and_test
      filters:
        branches:
          only: main

Additional Resources

Did this answer your question?