PHPackages                             cognesy/instructor-pipeline - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cognesy/instructor-pipeline

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cognesy/instructor-pipeline
===========================

Pipeline processing functionality for Instructor PHP library

v2.3.1(3mo ago)0203MITPHPPHP ^8.3

Since Aug 11Pushed 3mo agoCompare

[ Source](https://github.com/cognesy/instructor-pipeline)[ Packagist](https://packagist.org/packages/cognesy/instructor-pipeline)[ Docs](https://instructorphp.com)[ RSS](/packages/cognesy-instructor-pipeline/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (20)Versions (37)Used By (3)

Pipeline Package
================

[](#pipeline-package)

Small immutable pipelines for value transformations with `Result`-backed state.

What It Is
----------

[](#what-it-is)

The package now exposes one pipeline implementation:

- value-oriented steps via `through()` and `throughAll()`
- side effects via `tap()` and `onFailure()`
- final shaping via `finally()`
- lazy execution via `PendingExecution`
- immutable state via `ProcessingState`
- post-processing helpers via `TransformState`

Basic Usage
-----------

[](#basic-usage)

```
use Cognesy\Pipeline\Pipeline;
use Cognesy\Pipeline\ProcessingState;

$result = Pipeline::builder()
    ->through(fn(string $value) => trim($value))
    ->through(fn(string $value) => strtoupper($value))
    ->create()
    ->executeWith(ProcessingState::with(' hello '))
    ->value();
```

Failure Handling
----------------

[](#failure-handling)

```
use Cognesy\Pipeline\StateContracts\CanCarryState;
use Cognesy\Utils\Result\Result;

$result = Pipeline::builder()
    ->through(fn() => throw new RuntimeException('broken'))
    ->onFailure(fn(CanCarryState $state) => report($state->exception()))
    ->finally(fn(CanCarryState $state) => match ($state->isSuccess()) {
        true => $state->result(),
        false => Result::failure('pipeline failed'),
    })
    ->create()
    ->executeWith(ProcessingState::with('input'))
    ->result();
```

State Helpers
-------------

[](#state-helpers)

`ProcessingState` stores:

- a `Result`
- ordered tags

`TransformState` is a small helper for mapping, recovery, and tag-preserving state transformations after pipeline execution.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance82

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

36

Last Release

95d ago

Major Versions

v1.22.0 → v2.0.02026-03-13

PHP version history (2 changes)v1.3.0PHP ^8.2

v1.19.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/184133?v=4)[Dariusz Debowczyk](/maintainers/ddebowczyk)[@ddebowczyk](https://github.com/ddebowczyk)

---

Top Contributors

[![ddebowczyk](https://avatars.githubusercontent.com/u/184133?v=4)](https://github.com/ddebowczyk "ddebowczyk (78 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cognesy-instructor-pipeline/health.svg)

```
[![Health](https://phpackages.com/badges/cognesy-instructor-pipeline/health.svg)](https://phpackages.com/packages/cognesy-instructor-pipeline)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/event-dispatcher-contracts

Generic abstractions related to dispatching event

3.4k807.0M621](/packages/symfony-event-dispatcher-contracts)[symfony/mailer

Helps sending emails

1.6k409.1M1.4k](/packages/symfony-mailer)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[phpro/soap-client

A general purpose SoapClient library

8896.1M54](/packages/phpro-soap-client)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.5k1.5M88](/packages/mcp-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
