What is Long Tail?
The execution environment for everything your workflow waits on but doesn't control.
Durable workflows are excellent at causality. Real processes eventually reach a different kind of boundary, where the workflow can say what it needs but cannot decide how reality satisfies it. Long Tail owns that uncertainty until there is a resolution.
Two kinds of work
Causality is solved. Uncertainty is where processes stall.
Run this activity, then that activity, retry this operation, wait for that condition: durable engines handle all of it. What they leave to you is everything around a wait whose answer comes from outside the code.
Durable workflow
Owns causality
- Run this activity, then that one
- Retry with backoff
- Sleep until a time
- Wait for a signal
- Survive a crash and resume
Long Tail
Owns uncertainty
- Who should act, and with what authority
- What they see and what they may submit
- Who holds it right now, and until when
- What happens when time runs out
- Who answered, what they said, and when
The boundary
These aren't ordinary function calls.
A person must inspect something. A printer must become available. Twenty physical items must arrive. An AI result needs review. A machine lifecycle must finish. Another independently operating system must respond. The workflow can express what it needs. It cannot control how reality satisfies that need.
What problem it solves
Teams rebuild the same infrastructure around every wait.
Without a first-class boundary, each wait grows its own task table, its own status column, its own claim logic and its own dashboard. Long Tail makes the boundary first-class and ships every piece of it.
| What teams build | What Long Tail provides |
|---|---|
| Task tables | An escalation row per wait, minted inside the workflow checkpoint |
| Status columns | pending, claimed, resolved, expired and cancelled, maintained atomically |
| Queues | Roles. The queue is the role and permission lives in it |
| Assignments | assigned_to, pre-claims, and who resolved it on every row |
| Claims | Time-boxed locks with a resolve guard in the same statement |
| Timeouts | timeout: '72h' expires the row and resumes the workflow with false |
| Forms | A versioned JSON Schema on the role renders and validates the answer |
| RBAC | Role membership with read and write scope, enforced in SQL |
| Callbacks | Resolving the row resumes the waiting workflow in place |
| Metadata indexes | GIN-indexed facets you can search, claim and resolve by |
| Batch operations | Bulk claim, assign and resolve by query or by domain key |
| Audit trails | Intent at creation, outcome at settlement, every crossing in between |
| Dashboards | A role-scoped dashboard, pinned views, portals and kiosk stations |
| Reporting | Dwell, membership and per-entity timelines from the rows themselves |
The contract
Intent in. Resolution out.
The workflow provides an intent. Long Tail turns it into a searchable, operational escalation and manages everything necessary to resolve it. When reality has produced a sufficient answer, Long Tail returns the resolution and durable execution continues.
- 01Intent. A role, a deadline and the facts to route on. One crash-safe write.
- 02Escalation. Searchable, claimable, deadlined and role-gated, on every surface.
- 03Resolution. The typed answer,
falseon timeout,nullon cancel.
// 1. intent: the workflow says what it needs
const result = await conditional<{ passed: boolean; notes?: string }>(`inspect-${orderId}`, {
role: 'inspection',
metadata: { orderId, line: 'line-1' },
timeout: '4h',
});
// 2. escalation: Long Tail owns the wait until reality answers
// 3. resolution: durable execution continues with the answer
if (result === false) return escalateToSupervisor(orderId); // the deadline passed
if (result === null) return releaseHold(orderId); // the wait was cancelled
return result.passed ? ship(orderId) : rework(orderId, result.notes);What comes next
One boundary, every surface.
The scale of the unblock is the reach of that one row. A person resolves it in the dashboard. A service resolves it over HTTP. An operator resolves it from the terminal. An agent resolves it over MCP with exactly the access its person has. A machine resolves it over MQTT. The workflow never knows which, and never needs to.
Dashboard
Person
HTTP
Service
SDK
Service
CLI
Operator
MCP
Agent
MQTT
Machine
Agents get a place to ask
An agent calls escalate_and_wait like any other tool. A person answers in a validated form. The agent continues with a typed result.
Machines get a place to answer
A machine's reply over MQTT becomes the resolution of a row, with the same audit trail a person's submission leaves.
Repetition becomes a tool
Every settled row is a worked example. What a person resolves today, an agent handles tomorrow and a compiled tool runs next month.
Foundation
Built on the HotMesh durable engine. Workflows checkpoint every activity and resume after a crash.
Storage
PostgreSQL is the only required dependency. Rows, claims, facets and history all live there.
License
Source-available under Apache 2.0 with the Commons Clause. See the LICENSE file for terms.
Give your waits a home.
Five minutes from clone to your first resolved escalation.