PHPackages                             serverlessworkflow/sdk - 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. serverlessworkflow/sdk

ActiveLibrary

serverlessworkflow/sdk
======================

Provides the PHP API/SPI for the Serverless Workflow Specification.

1.0.0(2y ago)931Apache-2.0PHP

Since Nov 25Pushed 2y ago3 watchersCompare

[ Source](https://github.com/serverlessworkflow/sdk-php)[ Packagist](https://packagist.org/packages/serverlessworkflow/sdk)[ RSS](/packages/serverlessworkflow-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Serverless Workflow Specification - PHP SDK
===========================================

[](#serverless-workflow-specification---php-sdk)

Provides the PHP API/SPI for the [Serverless Workflow Specification](https://github.com/serverlessworkflow/specification).

With the SDK you can:

- Programmatically build workflow definitions
- Parse workflow JSON and YAML definitions
- Validate workflow definitions

### Status

[](#status)

Current SDK version conforms to the [Serverless Workflow specification v0.8](https://github.com/serverlessworkflow/specification/tree/0.8.x).

Installation
------------

[](#installation)

```
composer install serverlessworkflow/sdk

```

Build
-----

[](#build)

```
use Serverless\Workflow\Action;
use Serverless\Workflow\ActionDataFilter;
use Serverless\Workflow\FunctionDef;
use Serverless\Workflow\FunctionRef;
use Serverless\Workflow\OperationState;
use Serverless\Workflow\Workflow;

$workflow = new Workflow([
    'id' => 'greeting',
    'name' => 'Greeting Workflow',
    'description' => 'Greet Someone',
    'version' => '1.0',
    'specVersion' => '0.8',
    'start' => 'Greet',
    'states' => [
        new OperationState([
            'name' => 'Greet',
            'type' => 'operation',
            'actions' => [
                new Action([
                    'functionRef' => new FunctionRef([
                        'refName' => 'greetingFunction',
                        'arguments' => [
                            'name' => '${ .person.name }',
                        ],
                    ]),
                    'actionDataFilter' => new ActionDataFilter([
                        'results' => '${ .greeting }',
                    ]),
                ]),
            ],
            'end' => true,
        ]),
    ],
    'functions' => [
        new FunctionDef([
            'name' => 'greetingFunction',
            'operation' => 'file://myapis/greetingapis.json#greeting',
        ]),
    ],
]);

```

Parse
-----

[](#parse)

### Convert from JSON/YAML source

[](#convert-from-jsonyaml-source)

```
$workflow = Workflow::fromJson(file_get_contents('workflow.json'));

$workflow = Workflow::fromYaml(file_get_contents('workflow.yaml'));

```

### Convert to JSON/YAML

[](#convert-to-jsonyaml)

```
$json = $workflow->toJson();

$yaml = $workflow->toYaml();

```

Validate
--------

[](#validate)

```
use Serverless\Workflow\WorkflowValidator;

WorkflowValidator::validate($workflow);

```

The `validate` method will raise an exception if the provided workflow does not comply with the specification.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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

Unknown

Total

1

Last Release

905d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cc4e03d21bee1d338a3d10c5002c2b13c7602825c20d436a9481a90254cac9a?d=identicon)[rmcdaniel](/maintainers/rmcdaniel)

---

Top Contributors

[![rmcdaniel](https://avatars.githubusercontent.com/u/1130888?v=4)](https://github.com/rmcdaniel "rmcdaniel (5 commits)")[![cdavernas](https://avatars.githubusercontent.com/u/16137162?v=4)](https://github.com/cdavernas "cdavernas (4 commits)")

---

Tags

cncfphpsdkserverlessserverless-workflowworkflow

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/serverlessworkflow-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/serverlessworkflow-sdk/health.svg)](https://phpackages.com/packages/serverlessworkflow-sdk)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[pumukit/pumukit

Media Portal

5714.0k37](/packages/pumukit-pumukit)[kadirov/api-starter-kit

443.9k](/packages/kadirov-api-starter-kit)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1714.8k8](/packages/2lenet-crudit-bundle)[easycorp/easyadmin-demo

EasyAdmin Demo Application

145.7k](/packages/easycorp-easyadmin-demo)

PHPackages © 2026

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