PHPackages                             temporal-php/support - 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. temporal-php/support

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

temporal-php/support
====================

Helpers that simplify working with the Temporal PHP SDK

1.1.0(8mo ago)1115.3k↓36%1[6 issues](https://github.com/temporal-php/support/issues)MITPHPPHP &gt;=8.1CI failing

Since Jan 22Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/temporal-php/support)[ Packagist](https://packagist.org/packages/temporal-php/support)[ Patreon](https://patreon.com/roxblnfk)[ RSS](/packages/temporal-php-support/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Temporal PHP Support
====================

[](#temporal-php-support)

Enhance your development experience with Temporal

The package includes attributes, helpers, factories, interfaces, interceptors, etc. to enhance the developer experience when using the [Temporal PHP SDK](https://github.com/temporalio/sdk-php).

- [Installation](#installation)
- [Usage](#usage)
    - [Factories](#factories)
    - [Attributes](#attributes)
    - [VirtualPromise interface](#virtualpromise-interface)
- [Contributing](#contributing)

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

[](#installation)

To install the package in your PHP application, add it as a dev dependency to your project using Composer:

```
composer require temporal-php/support
```

[![PHP](https://camo.githubusercontent.com/d73058e0ee11bacb71e4fa70add8be913b48d1522297fe3ceb6536faee353603/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f74656d706f72616c2d7068702f737570706f72742e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://packagist.org/packages/temporal-php/support)[![Latest Version on Packagist](https://camo.githubusercontent.com/a95d543e3f41d770ea766c17284298dd1397626564ddd093c92e17dcf844c367/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74656d706f72616c2d7068702f737570706f72742e7376673f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374)](https://packagist.org/packages/temporal-php/support)[![License](https://camo.githubusercontent.com/dcf80be0d57659c2bbe998de3e820f9ba32a484d1e69901c3e512fe089293138/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74656d706f72616c2d7068702f737570706f72742e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/525848713c558a4b0ddd67cebf8c6ae3ac4f4cfa78d66a2b0e0675678b8b7d31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74656d706f72616c2d7068702f737570706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/temporal-php/support)

Usage
-----

[](#usage)

### Factories

[](#factories)

The package provides factories to create Activity and Worker stubs in a more convenient way. With these factories, there is less code because all nested options are moved to the parameters of one method.

Use the `\Temporal\Support\Factory\ActivityStub` factory to create an Activity stub:

```
use \Temporal\Support\Factory\ActivityStub;

#[\Temporal\Workflow\WorkflowInterface]
class HelloWorkflow {
    #[\Temporal\Workflow\WorkflowMethod]
    public function run(string $user) {
        yield ActivityStub::activity(
            class: UserService::class,
            startToCloseTimeout: 60,
            retryAttempts: 5,
        )->getContactEmail($user)->then(
            fn (string $email) => ActivityStub::activity(
                class: HelloService::class,
                startToCloseTimeout: '10 minutes',
                retryAttempts: 5,
            )->sendHelloEmail($user, $email),
        );
    }
}
```

Use the `\Temporal\Support\Factory\WorkflowStub` factory to create a Workflow stub in a client scope:

```
use \Temporal\Support\Factory\WorkflowStub;
/**
 * @var \Temporal\Client\WorkflowClient $client
 */
$stub = WorkflowStub::workflow($client, HelloWorkflow::class, executionTimeout: '1 day');
$run = $client->start($stub, 'User');
// ...
```

Or create a Child Workflow stub in a workflow scope:

```
use \Temporal\Support\Factory\WorkflowStub;

#[\Temporal\Workflow\WorkflowInterface]
class RegisterWorkflow {
    #[\Temporal\Workflow\WorkflowMethod]
    public function run(string $user) {
        yield \Temporal\Promise::all([
            WorkflowStub::childWorkflow(GreetingWorkflow::class, executionTimeout: '1 hour')->greet($user),
            WorkflowStub::childWorkflow(SubscribeNewsWorkflow::class, executionTimeout: '10 minutes')->subscribe($user),
            WorkflowStub::childWorkflow(PrepareUserSpaceWorkflow::class, executionTimeout: '1 hour')->handle($user),
        ])->then(
            // Suppress failures
            onRejected: static fn () => null,
        );

        // ...
    }
}
```

### Attributes

[](#attributes)

Attributes can be used on Workflow or Activity definitions to set default stub options.

```
#[\Temporal\Support\Attribute\TaskQueue('my-task-queue')]
#[\Temporal\Support\Attribute\RetryPolicy(attempts: 5)]
#[WorkflowInterface]
interface HelloWorkflow {
    #[WorkflowMethod]
    public function greet(string $name);
}

$stub = \Temporal\Support\Factory\WorkflowStub::workflow($client, HelloWorkflow::class);

// TaskQueue is now set to 'my-task-queue' and RetryPolicy to 5 attempts
$stub->greet('User');

// You can override the default options
$stub = \Temporal\Support\Factory\WorkflowStub::workflow(
    $client,
    HelloWorkflow::class,
    taskQueue: 'another-task-queue',
    retryAttempts: 1,
)->greet('User');
```

Note

Attributes will work only if you use the Activity and Worker factories from this package.

Warning

Use attributes on the definitions that you use in factories. So, if you separate interfaces and implementation, apply attributes to the interfaces.

### VirtualPromise interface

[](#virtualpromise-interface)

Every time we use `yield` in a Workflow to wait for an action to complete, a Promise is actually yielded. At this point, the IDE and static analyzer usually get lost in type definitions, and we experience difficulties and inconveniences because of this. However, if the Promise interface had the `@yield` annotation, we could explain to the IDE what type of value we expect to be sent back into the generator from the coroutine. Since ReactPHP [isn't yet planning](https://github.com/orgs/reactphp/discussions/536)to add the `@yield` annotation to their promises (Temporal PHP uses ReactPHP promises), we suggest using our solution for typing - `VirtualPromise`.

```
use Temporal\Support\VirtualPromise;

#[\Temporal\Activity\ActivityInterface]
class HelloService {
    /**
     * @param non-empty-string $name
     *
     * @return VirtualPromise
     */
    public function greet(string $name) {
        // ...
    }
}

#[\Temporal\Workflow\WorkflowInterface]
class WorkflowClass {
    #[\Temporal\Workflow\WorkflowMethod]
    public function run(string $name) {
        $activity = \Temporal\Support\Factory\ActivityStub::activity(HelloService::class);

        // IDE will know that $name is a non-empty-string
        $name = yield $activity->greet($name);
        // ...
    }
}
```

Warning

don't implement the `VirtualPromise` interface yourself, use it only as a type hint.

Note

PHPStorm and Psalm can handle the `@yield` annotation, but PHPStan can't yet ([issue](https://github.com/phpstan/phpstan/issues/4245)).

Contributing
------------

[](#contributing)

We believe in the power of community-driven development. Here's how you can contribute:

- **Report Bugs:** Encounter a glitch? Let us know on our [issue tracker](https://github.com/temporal-php/support/issues).
- **Feature Suggestions:** Have ideas to improve the package? [Create a feature request](https://github.com/temporal-php/support/issues)!
- **Code Contributions:** Submit a pull request to help us improve the codebase. You can find a list of issues labeled "help wanted" [here](https://github.com/temporal-php/support/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
- **Spread the Word:** Share your experience with the package on social media and encourage others to contribute.
- **Donate:** Support our work by becoming a patron or making a one-time donation
    [![roxblnfk](https://camo.githubusercontent.com/6ff17d1a6216ba861d8cc9b992600ebce31e6da90336a7064e83d75e02116a7a/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246736869656c6473696f2d70617472656f6e2e76657263656c2e617070253246617069253346757365726e616d65253344726f78626c6e666b25323674797065253344706174726f6e73266c6162656c3d726f78626c6e666b267374796c653d666c61742d737175617265)](https://patreon.com/roxblnfk)[![butschster](https://camo.githubusercontent.com/d306d9d34f326ec99ff9f7dff9063e1e399720f4a28857b2b3706839a301a4d0/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246736869656c6473696f2d70617472656f6e2e76657263656c2e617070253246617069253346757365726e616d652533446275747363687374657225323674797065253344706174726f6e73266c6162656c3d62757473636873746572267374796c653d666c61742d737175617265)](https://patreon.com/butschster)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance50

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~200 days

Total

4

Last Release

248d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/110fa17dca123e71e4ef4132d1d6a66d20058a07fc6118e716dd67dd4316e886?d=identicon)[roxblnfk](/maintainers/roxblnfk)

---

Top Contributors

[![roxblnfk](https://avatars.githubusercontent.com/u/4152481?v=4)](https://github.com/roxblnfk "roxblnfk (28 commits)")

---

Tags

dxhelpersphpsupporttemporalhelpertemporal

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/temporal-php-support/health.svg)

```
[![Health](https://phpackages.com/badges/temporal-php-support/health.svg)](https://phpackages.com/packages/temporal-php-support)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[bryanjhv/slim-session

Session middleware and helper for Slim framework 4.

233961.5k16](/packages/bryanjhv-slim-session)[laravelista/ekko

Framework agnostic PHP package for marking navigation items active.

278673.4k4](/packages/laravelista-ekko)[beste/json

A simple JSON helper to decode and encode JSON

4222.7M3](/packages/beste-json)[chillerlan/php-settings-container

A container class for immutable settings objects. Not a DI container.

3427.3M21](/packages/chillerlan-php-settings-container)[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

883.0M29](/packages/kartik-v-yii2-helpers)

PHPackages © 2026

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