A CI/CD pipeline is an automated process that builds, tests, validates, and prepares software changes for delivery. It runs a defined set of steps when triggered by a code change or another event, helping teams catch problems early and produce reliable, release-ready software. CI/CD stands for continuous integration and continuous delivery or continuous deployment.
Whether developers write code themselves, generate it with coding agents, or work alongside agents to implement changes, the code still needs to pass the same basic checks. Does it build? Does it work as expected? Does it break anything else? Is it safe to release?
CI/CD pipelines provide a consistent way to answer these questions and prepare software for delivery. They coordinate builds, automate tests, enforce quality and security requirements, and can produce deployable artifacts for release. Some pipelines focus on validating proposed changes, while others package software for delivery or automate deployment. Together, these workflows help teams move changes reliably through the development process.
Why CI/CD pipelines matter
Writing code is only part of delivering software. Before a change can reach users, someone needs to build it, verify that it works, integrate it with the rest of the application, and prepare it for release.
Without a CI/CD pipeline, developers have to coordinate much of that work themselves. Tests may run inconsistently across machines, integration problems can go unnoticed until changes are merged, and releases depend on manual steps that are easy to miss or repeat incorrectly.
The problem grows as more people and coding agents contribute changes across multiple branches and projects. Teams can produce code faster than they can review, test, and integrate it. When validation can’t keep up, unfinished work accumulates and releases slow down.
CI/CD pipelines replace much of that manual coordination with a shared, repeatable process. Teams can:
- Catch problems early with automated tests and quality checks.
- Reduce manual work by running consistent builds and validation on every change.
- Produce reliable, versioned artifacts that are ready for release.
- Protect releases by requiring checks and approvals before deployment.
- Deliver more frequently by automating repeatable build, validation, and release procedures.
Together, these capabilities help teams spend less time coordinating builds, tests, and releases, and more time getting working software into production.
How a CI/CD pipeline works
Consider a developer adding a feature to a web application with help from a coding agent. The agent updates the application code, creates tests, and prepares the changes for review. Before the team merges the change, it needs to know whether the application still builds, existing tests pass, and the new code introduces any problems.
When the changes are pushed to the repository, the CI/CD platform starts a pipeline. It checks out the code, sets up an environment for each job, and runs the commands in the pipeline config.
Some jobs run sequentially because they depend on earlier work. Others run in parallel. For example, unit tests and security scans may execute simultaneously, while packaging or deployment jobs wait until all required checks pass.
Each pushed change runs through the pipeline’s checks, and failures go back to the developer or agent who made it.
If a test fails, developers can see what went wrong in the logs and test results. Jobs that depend on the failed check won’t run, so the team can fix the problem before the change moves ahead. Coding agents can help investigate the failure and propose a fix.
After a developer or agent makes the fix, the pipeline runs again to check the updated code. Once the required checks pass, the team can review and merge the change. A subsequent pipeline on the main branch might build and package a release-ready artifact, such as a container image or application bundle, that can be deployed immediately or stored for a later release.
A successful pipeline run can mean different things depending on its purpose. A pull-request pipeline might confirm that a change is ready to merge, while a release pipeline produces a validated artifact ready for delivery. The next question is what starts those runs in the first place.
Common pipeline triggers
Most pipelines start automatically when code changes in a version-controlled repository. Common triggers include:
- Code commits: Run checks when changes are pushed to a branch.
- Pull requests: Validate proposed changes before they merge into the main branch.
- Merges to main: Run integration checks or build and package release-ready software.
- Scheduled events: Perform recurring tasks, such as nightly tests or dependency checks.
- API requests: Start pipelines programmatically from development tools, coding agents, or other systems.
- Events from other tools: Start a pipeline from a webhook, such as a Slack command or an alert from a monitoring tool.
Teams can configure different workflows for different events. A feature-branch commit might trigger fast unit tests, while a change on main runs additional integration checks and prepares an artifact for release.
Whatever starts the run, the pipeline executes the build, validation, and delivery steps defined for that workflow.
The five stages of a CI/CD pipeline
CI/CD pipelines typically combine five stages: source, build, test, validate, and deploy. Together, these stages describe how code moves through automated checks and toward release, although not every pipeline needs all five.
| Stage | What happens |
|---|---|
| Source | A commit, pull request, or other event starts the pipeline. |
| Build | Code is compiled, dependencies are prepared, and application builds or deployable artifacts are created. |
| Test | Automated tests check that the code behaves as expected. |
| Validate | Quality, security, compliance, and other required checks evaluate the change. |
| Deploy | Validated software may be deployed to a target environment. |
The stages describe common responsibilities, not a mandatory sequence. Automated tests are themselves a form of validation, and independent checks can run simultaneously. Some pipelines only validate proposed changes, while others produce deployable artifacts or automate releases to production.
Source: Start with a change
The source stage retrieves the code revision that a pipeline will build or validate. Most software projects use a version control system such as Git to manage source code. Developers and coding agents can work on branches, propose changes through pull requests, and integrate approved updates into a shared codebase.
Pipelines can run when code changes, on a schedule, or in response to activity in other systems. Not every run starts with a code change. A schedule, an API call from a coding agent, a Slack command, or an alert from a monitoring tool can also start a pipeline, which then checks out the configured branch and runs against its current code.
Different triggers can start different workflows. Teams might run fast checks on feature branches, broader validation before merging, nightly regression tests or security scans, and release workflows when changes reach main. Learn how to control execution by branch or tag in Branch and tag filtering.
Build: Prepare the application
The build stage prepares source code for testing, execution, or distribution. Depending on the application, a build job may install dependencies, compile source files, assemble a container image, or package files into a deployable artifact.
Build requirements vary by language and framework. A compiled application might need several steps before it can run, while an interpreted application may only need dependencies installed.
For teams automating their release process, a useful practice is to produce a versioned artifact once, validate it, and promote that same artifact through staging and production. This approach, often called build once, deploy many, helps ensure that the software deployed to production is the same software that passed the required checks, rather than a separately rebuilt version.
Running builds in CI helps teams get consistent results without relying on how individual development machines are set up.
Test: Check the code’s behavior
The test stage checks whether changes behave as intended and whether existing functionality continues to work. Common test types include unit tests, integration tests, and end-to-end tests. Each provides a different level of confidence, from checking individual functions to validating interactions across an application. Learn more about the differences in Unit testing vs. integration testing.
Independent tests can run in parallel to provide faster feedback. For larger test suites, teams can distribute tests across multiple execution environments or use test impact analysis to select checks relevant to a particular change.
Some applications require additional forms of testing. For example, teams building AI-powered applications may run agent evaluations (evals) to measure whether an agent completes representative tasks successfully. Unlike conventional deterministic tests, these evaluations may require repeated runs, scoring thresholds, and comparisons against established baselines.
Validate: Enforce quality and security requirements
Validation checks whether a change meets the quality, security, and policy requirements for moving forward. Passing functional tests doesn’t necessarily mean code is ready for release.
Pipelines can check formatting and code quality, run static application security testing (SAST) to catch potential vulnerabilities in source code, and scan dependencies for known security issues. Some teams need additional policy or compliance checks.
Pipelines can run these checks automatically and stop changes that don’t meet the requirements. Teams can require human approval too, especially for sensitive repositories and production deployments.
Deploy: Deliver validated changes
Deployment delivers a validated application or software artifact to a target environment, such as staging or production. Deployment might mean updating a cloud service, rolling out a new container image, or releasing a mobile application. It can happen within the same pipeline or through a separate release process.
Teams may deploy first to staging, run further checks, and then promote the same artifact to production. Some organizations release automatically when all requirements are met, while others require approval or schedule releases for a particular time.
Teams also need a plan for bad releases. Depending on the application and deployment approach, a pipeline can support rollback to a previous working version or another recovery procedure. Learn more about rollout and recovery options in Deployment strategies: Types, trade-offs, and how to choose.
Continuous integration vs. continuous delivery vs. continuous deployment
CI/CD combines three related software engineering practices. Although the terms are often used together, they describe different parts of the development and release process.
| Practice | What it means | Production release |
|---|---|---|
| Continuous integration (CI) | Developers frequently integrate changes and use automated builds and tests to catch problems early. | Not necessarily included |
| Continuous delivery (CD) | Validated changes remain ready to release reliably and on demand. | May require approval |
| Continuous deployment (CD) | Changes that pass required checks are automatically released. | Automatic |
Continuous integration helps teams detect integration problems before they become harder to resolve. Continuous delivery extends the process so validated changes can be released reliably, while continuous deployment removes the manual release decision.
Continuous deployment isn’t appropriate for every application. Organizations with regulatory requirements, customer commitments, or complex release coordination may prefer continuous delivery with explicit approval gates.
Key components of a CI/CD pipeline
A CI/CD pipeline uses jobs, workflows, execution environments, and stored outputs to coordinate automated work. Most CI/CD platforms share these concepts, although their terminology and implementation details vary.
Pipeline config
The pipeline config specifies which jobs to run and how they fit together. Teams usually keep it alongside their application code, so changes to the build and release process can be reviewed like any other code change.
In CircleCI, the config usually lives at .circleci/config.yml. It defines jobs, execution environments, workflows, and the dependencies between jobs.
Jobs and steps
A job is a unit of work executed in a defined environment. A job contains one or more steps, such as checking out source code, installing dependencies, running tests, building an application, or saving results.
For example, a test job might execute these steps in order:
- Check out the repository.
- Restore cached dependencies.
- Install any missing packages.
- Run automated tests.
- Save test results and diagnostic output.
Steps normally run one after another. If a command fails, the job usually stops there, though teams can configure cleanup and reporting steps to run even after a failure.
Separate jobs can perform different tasks or run the same task in parallel across multiple execution environments. A build job might produce files that downstream jobs use for testing, packaging, or deployment.
Workflows and job dependencies
A workflow connects jobs and sets the order they run in. For example, a team might require unit tests, integration tests, and security checks to pass before creating a final release artifact or starting deployment.
Checks that don’t depend on each other can run at the same time. Downstream jobs start only after their required dependencies pass.
In CircleCI, workflows use job dependency declarations to control execution order. Jobs without a dependency relationship can run concurrently when resources are available. For config examples showing sequential jobs, parallel execution, and fan-out/fan-in patterns, see Workflow orchestration.
Execution environments
Every job needs computing resources to execute its commands. CI/CD platforms provision those resources using containers, virtual machines, or other supported environments.
The environment gives each job the operating system, tools, runtimes, and computing resources it needs. For example, a Node.js test job may run in a container with Node.js installed, while a mobile application build might require a macOS execution environment.
Jobs often run in isolated environments, so files created in one job won’t automatically be available in another. CI/CD platforms provide mechanisms for transferring files and preserving outputs when jobs need to share information.
Artifacts, caching, and shared files
CI/CD pipelines produce and preserve different types of files, from test reports to release-ready software. Several mechanisms serve different purposes:
- Artifacts preserve outputs such as compiled applications, build packages, screenshots, and diagnostic files for later inspection or download. Deployable software can also be published to package repositories or container registries for subsequent release.
- Test results provide structured information about passing and failing tests, helping teams identify problems and understand test performance.
- Caches store reusable data, such as downloaded dependencies, to avoid repeating expensive setup work in subsequent runs.
- Workspaces let CircleCI jobs share files produced earlier in a workflow, such as compiled application assets needed by a downstream job.
In short, caches reuse data across jobs and pipeline runs, workspaces transfer files between jobs in a workflow, and artifacts preserve outputs for later access. Structured test results help teams find and investigate failures.
For release workflows, external artifact repositories and registries provide an additional benefit: they allow teams to store a versioned build and deploy the same software across environments. That reduces the risk of introducing differences between what was tested and what ultimately reaches production.
In CircleCI, the jobs section defines what each job does, while the workflows section controls how jobs are connected and when they run. For example, a unit-tests job could look like this:
jobs:
unit-tests:
docker:
- image: cimg/node:22.12
steps:
- checkout
- run: npm ci
- run: npm test
The job checks out the code, installs dependencies, and runs tests inside a Node.js container. The workflow below references that job and the other jobs defined in the config:
workflows:
pipeline:
jobs:
- build
- unit-tests:
requires: [build]
- integration-tests:
requires: [unit-tests]
- lint:
requires: [build]
- deploy:
requires: [integration-tests, lint]
filters: pipeline.git.branch == "main"
After build succeeds, unit-tests and lint can run in parallel. The requires entries determine which jobs must pass before others start, while the filters expression limits deployment to main. The example shows one job definition and the workflow; a complete config also defines build, integration-tests, lint, and deploy.
The workflow above in action: lint and unit tests run in parallel after build, and deploy waits for both.
When a pipeline fails
A CI/CD pipeline reports failed jobs and prevents dependent work from proceeding until the required checks pass. Failures are a normal part of software development, and useful diagnostic information helps teams resolve them.
When a command fails, the job is marked as failed. Developers can open the job to see the command output, test results, and exit code.
The failed unit-tests job from that pipeline, showing the assertion that broke it.
A failed job can block later jobs. If unit tests fail, for example, the integration tests that depend on them won’t start, and downstream packaging or deployment jobs can be prevented from proceeding. Other jobs can keep running if they don’t depend on the failure.
The same run as a workflow: unit tests failed, integration tests never started, and lint still passed.
Developers can investigate the problem, update the code or pipeline config, and trigger another run. Platforms may support rerunning failed jobs or workflows, which can help investigate intermittent failures without introducing a new code change.
With access to CI tools, coding agents can retrieve failure logs and test results, investigate likely causes, and propose fixes for developer review. CircleCI’s CLI gives agents direct access to that information, so they can work through failures without developers having to retrieve results manually. See Getting started with the CircleCI CLI for a practical example.
The team gets a clear failure to investigate, and the workflow won’t let the change through checks it hasn’t passed.
Benefits of CI/CD pipelines
CI/CD pipelines make software delivery more reliable by replacing inconsistent manual processes with repeatable automation. Their value extends beyond saving time on builds and deployments.
Catch problems earlier
Automated checks identify build failures, broken tests, and integration problems soon after code changes. Instead of discovering incompatibilities during a release, teams can address them while the relevant changes are still under development.
Catching failures early makes them easier to investigate, before other changes build on top of the broken code.
Reduce time spent on routine validation
Developers shouldn’t need to manually run the same sequence of build, test, and validation commands every time they make a change. CI automates repeatable checks and presents their results in a consistent format.
When a check fails, developers can start with the logs and test results rather than reproducing every step locally. Agents with access to those results can help investigate and propose fixes, leaving developers to review the changes and handle more complex problems.
Improve software quality and release confidence
Pipelines run required checks consistently, helping teams catch regressions before they reach users. Automated validation can’t catch every defect, but it provides a reliable baseline for evaluating changes before they’re merged or released.
Produce consistent, release-ready software
Pipelines standardize how applications are built and packaged. Versioned artifacts let teams track exactly which build passed validation and promote the same software through staging and production without rebuilding it for each environment.
Make smaller, more frequent changes practical
Large changes are harder to review, test, and troubleshoot. They create more opportunities for conflicts when multiple developers work on the same codebase.
With CI handling repeatable checks, developers can integrate smaller changes more often instead of letting work pile up on long-lived branches.
Keeping changes small and integrating them regularly helps teams avoid a growing backlog of work awaiting review, validation, and merge.
Give teams visibility into delivery performance
Pipelines generate useful operational data. Teams can measure how often workflows run, how long they take, whether they succeed, and how quickly failures are resolved.
Common CI performance metrics include:
- Duration: How long a workflow takes to complete.
- Throughput: How frequently workflows run.
- Success rate: The percentage of runs that complete successfully.
- Mean time to recovery (MTTR): How long teams take to recover from failures.
The metrics can help teams identify slow tests, unreliable jobs, recurring failures, and other sources of delay. But pipeline activity alone doesn’t tell the whole story.
CircleCI’s Q3 2026 State of Software Delivery data shows that main-branch success rates improved even as per-workflow main-branch throughput remained flat for the median team. More reliable pipelines are helping teams validate changes, but that hasn’t necessarily translated into faster delivery.
The goal isn’t simply to maximize pipeline activity. It’s to help teams turn code changes into validated, release-ready software and get completed work into production.
CI/CD pipeline best practices
A good pipeline gives reliable feedback fast enough that it doesn’t slow development down. A pipeline that runs every conceivable check but takes an hour can stall even small changes, while one that finishes in seconds but misses real problems gives false confidence. These practices help you find the balance.
Keep feedback loops short
The sooner developers find out about a failure, the sooner they can fix it.
- Run independent jobs in parallel.
- Cache dependencies and avoid rebuilding artifacts you’ve already built.
- For large test suites, split tests across machines or use test impact analysis to run only the tests affected by a change. See how CircleCI Smarter Testing reduces test execution time.
Run the right validation for each change
Match the checks to the change and where it’s headed. A documentation update doesn’t need the same checks as a change to a payment service.
- Use conditional workflows to skip checks a change can’t affect.
- Run broader validation before merging or as part of release workflows, where appropriate.
Make failures easy to diagnose
A failure should point developers to its cause.
- Keep logs and test results that identify the failing command or test.
- Track flaky tests separately so intermittent failures don’t obscure reproducible defects.
- Give developers and authorized agents access to the information they need to investigate.
Protect the main branch
A broken main-branch pipeline can block software delivery for an entire team.
- Use required checks, branch protection, and review policies to keep main healthy.
- Treat a failing main-branch workflow as urgent, and investigate recurring failures.
Maintain security and release controls
Pipelines handle sensitive code, credentials, and production infrastructure.
- Limit permissions and store secrets securely.
- Review changes to pipeline config like any other code change.
- Keep coding agents within the team’s approval rules. Access to diagnostics doesn’t have to mean authority to merge, change infrastructure, or deploy.
How to create a CI/CD pipeline
You can get started with a simple pipeline that builds an application and runs its existing tests on every code change. This initial CI workflow can validate proposed changes before they merge. As the project grows, you can add artifact packaging, release workflows, and deployment automation.
To get started, you need a code repository, a CI/CD platform connected to it, and a config file telling the platform which commands to run.
You can create the config yourself, use a platform’s starter templates, or have a coding agent inspect the project and prepare the initial setup. The same basic approach works across CI/CD platforms; the following example uses CircleCI to show what setup looks like in practice.
Set up CircleCI with a coding agent
Coding agents can help create an initial CI/CD pipeline by inspecting a project’s existing build and test setup and generating a config that uses those commands.
If you’re working with a coding agent in your IDE or terminal, give it access to your project and ask it to inspect the existing build and test setup before generating a pipeline.
Use a prompt like this:
Set up CircleCI for this repository.
First, inspect the language, dependencies, build
commands, and existing tests. Then create a minimal
.circleci/config.yml that runs the build and tests
on every change, using caching where it helps.
Explain what triggers the pipeline, what each job
does, and which credentials or environment variables
I need to provide. Don't change application code or
set up production deployment without my approval.
Review the generated config before committing it. Confirm that it runs the relevant build and test commands, uses appropriate execution environments, and doesn’t expose sensitive information.
For a faster setup, use the CircleCI CLI’s guided onboarding:
circleci onboard
The onboarding flow generates a starter config, connects your repository, creates the project, and sets up an initial trigger. With the CLI installed, your coding agent can also check pipeline status, read job output, and pull test results directly, so it can investigate failures without anyone copying logs out of the browser.
Once the pipeline is running, inspect the results in CircleCI or through your development tools. If a job fails, use its logs and test results to investigate the problem, make a correction, and validate the updated code.
For detailed setup instructions, see the CircleCI project setup guide.
Get started with CI/CD using CircleCI
CircleCI provides automated build, test, packaging, and deployment workflows that teams can define and maintain as code. It supports parallel execution, test optimization, caching, and reusable config to help developers get reliable feedback and produce consistent software builds without unnecessary waiting.
Developers can also connect coding agents to CircleCI through CLI and MCP tools, giving agents access to pipeline results and failure information as they help investigate problems and prepare fixes.
Start with automated builds and tests, then add release controls and deployment automation as your delivery process grows.