Skip to content

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 steps

Decision

// 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, A and E are 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's T.toLayer(handler). The R slot of call is never written.
  • A call with 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 readonly member is one Action.make option and keeps the reference engine's name. The compiler passes the value through and wraps retryPolicy in RetryPolicy.make.
  • The compiler derives payload from the parameters, and success and error from the return type. A type with no schema form is EK2109.
  • T.layer is the implementation layer of a task that has a body.
MemberAction.make optionDefault
keyThe tag, the first argumentDerived: see below
tier"sealed", "compensable" or "irreversible""sealed"
retryPolicy{ initialMs, factor, maxMs, maxAttempts?, expirationMs?, jitterRatio?, retryable?, nonRetryable? }None: see below
attemptTimeoutMs, heartbeatTimeoutMsBound one attemptNone
idempotencyKeyA string, an object, or a function of the parametersNone
implementationVersionA stringDerived where the reference engine requires one
capabilities, effectsThe capability ceiling and effect envelope, as literals (capabilities)The caller's
cache{ ttlMs?, scope? }, the reference engine's Action.withCacheNone
placement"local", { sandbox } or { remote: target }, the reference engine's Placement (workers-remote)"local"
nondeterministic, interruptRetryPolicy, fileBoundary, annotationsPassed throughNone

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 bodyPlan node (the reference engine's plan Node and flow API)
try T(a, b), T a taskT.call({ a, b })
try W(a), W a workflowW.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 > 0Node.map(node, Node.capture(captures, (x) => x.items.length > 0))
if, ?:, &&, ||, ?? and match on a resultNode.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 parametersNode.all over the list, fixed when the plan is built

Rules:

  1. Statement order is a barrier. try A(); try B() runs A, then B. Only try.all runs steps at once. A workflow body means what the same statements mean in an effect function (principle 6).
  2. The operand of try is a durable call: a task, a workflow, .child, a wait (durable-waits), or try.all, try.race and try.any over those. try sleep("1 second") is an error that names Experimental.Durable.sleep.
  3. 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 .vibe files, which the compiler checks for the same reads. Work that needs more is a task.
  4. 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 a Node.branch. A condition on parameters alone is decided when the plan is built for that input.
  5. 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 with return W.to(next), and static readonly maxRounds bounds it (flow/docs/concepts/trampoline-rounds.md).
  6. 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.
  7. W.layer is the canonical composition: Interpreter.layerWithImplementations(W, …) over T.layer for 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's wire: nothing is chosen, because a task with a body has one implementation.

Calling from Effect code

FormMeaningReference engine
try W(a)Run to completion. Equal input joins the run that input already startedW.execute({ a }) under Flow.derived
spawn W(a)Start or join that run and give a Run<A, E> at onceW.executionId({ a }), then W.execute({ a }, { executionId, discard: true })
try W.start(a)Always start new work and give its RunW.start({ a })
try run.resultWait for the runW.execute(payload, { executionId })
try run.pollOption<Exit<A, E>>, none while it runsW.poll(id)
try run.cancel, try run.resumeCancel or re-drive itW.interrupt(id), W.resume(id)
Experimental.Durable.run(W, id)Rebuild a handle from a stored idNone: 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 idempotencyKey states what "equal" means for one workflow. The reference engine's own default starts new work for equal inputs (Flow.fresh); the emitted layer installs Flow.derived, which sorts sets and maps as VIP-44 requires.
  • spawn is reserved in Effect code, as fork and join are. 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.

SlugWhenThe message names
task-callA task or workflow has no call, two of them, or a call that is not effectThe one allowed shape
task-outside-workflowtry T(a) in Effect code that is not a workflow bodyworkflow, or a plain effect function
durable-keyTwo durable declarations in one package derive one tagstatic readonly key
workflow-trytry on something that is not a durable callThe durable form, such as Experimental.Durable.sleep
workflow-impureA body reads a service, the clock, randomness or a module letMoving the read into a task
workflow-loopA loop or reassignment that depends on a step resultreturn W.to(next) and maxRounds
workflow-recursiontry W(…) reaches W againW.to or W.child
handoff-positionW.to(…) anywhere but a returnThe tail position
retry-unbounded (warning)A written retryPolicy has neither maxAttempts nor expirationMsBoth 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 ChildProcessSpawner and a LanguageModel (std-model). Design · Review.
  • A task declaration has one call method and optional static readonly members. Design · Review.
  • effect call(params): A!E { … } is required. Design · Review.
  • Its parameters, A and E are 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's T.toLayer(handler). Design · Review.
  • The R slot of call is never written. Design · Review.
  • A call with 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 readonly member is one Action.make option and keeps the reference engine's name. Design · Review.
  • The compiler passes the value through and wraps retryPolicy in RetryPolicy.make. Design · Review.
  • The compiler derives payload from the parameters, and success and error from the return type. Design · Review.
  • A type with no schema form is EK2109. Design · Review.
  • T.layer is the implementation layer of a task that has a body. Design · Review.
  • Member key: Action.make option: The tag, the first argument; Default: Derived: see below. Design · Review.
  • Member tier: Action.make option: "sealed", "compensable" or "irreversible"; Default: "sealed". Design · Review.
  • Member retryPolicy: Action.make option: { initialMs, factor, maxMs, maxAttempts?, expirationMs?, jitterRatio?, retryable?, nonRetryable? }; Default: None: see below. Design · Review.
  • Member attemptTimeoutMs, heartbeatTimeoutMs: Action.make option: Bound one attempt; Default: None. Design · Review.
  • Member idempotencyKey: Action.make option: A string, an object, or a function of the parameters; Default: None. Design · Review.
  • Member implementationVersion: Action.make option: A string; Default: Derived where the reference engine requires one. Design · Review.
  • Member capabilities, effects: Action.make option: The capability ceiling and effect envelope, as literals (capabilities); Default: The caller's. Design · Review.
  • Member cache: Action.make option: { ttlMs?, scope? }, the reference engine's Action.withCache; Default: None. Design · Review.
  • Member placement: Action.make option: "local", { sandbox } or { remote: target }, the reference engine's Placement (workers-remote); Default: "local". Design · Review.
  • Member nondeterministic, interruptRetryPolicy, fileBoundary, annotations: Action.make option: Passed through; Default: None. Design · Review.
  • The tag is derived from the package and the name: "triage#FetchIssues" for task FetchIssues in package triage. Design · Review.
  • A service key 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 key settles 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 an idempotencyKey, or it declares an effects envelope 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.
  • implementationVersion is required by the reference engine for a sealed task with an idempotencyKey, because its result can be reused across runs. Design · Review.
  • 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. Design · Review.
  • A change to an injected service is invisible to that digest: write the member when one changes. Design · Review.
  • 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. 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), T a task: Plan node (the reference engine's plan Node and flow API): T.call({ a, b }). Design · Review.
  • In a workflow body try W(a), W a workflow: Plan node (the reference engine's plan Node and 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 plan Node and 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 plan Node and 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 plan Node and 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 plan Node and 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 plan Node and flow API): Node.map(node, Node.capture(captures, (x) => x.items.length > 0)). Design · Review.
  • In a workflow body if, ?:, &&, \|\|, ?? and match on a result: Plan node (the reference engine's plan Node and 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 plan Node and 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 plan Node and 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 plan Node and flow API): Node.catch(node, { onFailure }). Design · Review.
  • In a workflow body for concurrent (const x of xs), xs from the parameters: Plan node (the reference engine's plan Node and flow API): Node.all over 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.all runs steps at once. Design · Review.
  • A workflow body means what the same statements mean in an effect function (principle 6). Design · Review.
  • The operand of try is a durable call: a task, a workflow, .child, a wait (durable-waits), or try.all, try.race and try.any over those. Design · Review.
  • try sleep("1 second") is an error that names Experimental.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 .vibe files, 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 a Node.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 with return W.to(next), and static readonly maxRounds bounds 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.layer is the canonical composition: Interpreter.layerWithImplementations(W, …) over T.layer for 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 }) under Flow.derived. Design · Review.
  • Equal input joins the run that input already started | W.execute({ a }) under Flow.derived | Design · Review.
  • Form spawn W(a): Meaning: Start or join that run and give a Run<A, E> at once; Reference engine: W.executionId({ a }), then W.execute({ a }, { executionId, discard: true }). Design · Review.
  • Form try W.start(a): Meaning: Always start new work and give its Run; 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 over id. 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 idempotencyKey states 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 installs Flow.derived, which sorts sets and maps as VIP-44 requires. Design · Review.
  • spawn is reserved in Effect code, as fork and join are. 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 effect 4.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: A task or workflow has no call, two of them, or a call that is not effect; 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 plain effect 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: try on something that is not a durable call; The message names: The durable form, such as Experimental.Durable.sleep. Design · Review.
  • Slug workflow-impure: When: A body reads a service, the clock, randomness or a module let; 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) and maxRounds. Design · Review.
  • Slug workflow-recursion: When: try W(…) reaches W again; The message names: W.to or W.child. Design · Review.
  • Slug handoff-position: When: W.to(…) anywhere but a return; The message names: The tail position. Design · Review.
  • Slug retry-unbounded (warning): When: A written retryPolicy has neither maxAttempts nor expirationMs; 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.X names 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.start create a second run. Review decision.
  • A workflow may not loop in v1; use bounded W.to rounds 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.

ProgramTokens (o200k_base)Lines
This VIP's example26826
Its emitted reference-engine TypeScript, written by hand54756
The home page sample in reference-engine 1.x TypeScript, triage.ts44240
lang/examples/problem/vibelang/triage.vibe, Vibe 0.0.13 on the reference engine41339

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. task and workflow have no TypeScript or TC39 form. They are spelled as service is: a class-shaped body, methods and static readonly members, so a TypeScript reader parses them on sight.
  • Effect-second. Bends, and says so. Effect has effect/workflow, and Vibe 0.0.13 already has Workflow and Activity in 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 readonly pass-through is another. A fork that wants body replay replaces the table with Workflow.make and Activity.make.
  • Factory-first. Each table row is a spec test with its emitted code.
  • One meaning per form. try still runs one Effect and gives its value, and statements still run in order. A workflow restricts what may follow try; it does not change what try means. It bends twice: a workflow's effect call lowers to a plan, not to Effect.gen, and a task's A!E annotation 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 task and workflow, and spawn as 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, DurableDeferred and DurableQueue stay in scope as library modules. Nothing in this VIP uses them, and a lint flags Workflow.make in a file that declares a workflow.
  • The reference engine gains nothing new for the lowering: every emitted call exists at main@origin bcf8076a4ff4. 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.capture records 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 engine T.call(payload) plans a step and runs nothing, so the same name under try would mean two things.
  • A required id and version on 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

  1. Run identity (decided). Equal inputs join one run under VIP-44; triggers and W.start create a second run. See the Maintainers' decisions section.
  2. Loops. This VIP refuses a loop over a step result and names W.to. A later VIP may consider compiling while and for into rounds, carrying the loop's variables as the next round's parameters? This remains future work after the first release.
  3. 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.
  4. spawn. A reserved word, or the method W.ensure(a)? Recommendation: spawn. VIP-44 already shows it, and it reads as fork does.

Depends on

  • VIP-44, accepted: values, identity, serialization.
  • std-durable: the engine, Experimental.Durable.memory, Run.
  • capabilities: the vocabulary behind tier, capabilities and effects.