durable-workflow/ai
Durable Workflow AI brings resilient, long-running AI workflows to Laravel. Define multi-step agents and pipelines in PHP with automatic retries, persisted state, and human-in-the-loop approvals, so AI tasks survive failures and run reliably in the background.
Architecture fit. The package targets a narrow but real problem: an agent session that spans sandbox provisioning, multiple tool/LLM calls, human approvals, and teardown can no longer be safely held open in a request or a single queued job. Durable workflow orchestration is the correct mechanism per the durable-execution guidance, and this package sits precisely at that boundary — it supplies the sandbox lifecycle layer (provision, snapshot, restore, lease, reclaim) on top of a workflow runtime rather than inventing one. For a Laravel application already running agents that execute untrusted code or drive browser sessions, the conceptual fit is high.
The practical fit is unchanged and now more clearly conditional. Release 2.0.0-rc.8 is explicitly a "prerelease artifact for Durable Workflow 2.0 validation" — meaning this package is co-versioned against a parent runtime that is itself pre-GA. The real architectural commitment is to the Durable Workflow 2.0 engine, its persistence schema, its replay determinism rules, and its versioning model, and we would be adopting all of that before its 2.0 line has shipped. With 1 star and 0 dependents, this remains a reference implementation of a pattern, not a proven integration surface. Treat the decision as "adopt a durable execution runtime, with this as an optional accelerator," not "add a Composer dependency" — and note that the runtime we would be adopting is at release-candidate maturity today.
Integration feasibility. Mechanically straightforward and unchanged: composer require, service-provider auto-discovery, publishable config and migrations for workflow/run history plus sandbox records, a registered queue routing boundary for workflow tasks versus activities, and pluggable sandbox providers behind an interface. The effort is not installation; it is restructuring agent code so that every LLM call, tool call, filesystem write, and sandbox operation becomes an activity with a derived idempotency key, while the workflow body stays deterministic and replay-safe. The RC designation adds one practical burden: no changelog, no migration notes, only a source commit hash. Every upgrade must be treated as a source diff review, which shifts cost from installation to ongoing diligence.
Technical risk. High, concentrated in four places:
rc.8 for a 2.0 line that validates against a parent runtime also pre-GA. Eight release candidates is a sign of active work but also of unsettled APIs. The parent package is the load-bearing component; if it stalls or reshapes its persistence schema before GA, we own both.now(), rand(), config(), or a fresh Eloquent read inside workflow code produces divergent history and unrecoverable runs in production, usually weeks after launch.Key questions for the maintainers.
2.0.0-rc.8 the intended production candidate, and what is the expected path and date to 2.0 GA for both this package and the parent runtime?rc.8 and later, or does each RC bump require draining in-flight runs? Is there a history schema version field?Stack fit. Assume PHP 8.2+, Laravel 11/12, MySQL or Postgres for durable history, and Redis for the queue. The package will want at least two task queues: one for workflow-task execution (deterministic, latency-sensitive, low concurrency) and one for activities (I/O-heavy, higher concurrency, separate worker pool). Horizon can run both, but they should be distinct supervisors so a slow sandbox call cannot starve workflow-task dispatch. If the team already runs agents synchronously in the request cycle or in single fat jobs, this is a genuine architectural change, not a swap.
Migration path. Greenfield is the sane assumption. If replacing ad-hoc ProvisionSandboxJob → RunAgentJob → TeardownJob chains, do not cut over: run the new workflow path in shadow for one non-critical use case, comparing outcomes and lifecycle timings against the existing job chain for two to four weeks. Critically, wrap the package behind an internal port — AgentSandboxOrchestrator with our own value objects — so the workflow engine and sandbox provider are both swappable if the dependency is abandoned or its schema shifts before GA.
Compatibility. Pin exact versions of both durable-workflow/ai and its parent runtime, and pin them together — this RC is defined by its parent-runtime pairing, so a loose constraint on either side is a live hazard. Record the source commit hash (b0a5e4a5c192974a1ed4cc75d77be07ada94ffba) alongside the version in your dependency ledger; it is currently the only traceable identifier in the release. Validate the workflow/task payload schema and history schema against a staging database restored from production before any upgrade, and capture a fixture set of representative run histories that you replay on every RC bump. Confirm queue driver semantics (visibility timeouts, retry behavior) match what the runtime expects; a mismatched Redis queue configuration produces duplicate workflow-task dispatch that looks like a replay bug. Confirm no conflict with existing migrations on shared tables — publish and review the migration files before running them.
Sequencing.
Maintenance. We inherit two pre-GA packages from a small organization with no adoption base, and the release we are evaluating ships without a changelog or migration notes. Budget for the possibility of vendoring or forking within twelve months, and for reading source diffs at each RC. Subscribe to releases, pin versions, log the source commit for every deployment, and keep a written upgrade procedure that includes draining or tolerating in-flight runs plus replay-testing representative histories. The internal port adapter is the insurance policy — it caps the blast radius of abandonment or schema churn at one file.
Support. Community-only, no SLA. Escalation is ourselves. This is acceptable for an internal agent platform where a stalled run is recoverable; it is not acceptable for anything customer-facing without an internal owner named in advance. The RC status raises the bar on that ownership: someone must be accountable for tracking the 2.0 line to GA and for each upgrade decision.
Scaling. Three independent ceilings: workflow-task throughput, activity concurrency, and sandbox provider quota. All three need explicit limits — durable fan-out will happily exhaust a downstream sandbox API just as fast as naive concurrency. Budget caps (iterations, elapsed time, spend per run) are mandatory, not optional; a durable infinite loop is still an infinite loop. Plan for history growth: long-lived agent runs with many messages require continue-as-new or an equivalent rollover, and large transcripts must live in object storage with an immutable reference plus integrity metadata recorded in history, not in the history itself. Record the package and runtime version on every run so that a failure can be attributed to a specific RC after the fact.
Failure modes to instrument and alert on.
durable-workflow/ai and the Durable Workflow runtime, which the release notes make explicit as a pairing. Detect via a boot-time version assertion in the service provider adapter and an alert on mismatch across the worker fleet.finally cleanup does not run. Requires the external lease expiry/reconciler, with an alert on leases past their deadline.Operate runs as a product surface: expose stable workflow/run identity, package/runtime version, business correlation key, current phase, pending timer/message/activity, attempt count, last failure, next retry time, and cancellation/compensation outcome in an internal admin view before going to production. Do not debug by editing runtime persistence.
Ramp-up. A senior engineer needs roughly one to two weeks to internalize replay discipline, effect idempotency, and compensation modeling, and the team needs a code-review checklist that blocks nondeterministic constructs inside workflow code. The failure mode is not a slow ramp — it is a fast ramp followed by subtle, production-only replay errors. Three guardrails make the difference: the worker-kill resume spike in the first week, replay tests in CI before the first production run, and a version-pinning/upgrade ritual that is followed from the first RC onward rather than invented after the first incident.
How can I help you explore Laravel packages today?