PHPackages                             aws-swf/fluent - 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. aws-swf/fluent

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

aws-swf/fluent
==============

Glue code around aws-sdk-php to allow fluent workflows definition

91.6k8[3 issues](https://github.com/cbalan/aws-swf-fluent-php/issues)[2 PRs](https://github.com/cbalan/aws-swf-fluent-php/pulls)PHP

Since Jul 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/cbalan/aws-swf-fluent-php)[ Packagist](https://packagist.org/packages/aws-swf/fluent)[ RSS](/packages/aws-swf-fluent/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

aws-swf-fluent-php
==================

[](#aws-swf-fluent-php)

Glue code around aws-sdk-php simple workflow api(Aws\\Swf) to allow fluent workflows definition. Feedback is welcome.

Features
--------

[](#features)

- Fluent workflow definition
- Transparent domain / workflow type / activity type basic registration
- Basic support for activities, decision tasks and child workflows.

To be implemented / outstanding
-------------------------------

[](#to-be-implemented--outstanding)

- Timer support
- Signal support
- Activity/workflow timeouts support
- ContinueAsNew workflow support
- Workflow/activity cancelation support
- Improved domain/workflow/activity registration

AWS Simple workflow documentation:
----------------------------------

[](#aws-simple-workflow-documentation)

-
-
-

Getting Started
---------------

[](#getting-started)

1. Sign up for AWS -
2. Install **aws-swf/fluent** - Using [Composer](http://getcomposer.org) is the recommended way to install this library. **aws-swf/fluent** is available via [Packagist](http://packagist.org) under the [`aws-swf/fluent`](https://packagist.org/packages/aws-swf/fluent) package.
3. Add your workflows definitions in the same manner as QuickSimpleDomain listed below
4. Create long running scripts for decision and activity workers
5. Add startWorkflowExecution calls in your php application

Quick Example
-------------

[](#quick-example)

### Three steps workflow with decision task

[](#three-steps-workflow-with-decision-task)

```
class QuickSimpleDomain extends Aws\Swf\Fluent\Domain {

    /**
     * Simple workflow domain configuration.
     *
     * Mandatory swf objects to be defined here:
     *  - swf domain name using setDomainName method
     *  - swf workflows using addWorkflow method
     *  - actions using workflow's 'to'/registerTask method
     */
    protected function configure() {
        // set swf client
        $domain->setSwfClient(Aws\Swf\SwfClient::factory(array(
            'key' => 'AWS key',
            'secret' => 'AWS secret key',
            'region' => 'us-east-1'
        )));

        // set domain name
        $this->setDomainName('threeStepsZenDomain');

        /**
         * threeStepsZen workflow :
         *  - on start, execute stepOne
         *  - if stepOne failed, execute stepFour. See evaluateStepOneResult method
         *  - if stepOne succeeded, execute stepTwo
         *  - if stepTwo succeeded, execute stepThree
         *
         * On any unhandled exception, workflow execution will terminate
         * with FAIL_WORKFLOW_EXECUTION decision.
         * Decision tasks can catch/handle previous activity fail/success.
         */
        $this->addWorkflow('threeStepsZen')
            ->to('activity://stepOne')
            ->to('decision://evaluateStepOneResult')
            ->to('activity://stepTwo')
            ->to('activity://stepThree')
            ->registerTask('activity://stepFour', array('comment' => 'Optional step 4'));

        $this->addWorkflow('secondWorkflow')
            ->to('activity://stepBeforeChildWorkflow')
            ->to('childWorkflow://threeStepsZen')
            ->to('activity://stepAfterChildWorkflow');

    }

    public function stepOne($context)   { /* do something on activity workers.*/ }

    public function evaluateStepOneResult($context, $decisionHint) {
        $lastEvent = $decisionHint->getLastEvent();
        if ($lastEvent['eventType'] == Aws\Swf\Enum\EventType::ACTIVITY_TASK_FAILED) {
            $decisionHint->setItem($this->getActivity('stepFour'));
            $decisionHint->setDecisionType(Aws\Swf\Enum\DecisionType::SCHEDULE_ACTIVITY_TASK);
        }
    }

    public function stepTwo($context)   { /* do something on activity workers.*/ }

    public function stepThree($context) { /* do something on activity workers.*/ }

    public function stepFour($context)  { /* do something on activity workers.*/ }

    public function stepBeforeChildWorkflow($context)  { /* do something on activity workers.*/ }

    public function stepAfterChildWorkflow($context)  { /* do something on activity workers.*/ }
}
```

decision-worker.php

```
$domain = new QuickSimpleDomain();
$domain->pollForDecisionTask();
```

activity-worker.php

```
$domain = new QuickSimpleDomain();
$domain->pollForActivityTask();
```

Start a workflow execution

```
$domain = new QuickSimpleDomain();
$domain->startWorkflowExecution('threeStepsZen', 5);
```

### More examples

[](#more-examples)

See examples folder for more details

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/191497?v=4)[Catalin Balan](/maintainers/cbalan)[@cbalan](https://github.com/cbalan)

---

Top Contributors

[![cbalan](https://avatars.githubusercontent.com/u/191497?v=4)](https://github.com/cbalan "cbalan (40 commits)")

### Embed Badge

![Health badge](/badges/aws-swf-fluent/health.svg)

```
[![Health](https://phpackages.com/badges/aws-swf-fluent/health.svg)](https://phpackages.com/packages/aws-swf-fluent)
```

###  Alternatives

[xajax/xajax

Xajax is an open source PHP class library for easily creating powerful PHP-driven, web-based Ajax Applications. Using Xajax, you can asynchronously call PHP functions and update the content of your your webpage without reloading the page.

20510.7k](/packages/xajax-xajax)

PHPackages © 2026

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