Continuous Integration pipelines don’t have to be slow or complicated. One of the simplest patterns, called Fan-Out Fan-In, can give you both speed and reliability.
The idea is straightforward:
- build once
- run tests in parallel
- deploy or release if everything passes
In other words, build the product once, test it from every angle at the same time, then release or deploy.
What is Fan-Out Fan-In?
Fan-Out Fan-In is a CI/CD pipeline pattern designed to maximize efficiency.
- Fan-Out: after building your artifact once, the pipeline “fans out” into multiple test jobs such as unit tests, integration tests, and end-to-end tests. These run in parallel, saving time.
- Fan-In: once all tests pass, the pipeline “fans in” to a single stage, usually for release or deployment.

The key benefit is to avoid rebuilding the same artifact multiple times. It works incredibly well on large projects that demand a lot of computing power to build.
Build Stage
Every pipeline starts with a build. This is where you take your source code and turn it into a usable artifact. This can be a compiled binary, a Docker image, or a packaged directory.
The important part is you only build once. That artifact becomes the single source of truth for all later stages.
This approach has several advantages:
- It ensures consistency: tests and deployments all use the same artifact.
- It saves time: no need to rebuild for every job.
- It makes debugging easier: if something fails, you know it’s not because of mismatched builds.
In practice, this usually looks like:
- Checking out the repository.
- Installing dependencies.
- Running the build command.
- Storing the result in an artifact store for later stages.

At this point, you’ve got a reliable package that’s ready to be tested.
Fan-Out Stage
Once you have a single, reliable build, it’s time to test it. In the fan-out part, we run test in parallel to reduce the pipeline duration.
Typical jobs might include unit, integration, and end-to-end tests, but you can do any kind of test in the fan-out stage.
Each test job starts by pulling down the artifact you built earlier. Since they’re all working with the exact same artifact, you avoid inconsistencies and wasted rebuilds.

At the end of this stage, you’ll have a full set of test results and a clear signal of whether your artifact is ready to move forward.
Fan-In Stage
All tests passed? Time to fan back in to a single stage that ships your artifact. Here, we start by pulling the exact same build from the artifact store, then package and publish it. This keeps your release consistent with what you just tested.

Conclusion
Continuous integration doesn’t have to be complex to be effective. Fan-Out Fan-In keeps things simple: one build, parallel tests, one release. This strategy gives speed without losing reliability.
Check the documentation page for more examples on modeling complex workflows.
Thank you for reading, and happy building!
Want to discuss this article? Join our Discord.