PHPackages                             ruudk/absurd-php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ruudk/absurd-php-sdk

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

ruudk/absurd-php-sdk
====================

PHP SDK for Absurd: a Durable Execution Engine for Postgres

0.1.2(3mo ago)381[3 PRs](https://github.com/ruudk/absurd-php-sdk/pulls)MITPHPPHP ^8.4CI passing

Since Jan 18Pushed 1mo ago2 watchersCompare

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

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

Absurd SDK for PHP
==================

[](#absurd-sdk-for-php)

PHP SDK for [Absurd](https://github.com/earendil-works/absurd): a PostgreSQL-based durable task execution system.

Absurd is the simplest durable execution workflow system you can think of. It's entirely based on Postgres and nothing else. It's almost as easy to use as a queue, but it handles scheduling and retries, and it does all of that without needing any other services to run in addition to Postgres.

**Warning:** *This is an early experiment and should not be used in production.*

What is Durable Execution?
--------------------------

[](#what-is-durable-execution)

Durable execution (or durable workflows) is a way to run long-lived, reliable functions that can survive crashes, restarts, and network failures without losing state or duplicating work. Instead of running your logic in memory, a durable execution system decomposes a task into smaller pieces (step functions) and records every step and decision.

How It Works
------------

[](#how-it-works)

This SDK uses [PHP Fibers](https://www.php.net/manual/en/language.fibers.php) to provide a clean, synchronous-looking API for durable workflows. When you call methods like `$ctx->step()`, `$ctx->awaitEvent()`, or `$ctx->sleepFor()`, the Fiber suspends execution, allowing the SDK to checkpoint progress to the database. When the task resumes (after a crash, timeout, or event), execution continues from exactly where it left off.

This means you can write workflow code that looks like normal sequential PHP code, while the SDK handles all the complexity of persistence, retries, and resumption behind the scenes.

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

[](#installation)

```
composer require ruudk/absurd-php-sdk
```

Quick Start
-----------

[](#quick-start)

```
