Temporal's determinism rule forces the three-day wait out of your Laravel job class
A dev.to walkthrough hands a seven-day onboarding flow to a workflow engine on port 7233. The install is two lines; the part that reshapes your code is the rule that the orchestrator may never touch Eloquent.
The Engineer · Build desk
What happened
- The walkthrough works a six-step onboarding flow: welcome email, a three-day wait, a profile-picture check, a reminder, a further four-day wait, then flagging the account for manual sales outreach.
- Its argument against doing this in plain Laravel jobs is that you write database state tracking, several delayed dispatch loops and manual retry intervals, and lose the user's step position if a server reboots.
- Integration is a Composer install of the official Temporal PHP SDK plus a TEMPORAL_ADDRESS entry, which the tutorial points at 127.0.0.1:7233, the default for a local cluster.
- Code is split in two: deterministic workflows that coordinate steps and sleeps but may not touch databases, external systems or random functions, and activities that do the queries, emails and API calls.
Why it matters
- cost The bill adds a second durable system alongside the first: the Redis queues and supervisors already carrying ordinary jobs stay, and now an operations team owns a Temporal cluster too.
- constraint You cannot lift an existing Job class across. Anything that both waits and queries has to be cut along the determinism line first, which makes migration a refactor of the code you trust least.
- contradiction The prose sells queryable statuses and complex retries; the configuration shown sets one timeout. Anyone copying this file owns the retry policy and the status query themselves.
- decision The choice is per-flow, not platform-wide, and the author's own caveat about multi-day state machines is the line to draw it on.
The rule barring the orchestrator from databases, external systems and random functions [1] serves a specific mechanical purpose, not a stylistic one. Nothing about coordinating steps needs it. It only makes sense if that function is expected to run more than once against a recorded history, with each `yield` resolving from something the server already knows. That is the mechanism behind the promise of guaranteed state progression [15]: the wait stops being a delayed job in Redis and becomes an event the cluster owns, and the PHP worker holding the process becomes disposable.
The two timescales in the sample show the seam. The workflow method yields `Workflow::timer(CarbonInterval::days(3))` [7]. The activity stub is constructed with a single option, `withStartToCloseTimeout(CarbonInterval::seconds(30))`, under a comment that calls it retry settings [6]. Three days is 259,200 seconds, so the orchestrator's shortest wait is 8,640 times the ceiling on one activity attempt [11]. That ratio is the point. Nothing in the worker needs to survive the gap, which is exactly the property the hand-rolled version lacks when a server reboots mid-process [14].
Adoption lands in two places. The runtime: a Composer install [4] plus a cluster for `TEMPORAL_ADDRESS` to point at [5]. The walkthrough does not cost that cluster out, and if Redis queues and supervisors are already handling millions of ordinary jobs for you [12], this is a second durable system rather than a replacement. The code: activities keep `User::findOrFail` and the `Mail` facade, resolved through Laravel's container [8], while the workflow keeps the timers and the branch [2]. Any existing job class that both sleeps and queries has to be cut along that line before it can move.
Then read the listing against the claim. Temporal is described as handling state persistence, timeouts, queryable statuses and complex retries [15]. The published code stops mid-identifier at `checkProfileS` [9], so the second timer and the sales-outreach escalation described in the flow [3] exist only in prose. Given the article's subject is keeping track of a user's progress through a flow, that gap is an ironic failure mode to leave hanging.
What would have to be true for this to transfer to your system: the requirement is that a single unit of work outlive a deploy, and a thirty-second email send falls well short of that bar. The seven days of elapsed waiting in this onboarding arc [10] cross at least one release, probably several, and every one of them is a chance to lose the row that says which step a given user reached. That is the threshold I would use, and it is narrower than the framing here suggests. The author's own opening concedes it: standard queues only start to show limits when the work becomes a multi-day, retry-sensitive state machine [13]. Below that line, the delayed dispatch you already run is cheaper than a new cluster plus a determinism rule you have to teach the team.
What to watch
- Whether the remainder of the workflow is published, including the second timer, the escalation step and the worker command that registers these classes.
- A concrete retry policy in the sample: attempt counts and backoff, rather than a lone start-to-close timeout under a comment about retries.
- Any figure for what running a Temporal cluster costs alongside existing Redis workers, which this walkthrough leaves out.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence44
- Adoption
- Insufficient
- Hype gap+21
- Incentives
- Insufficient
- Confidence33
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
Workflows are the orchestrator and must be deterministic: they dictate execution flow, handle sleep intervals and coordinate steps, and must not interact directly with external systems, databases or random functions.
- [2]
Activities are the execution layer, may be non-deterministic, and perform the actual work such as database queries, third-party API calls, sending emails and writing files.
- [3]
The example onboarding flow is: send a welcome email; wait 3 days; check whether the user uploaded a profile picture; if not, send a reminder; wait another 4 days; if still incomplete, flag the account for manual sales outreach.
- [4]
The official Temporal PHP SDK is installed with composer require temporal/sdk.
- [5]
The environment is configured with TEMPORAL_ADDRESS=127.0.0.1:7233 in .env, and a local Temporal installation runs on port 7233 by default.
- [6]
The workflow constructor calls Workflow::newActivityStub on the activities interface with ActivityOptions::new()->withStartToCloseTimeout(CarbonInterval::seconds(30)), under a code comment describing it as binding the activities interface with retry settings; no retry policy or query method appears in the listing.
- [7]
The workflow method yields activity calls and yields Workflow::timer(CarbonInterval::days(3)) for the three-day wait.
- [8]
The activity implementation uses Laravel's dependency injection container and standard Laravel logic, including User::findOrFail and the Mail facade sending WelcomeMail and ReminderMail.
- [9]
The published code listing terminates mid-identifier at checkProfileS, so the second timer and the manual sales outreach step described in the flow are not shown in code.
- [10]
The onboarding flow spans seven days of elapsed waiting.
- [11]
The workflow's three-day timer is 259,200 seconds, which is 8,640 times the 30-second start-to-close timeout configured for a single activity attempt.
- [12]
Laravel's queue system with Redis-backed queues and supervisors can handle millions of standard jobs efficiently.
- [13]
The author states that standard Laravel queues begin to show limits when background processing evolves into complex, multi-day, retry-sensitive state machines.
- [14]
Implementing that flow with standard Laravel jobs requires complex database state tracking, multiple delayed dispatch loops and manual retry intervals, and if a server reboots mid-process, tracking which step a user was on becomes an operational nightmare.
- [15]
Temporal is described as a workflow orchestration engine that guarantees state progression and handles state persistence, timeouts, queryable statuses and complex retries while the developer writes standard PHP code.
Get this ledger inside ChatGPT. Ask about any of our stories and the answer brings its figure, each claim’s verdict and the sources. Free, no account.
Sources
1 independent publisher whose own reporting we read for this story.
- dev.toDistributed Background Processing: Scaling Temporal Workflows with Laravel
1 article · August 29, 2026
Topics and entities
Follow any of these and your For You feed starts watching them — no settings page required.
Topics
- Deterministic Code ConstraintsFollow
- Laravel Background ProcessingFollow
- PHP Developer ToolingFollow
- Workflow OrchestrationFollow