VIP-55: task and workflow, durable steps and the plan the compiler derives
Status: accepted by Will, 2026-11-23. Will: "55 I accept". The compiler parses and checks task and workflow declarations, which run on Experimental.Durable (currently behind "vibe": { "experimental": ["builtins"] } during alpha rollout until promoted). (Previously reopened 2026-11-11 awaiting Will's review.)
Will's words
Vibelang is meant to have most of the features of durable execution agents etc. built into it. What is that status? Are the VIP open or are VIP missing for things like adding llm calls or jev calls to language sandboxing durable execution etc?
Ok so give me a list of [the reference engine's] features. We need to figure out what the VIP should look like. Some of the features outside of durable execution likely should simply be in the standard library I'm guessing but we should enumerate all of them
Summary
One sentence. A task is one recorded step and a workflow is a plan over tasks, and the compiler derives each one's schemas, its declaration for the reference engine (an existing Effect durable-execution framework these built-ins are modelled on) and its static plan from code that reads like an ordinary Effect function.
One paragraph. VIP-44 says which values cross a durable boundary and promises task and workflow. This VIP defines them. A task body is ordinary Effect code that the engine records and retries. A workflow body is restricted Effect code that the compiler turns into a plan before anything runs: every try in it names a durable step, and everything else is pure. The compiler emits Action.make, Flow.make and Node combinators from the reference engine's flow and plan packages, and it writes the capture records the reference engine cannot check today, because JavaScript cannot inspect a closure and a compiler can. The runtime is std-durable.
source compile time run time
────── ──────────── ────────
task FetchIssues { call } ──► Action "triage#FetchIssues" ─┐
task LabelIssues { call } ──► Action "triage#LabelIssues" ─┼─► plan: nodes, edges, keys ──► engine journals each step
workflow Triage { call } ──► Flow "triage#Triage" ─┘ inspect it before it runs a restart skips finished stepsDecision
// proposed
schema Issues = ReadonlyArray<{ number: number; title: string }>
schema Labels { labels: ReadonlyArray<{ number: number; type: "bug" | "feature" | "question" | "chore" }> }
task FetchIssues {
static readonly retryPolicy = { initialMs: 1000, factor: 2, maxMs: 4000, maxAttempts: 3 }
effect call(repo: string): Issues!string {
return try mapError(effect {
const spawner = try ChildProcessSpawner.ChildProcessSpawner
const json = try spawner.string(ChildProcess.make("gh", ["issue", "list", "--repo", repo, "--json", "number,title"]))
return try Schema.decodeEffect(Schema.fromJsonString(Issues))(json)
}, (error) => error.message)
}
}
task LabelIssues {
effect call(issues: Issues): Labels!AiError.AiError {
const prompt = `Label each issue bug, feature, question or chore:\n${JSON.stringify(issues)}`
return (try LanguageModel.generateObject({ prompt, schema: Labels })).value
}
}
export workflow Triage {
effect call(repo: string) {
return try LabelIssues(try FetchIssues(repo))
}
}// proposed
export effect function main() {
provide Layer.provideMerge(Triage.layer, Experimental.Durable.memory) {
return try Triage("smithersai/vibelang") // the same input again joins the recorded run: nothing calls gh or the model
}
}The host also provides ChildProcessSpawner and a LanguageModel (std-model).
task
A task declaration has one call method and optional static readonly members.
effect call(params): A!E { … }is required. Its parameters,AandEare written out, because they are durable boundaries (VIP-44). The body is ordinary Effect code.- The annotation is the step's boundary, not the body's type. It states what a caller gets. The body may need services, and those become requirements of
T.layer, as a handler's do in the reference engine'sT.toLayer(handler). TheRslot ofcallis never written. - A
callwith no body declares a task whose implementation arrives as a layer:Charge.toLayer(effect (order) => { … }). Use it to swap an implementation in a test or to run it elsewhere. - Each
static readonlymember is oneAction.makeoption and keeps the reference engine's name. The compiler passes the value through and wrapsretryPolicyinRetryPolicy.make. - The compiler derives
payloadfrom the parameters, andsuccessanderrorfrom the return type. A type with no schema form isEK2109. T.layeris the implementation layer of a task that has a body.
| Member | Action.make option | Default |
|---|---|---|
key | The tag, the first argument | Derived: see below |
tier | "sealed", "compensable" or "irreversible" | "sealed" |
retryPolicy | { initialMs, factor, maxMs, maxAttempts?, expirationMs?, jitterRatio?, retryable?, nonRetryable? } | None: see below |
attemptTimeoutMs, heartbeatTimeoutMs | Bound one attempt | None |
idempotencyKey | A string, an object, or a function of the parameters | None |
implementationVersion | A string | Derived where the reference engine requires one |
capabilities, effects | The capability ceiling and effect envelope, as literals (capabilities) | The caller's |
cache | { ttlMs?, scope? }, the reference engine's Action.withCache | None |
placement | "local", { sandbox } or { remote: target }, the reference engine's Placement (workers-remote) | "local" |
nondeterministic, interruptRetryPolicy, fileBoundary, annotations | Passed through | None |
The tag is derived from the package and the name: "triage#FetchIssues" for task FetchIssues in package triage. A service key also includes the file (VIP-9). A durable tag does not, because it is stored: a tag that changed when a file moved would orphan every recorded run and repeat finished steps. Two declarations with one tag in a package are a compile error, and static readonly key settles it.
Retries follow the engine (engine/src/FlowEngine/Dispatch.ts). With a retryPolicy, every failure the policy admits is retried. With none, a typed failure is not retried. The engine still retries transient infrastructure faults, 5 seconds doubling to 5 minutes for 2 hours (RetryPolicy.transient), when repeating is safe: the task has an idempotencyKey, or it declares an effects envelope with no writes and is not irreversible. A policy is data, not a Schedule: the next delay comes from the persisted attempt count, so a backoff survives a restart. Effect's retry(effect, schedule) keeps its meaning and stays out of the journal.
implementationVersion is required by the reference engine for a sealed task with an idempotencyKey, because its result can be reused across runs. There the compiler defaults it to a digest of the body and the .vibe functions it calls, so reuse never serves a result that different code computed. A change to an injected service is invisible to that digest: write the member when one changes.
workflow
A workflow declaration has one effect call(params) { … } and optional static readonly members for Flow.make options: key, maxRounds, deadline, idempotencyKey, capabilities, effects, description, modelInvocable and suspendedRetryPolicy. The return type may be omitted: every leaf of the plan has a declared type.
The body is a plan. The compiler accepts these forms and refuses the rest:
| In a workflow body | Plan node (the reference engine's plan Node and flow API) |
|---|---|
try T(a, b), T a task | T.call({ a, b }) |
try W(a), W a workflow | W.call({ a }): W's steps join this plan |
try W.child(a) | W.child({ a }): W runs as its own execution, and this run waits |
return W.to(a) | W.to({ a }): this round ends and the next starts |
const x = try A(); try B(x.id) | Node.bindPlanned(A.call({}), (x) => B.call({ id: x.id })) |
try A(); try B() | Node.andThen(A.call({}), B.call({})) |
a pure expression over a result, x.items.length > 0 | Node.map(node, Node.capture(captures, (x) => x.items.length > 0)) |
if, ?:, &&, ||, ?? and match on a result | Node.branch(node, { if, then, else }), both arms stored |
try.all [A(), B()] | Node.all({ 0: A.call({}), 1: B.call({}) }) |
try.race [...], try.any [...] | Node.race, Node.any |
A() catch (e) => fallback, catch effect (e) => { … } | Node.catch(node, { onFailure }) |
for concurrent (const x of xs), xs from the parameters | Node.all over the list, fixed when the plan is built |
Rules:
- Statement order is a barrier.
try A(); try B()runs A, then B. Onlytry.allruns steps at once. A workflow body means what the same statements mean in aneffectfunction (principle 6). - The operand of
tryis a durable call: a task, a workflow,.child, a wait (durable-waits), ortry.all,try.raceandtry.anyover those.try sleep("1 second")is an error that namesExperimental.Durable.sleep. - Everything else is pure. A body reads its parameters and step results. It reads no service, clock, randomness or module-level
let. It may call a plain function declared in the project's.vibefiles, which the compiler checks for the same reads. Work that needs more is a task. - A step result is a reference until the step runs. An expression that reads one becomes a
Node.map, and a condition on one becomes aNode.branch. A condition on parameters alone is decided when the plan is built for that input. - No loops over step results, no reassignment, no recursion through
try W(…). A loop whose count depends on a step result is a lineage of rounds: the body ends withreturn W.to(next), andstatic readonly maxRoundsbounds it (flow/docs/concepts/trampoline-rounds.md). - Captures are complete. The compiler computes the free variables of every lowered callback and emits
Node.capture(captures, callback), with a digest of each plain function the callback calls. W.layeris the canonical composition:Interpreter.layerWithImplementations(W, …)overT.layerfor every task with a body that W's plan reaches. It registers against one isolated table, refuses a callback with no stable identity, and checks every step, untaken branches included, before the first dispatch. A task without a body stays a requirement in W's type. This is not VIP-24'swire: nothing is chosen, because a task with a body has one implementation.
Calling from Effect code
| Form | Meaning | Reference engine |
|---|---|---|
try W(a) | Run to completion. Equal input joins the run that input already started | W.execute({ a }) under Flow.derived |
spawn W(a) | Start or join that run and give a Run<A, E> at once | W.executionId({ a }), then W.execute({ a }, { executionId, discard: true }) |
try W.start(a) | Always start new work and give its Run | W.start({ a }) |
try run.result | Wait for the run | W.execute(payload, { executionId }) |
try run.poll | Option<Exit<A, E>>, none while it runs | W.poll(id) |
try run.cancel, try run.resume | Cancel or re-drive it | W.interrupt(id), W.resume(id) |
Experimental.Durable.run(W, id) | Rebuild a handle from a stored id | None: the handle is a value over id |
- Identity is VIP-44's. Equal inputs name one run, so a program that crashes and starts again resumes its run with no saved id.
static readonly idempotencyKeystates what "equal" means for one workflow. The reference engine's own default starts new work for equal inputs (Flow.fresh); the emitted layer installsFlow.derived, which sorts sets and maps as VIP-44 requires. spawnis reserved in Effect code, asforkandjoinare. VIP-44's examples already use it.try T(a)outside a workflow is an error: a task records into a run, and there is none.
What the compiler emits
For the example above, exactly this Effect TypeScript. It type-checks against the reference engine's flow and plan packages at 1.0.0-rc.16 on effect 4.1.1.
Clarified 2026-11-11: rc.16 declares an exact effect 4.0.5 peer, so this check installs effect 4.1.1 over that peer pin. An install that honors the pin is off VibeLang's Effect pin (VIP-32), so a published install needs the reference engine's next release, as std-durable says.
import { Action, Flow, Interpreter, RetryPolicy } from "@smthrs/flow"
import { Node } from "@smthrs/plan"
import { Effect, Layer, Schema } from "effect"
import { AiError, LanguageModel } from "effect/ai"
import { ChildProcess, ChildProcessSpawner } from "effect/process"
const Issues = Schema.Array(Schema.Struct({ number: Schema.mutableKey(Schema.Number), title: Schema.mutableKey(Schema.String) }))
const Labels = Schema.Struct({
labels: Schema.mutableKey(Schema.Array(Schema.Struct({
number: Schema.mutableKey(Schema.Number),
type: Schema.mutableKey(Schema.Literals(["bug", "feature", "question", "chore"]))
})))
})
export const FetchIssues = Action.make("triage#FetchIssues", {
payload: { repo: Schema.String },
success: Issues,
error: Schema.String,
retryPolicy: RetryPolicy.make({ initialMs: 1000, factor: 2, maxMs: 4000, maxAttempts: 3 })
})
export const LabelIssues = Action.make("triage#LabelIssues", {
payload: { issues: Issues },
success: Labels,
error: AiError.AiError
})
export const Triage = Flow.make("triage#Triage", {
payload: { repo: Schema.String },
success: Labels,
error: Schema.Union([Schema.String, AiError.AiError]),
body: Node.capture({}, ({ repo }: { readonly repo: string }) =>
Node.bindPlanned(FetchIssues.call({ repo }), (issues) => LabelIssues.call({ issues })))
})
export const TriageLayer = Layer.merge(
Flow.layerExecutionIds(Flow.derived),
Interpreter.layerWithImplementations(
Triage,
Layer.mergeAll(
FetchIssues.toLayer(({ repo }) =>
Effect.gen(function*() {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner
const json = yield* spawner.string(ChildProcess.make("gh", ["issue", "list", "--repo", repo, "--json", "number,title"]))
return yield* Schema.decodeEffect(Schema.fromJsonString(Issues))(json)
}).pipe(Effect.mapError((error) => error.message))
),
LabelIssues.toLayer(({ issues }) =>
Effect.gen(function*() {
const prompt = `Label each issue bug, feature, question or chore:\n${JSON.stringify(issues)}`
return (yield* LanguageModel.generateObject({ prompt, schema: Labels })).value
})
)
)
)
)Diagnostics
Codes are assigned when this VIP is built. Each row is one new diagnostic.
| Slug | When | The message names |
|---|---|---|
task-call | A task or workflow has no call, two of them, or a call that is not effect | The one allowed shape |
task-outside-workflow | try T(a) in Effect code that is not a workflow body | workflow, or a plain effect function |
durable-key | Two durable declarations in one package derive one tag | static readonly key |
workflow-try | try on something that is not a durable call | The durable form, such as Experimental.Durable.sleep |
workflow-impure | A body reads a service, the clock, randomness or a module let | Moving the read into a task |
workflow-loop | A loop or reassignment that depends on a step result | return W.to(next) and maxRounds |
workflow-recursion | try W(…) reaches W again | W.to or W.child |
handoff-position | W.to(…) anywhere but a return | The tail position |
retry-unbounded (warning) | A written retryPolicy has neither maxAttempts nor expirationMs | Both bounds. Such a policy never gives up |
A durable boundary type with no schema form stays EK2109.
Maintainers' decisions
This record comes from the 2026-11-09 built-in set review. The Status line above records Will’s subsequent ruling.
- The host also provides
ChildProcessSpawnerand aLanguageModel(std-model). Design · Review. - A
taskdeclaration has onecallmethod and optionalstatic readonlymembers. Design · Review. effect call(params): A!E { … }is required. Design · Review.- Its parameters,
AandEare written out, because they are durable boundaries (VIP-44). Design · Review. - The body is ordinary Effect code. Design · Review.
- The annotation is the step's boundary, not the body's type. It states what a caller gets. Design · Review.
- The body may need services, and those become requirements of
T.layer, as a handler's do in the reference engine'sT.toLayer(handler). Design · Review. - The
Rslot ofcallis never written. Design · Review. - A
callwith no body declares a task whose implementation arrives as a layer:Charge.toLayer(effect (order) => { … }). Design · Review. - Use it to swap an implementation in a test or to run it elsewhere. Design · Review.
- Each
static readonlymember is oneAction.makeoption and keeps the reference engine's name. Design · Review. - The compiler passes the value through and wraps
retryPolicyinRetryPolicy.make. Design · Review. - The compiler derives
payloadfrom the parameters, andsuccessanderrorfrom the return type. Design · Review. - A type with no schema form is
EK2109. Design · Review. T.layeris the implementation layer of a task that has a body. Design · Review.- Member
key:Action.makeoption: The tag, the first argument; Default: Derived: see below. Design · Review. - Member
tier:Action.makeoption:"sealed","compensable"or"irreversible"; Default:"sealed". Design · Review. - Member
retryPolicy:Action.makeoption:{ initialMs, factor, maxMs, maxAttempts?, expirationMs?, jitterRatio?, retryable?, nonRetryable? }; Default: None: see below. Design · Review. - Member
attemptTimeoutMs,heartbeatTimeoutMs:Action.makeoption: Bound one attempt; Default: None. Design · Review. - Member
idempotencyKey:Action.makeoption: A string, an object, or a function of the parameters; Default: None. Design · Review. - Member
implementationVersion:Action.makeoption: A string; Default: Derived where the reference engine requires one. Design · Review. - Member
capabilities,effects:Action.makeoption: The capability ceiling and effect envelope, as literals (capabilities); Default: The caller's. Design · Review. - Member
cache:Action.makeoption:{ ttlMs?, scope? }, the reference engine'sAction.withCache; Default: None. Design · Review. - Member
placement:Action.makeoption:"local",{ sandbox }or{ remote: target }, the reference engine'sPlacement(workers-remote); Default:"local". Design · Review. - Member
nondeterministic,interruptRetryPolicy,fileBoundary,annotations:Action.makeoption: Passed through; Default: None. Design · Review. - The tag is derived from the package and the name:
"triage#FetchIssues"fortask FetchIssuesin packagetriage. Design · Review. - A
servicekey also includes the file (VIP-9). Design · Review. - A durable tag does not, because it is stored: a tag that changed when a file moved would orphan every recorded run and repeat finished steps. Design · Review.
- Two declarations with one tag in a package are a compile error, and
static readonly keysettles it. Design · Review. - Retries follow the engine (
engine/src/FlowEngine/Dispatch.ts). Design · Review. - With a
retryPolicy, every failure the policy admits is retried. Design · Review. - With none, a typed failure is not retried. Design · Review.
- The engine still retries transient infrastructure faults, 5 seconds doubling to 5 minutes for 2 hours (
RetryPolicy.transient), when repeating is safe: the task has anidempotencyKey, or it declares aneffectsenvelope with no writes and is not irreversible. Design · Review. - A policy is data, not a
Schedule: the next delay comes from the persisted attempt count, so a backoff survives a restart. Design · Review. - Effect's
retry(effect, schedule)keeps its meaning and stays out of the journal. Design · Review. implementationVersionis required by the reference engine for a sealed task with anidempotencyKey, because its result can be reused across runs. Design · Review.- There the compiler defaults it to a digest of the body and the
.vibefunctions it calls, so reuse never serves a result that different code computed. Design · Review. - A change to an injected service is invisible to that digest: write the member when one changes. Design · Review.
- A
workflowdeclaration has oneeffect call(params) { … }and optionalstatic readonlymembers forFlow.makeoptions:key,maxRounds,deadline,idempotencyKey,capabilities,effects,description,modelInvocableandsuspendedRetryPolicy. Design · Review. - The return type may be omitted: every leaf of the plan has a declared type. Design · Review.
- The body is a plan. Design · Review.
- The compiler accepts these forms and refuses the rest: Design · Review.
- In a workflow body
try T(a, b),Ta task: Plan node (the reference engine's planNodeand flow API):T.call({ a, b }). Design · Review. - In a workflow body
try W(a),Wa workflow: Plan node (the reference engine's planNodeand flow API):W.call({ a }): W's steps join this plan. Design · Review. - In a workflow body
try W.child(a): Plan node (the reference engine's planNodeand flow API):W.child({ a }): W runs as its own execution, and this run waits. Design · Review. - In a workflow body
return W.to(a): Plan node (the reference engine's planNodeand flow API):W.to({ a }): this round ends and the next starts. Design · Review. - In a workflow body
const x = try A(); try B(x.id): Plan node (the reference engine's planNodeand flow API):Node.bindPlanned(A.call({}), (x) => B.call({ id: x.id })). Design · Review. - In a workflow body
try A(); try B(): Plan node (the reference engine's planNodeand flow API):Node.andThen(A.call({}), B.call({})). Design · Review. - In a workflow body a pure expression over a result,
x.items.length > 0: Plan node (the reference engine's planNodeand flow API):Node.map(node, Node.capture(captures, (x) => x.items.length > 0)). Design · Review. - In a workflow body
if,?:,&&,\|\|,??andmatchon a result: Plan node (the reference engine's planNodeand flow API):Node.branch(node, { if, then, else }), both arms stored. Design · Review. - In a workflow body
try.all [A(), B()]: Plan node (the reference engine's planNodeand flow API):Node.all({ 0: A.call({}), 1: B.call({}) }). Design · Review. - In a workflow body
try.race [...],try.any [...]: Plan node (the reference engine's planNodeand flow API):Node.race,Node.any. Design · Review. - In a workflow body
A() catch (e) => fallback,catch effect (e) => { … }: Plan node (the reference engine's planNodeand flow API):Node.catch(node, { onFailure }). Design · Review. - In a workflow body
for concurrent (const x of xs),xsfrom the parameters: Plan node (the reference engine's planNodeand flow API):Node.allover the list, fixed when the plan is built. Design · Review. - Rules: Design · Review.
- Statement order is a barrier.
try A(); try B()runs A, then B. Design · Review. - Only
try.allruns steps at once. Design · Review. - A workflow body means what the same statements mean in an
effectfunction (principle 6). Design · Review. - The operand of
tryis a durable call: a task, a workflow,.child, a wait (durable-waits), ortry.all,try.raceandtry.anyover those. Design · Review. try sleep("1 second")is an error that namesExperimental.Durable.sleep. Design · Review.- Everything else is pure. A body reads its parameters and step results. Design · Review.
- It reads no service, clock, randomness or module-level
let. Design · Review. - It may call a plain function declared in the project's
.vibefiles, which the compiler checks for the same reads. Design · Review. - Work that needs more is a task. Design · Review.
- A step result is a reference until the step runs. An expression that reads one becomes a
Node.map, and a condition on one becomes aNode.branch. Design · Review. - A condition on parameters alone is decided when the plan is built for that input. Design · Review.
- No loops over step results, no reassignment, no recursion through
try W(…). A loop whose count depends on a step result is a lineage of rounds: the body ends withreturn W.to(next), andstatic readonly maxRoundsbounds it (flow/docs/concepts/trampoline-rounds.md). Design · Review. - Captures are complete. The compiler computes the free variables of every lowered callback and emits
Node.capture(captures, callback), with a digest of each plain function the callback calls. Design · Review. W.layeris the canonical composition:Interpreter.layerWithImplementations(W, …)overT.layerfor every task with a body that W's plan reaches. Design · Review.- It registers against one isolated table, refuses a callback with no stable identity, and checks every step, untaken branches included, before the first dispatch. Design · Review.
- A task without a body stays a requirement in W's type. Design · Review.
- This is not VIP-24's
wire: nothing is chosen, because a task with a body has one implementation. Design · Review. - Form
try W(a): Meaning: Run to completion. Equal input joins the run that input already started; Reference engine:W.execute({ a })underFlow.derived. Design · Review. - Equal input joins the run that input already started |
W.execute({ a })underFlow.derived| Design · Review. - Form
spawn W(a): Meaning: Start or join that run and give aRun<A, E>at once; Reference engine:W.executionId({ a }), thenW.execute({ a }, { executionId, discard: true }). Design · Review. - Form
try W.start(a): Meaning: Always start new work and give itsRun; Reference engine:W.start({ a }). Design · Review. - Form
try run.result: Meaning: Wait for the run; Reference engine:W.execute(payload, { executionId }). Design · Review. - Form
try run.poll: Meaning:Option<Exit<A, E>>, none while it runs; Reference engine:W.poll(id). Design · Review. - Form
try run.cancel,try run.resume: Meaning: Cancel or re-drive it; Reference engine:W.interrupt(id),W.resume(id). Design · Review. - Form
Experimental.Durable.run(W, id): Meaning: Rebuild a handle from a stored id; Reference engine: None: the handle is a value overid. Design · Review. - Identity is VIP-44's. Equal inputs name one run, so a program that crashes and starts again resumes its run with no saved id. Design · Review.
static readonly idempotencyKeystates what "equal" means for one workflow. Design · Review.- The reference engine's own default starts new work for equal inputs (
Flow.fresh); the emitted layer installsFlow.derived, which sorts sets and maps as VIP-44 requires. Design · Review. spawnis reserved in Effect code, asforkandjoinare. Design · Review.- VIP-44's examples already use it. Design · Review.
try T(a)outside a workflow is an error: a task records into a run, and there is none. Design · Review.- For the example above, exactly this Effect TypeScript. Design · Review.
- It type-checks against the reference engine's flow and plan packages at 1.0.0-rc.16 on
effect4.1.1. Design · Review. - Codes are assigned when this VIP is built. Design · Review.
- Each row is one new diagnostic. Design · Review.
- Slug
task-call: When: Ataskorworkflowhas nocall, two of them, or acallthat is noteffect; The message names: The one allowed shape. Design · Review. - Slug
task-outside-workflow: When:try T(a)in Effect code that is not a workflow body; The message names:workflow, or a plaineffect function. Design · Review. - Slug
durable-key: When: Two durable declarations in one package derive one tag; The message names:static readonly key. Design · Review. - Slug
workflow-try: When:tryon something that is not a durable call; The message names: The durable form, such asExperimental.Durable.sleep. Design · Review. - Slug
workflow-impure: When: A body reads a service, the clock, randomness or a modulelet; The message names: Moving the read into a task. Design · Review. - Slug
workflow-loop: When: A loop or reassignment that depends on a step result; The message names:return W.to(next)andmaxRounds. Design · Review. - Slug
workflow-recursion: When:try W(…)reaches W again; The message names:W.toorW.child. Design · Review. - Slug
handoff-position: When:W.to(…)anywhere but areturn; The message names: The tail position. Design · Review. - Slug
retry-unbounded(warning): When: A writtenretryPolicyhas neithermaxAttemptsnorexpirationMs; The message names: Both bounds. Such a policy never gives up. Design · Review. - Such a policy never gives up | Design · Review.
- A durable boundary type with no schema form stays
EK2109. Design · Review.
Adopted review answers
- Keep
Experimental.Xnames under VIP-33. Promotion to a bare module name requires a later decision. Review question 1. - Repeat calls with the same input join the first run, per VIP-44. Triggers and
W.startcreate a second run. Review decision. - A workflow may not loop in v1; use bounded
W.torounds instead. Automatic lowering of loops is future work. Review decision.
Compared
The emitted program above is the same example in Effect TypeScript for the reference engine 1.x.
| Program | Tokens (o200k_base) | Lines |
|---|---|---|
| This VIP's example | 268 | 26 |
| Its emitted reference-engine TypeScript, written by hand | 547 | 56 |
The home page sample in reference-engine 1.x TypeScript, triage.ts | 442 | 40 |
lang/examples/problem/vibelang/triage.vibe, Vibe 0.0.13 on the reference engine | 413 | 39 |
The home page sample is shorter than the emitted program because it labels with AgentAction.make, which ships its own implementation and layer, and because it uses the low-level Interpreter.layer. This VIP's example writes the model call as a plain task.
Checked. The two call bodies and both schema lines compile unchanged as effect functions under vibelang 0.0.13, with their requirements written. The emitted program type-checks as shown. task, workflow, spawn and the static readonly members do not parse today.
Principles
- TypeScript-first. Bends.
taskandworkflowhave no TypeScript or TC39 form. They are spelled asserviceis: a class-shaped body, methods andstatic readonlymembers, so a TypeScript reader parses them on sight. - Effect-second. Bends, and says so. Effect has
effect/workflow, and Vibe 0.0.13 already hasWorkflowandActivityin scope. This VIP compiles to the reference engine's flow package, an Effect library, because VIP-44 already fixes the reference engine's identity pipeline and because Effect's engine replays a body and has no plan to inspect. - Optimized for agentic programs. A plan exists before a model is called, so a person or a budget can read the worst case first. A resumed run pays for no finished step.
- Highly forkable. The lowering table is one seam and the
static readonlypass-through is another. A fork that wants body replay replaces the table withWorkflow.makeandActivity.make. - Factory-first. Each table row is a spec test with its emitted code.
- One meaning per form.
trystill runs one Effect and gives its value, and statements still run in order. A workflow restricts what may followtry; it does not change whattrymeans. It bends twice: a workflow'seffect calllowers to a plan, not toEffect.gen, and a task'sA!Eannotation is its boundary, not its body's type. - Hand-written Effect. The emitted program is the reference-engine program a person would write, plus complete captures.
What this changes
- The grammar gains the contextual declaration keywords
taskandworkflow, andspawnas a reserved word in Effect code. - VIP-44's examples become real syntax.
- Specification chapter 18 says durable execution stays out of the language. It is rewritten.
- Effect's
Workflow,Activity,DurableClock,DurableDeferredandDurableQueuestay in scope as library modules. Nothing in this VIP uses them, and a lint flagsWorkflow.makein a file that declares aworkflow. - The reference engine gains nothing new for the lowering: every emitted call exists at
main@originbcf8076a4ff4. VIP-44's first three reference-engine changes landed there on 2026-11-09 (sortCollections, sorted derived ids, one payload identity).
Alternatives
- Replay the body, as Effect's workflow engine and Temporal do. Loops and mutation work. It loses the plan: no inspection before a run, no approval of a digest, and a changed body is found only when a replay diverges. This proposal uses a static plan.
- Keep it a library. That is today's 413-token program. Schemas are written twice, and
Node.capturerecords cannot be checked: "the library cannot prove that a capture declaration is complete" (flow/README.md). try T.call(a)as the call form. VIP-44's accepted examples call the declaration,try Release(source). In the reference engineT.call(payload)plans a step and runs nothing, so the same name undertrywould mean two things.- A required
idandversionon every declaration. It survives a file move and costs two lines a declaration. The derived tag survives the same move for nothing. durable(fn)as a compiler-known import, the earlier design. A call that changes meaning by where it was imported from is not explicit, and it has no place for a retry policy or a declared-only step.- Run independent steps at once without being asked. The earlier design did. It makes statement order mean two things.
Follow-up questions
- Run identity (decided). Equal inputs join one run under VIP-44; triggers and
W.startcreate a second run. See the Maintainers' decisions section. - Loops. This VIP refuses a loop over a step result and names
W.to. A later VIP may consider compilingwhileandforinto rounds, carrying the loop's variables as the next round's parameters? This remains future work after the first release. - Tasks inside tasks. A task body may not call a task in this VIP. The reference engine allows a nested inline action. Decide when the agent loop in std-agent needs it from user code.
spawn. A reserved word, or the methodW.ensure(a)? Recommendation:spawn. VIP-44 already shows it, and it reads asforkdoes.
Depends on
- VIP-44, accepted: values, identity, serialization.
- std-durable: the engine,
Experimental.Durable.memory,Run. - capabilities: the vocabulary behind
tier,capabilitiesandeffects.