t3-workflows
T3 Code workflows
A workflow is a TypeScript function the T3 Code server runs durably on Effect v4 (effect/workflow). Every step's result is stored, so restarts replay to where the run left off and a failing step pauses the run instead of losing it. Runs can sleep for days, wait on signals or pull requests, ask a person a question, and launch agents in ordinary threads.
Use a workflow for multi-stage work that must not be lost or repeated (triage → fix → verify, nightly reports, webhook reactions). For a single prompt on a timer, use a scheduled task instead.
Quick start
Workflows are a Labs feature, off by default. If t3 workflow says workflows are off, ask the user to turn them on in Settings → Labs → Workflows; do not edit their settings yourself.
Put a .ts file in ~/.t3/workflows/ (the workflows folder of T3 home, or the path in T3CODE_WORKFLOWS). Once workflows are on, the server watches the folder and reloads files automatically—nothing to restart. A file name with a space or other unusual character (fix issue.ts) is skipped with a warning in the server log: use letters, digits, -, _ and .. Files run with Node's type stripping, so only erasable TypeScript works: no enum, namespace or parameter properties.
Workflow files import nothing from T3 or Effect. T3, Effect, Schema, Option, Duration, and Schedule are injected as globals. Never import from effect (that loads a second runtime copy the engine cannot run). Node built-ins (node:fs, node:crypto) can be imported normally.
const { workflow, agent, ask, stop, title, every, Tick } = T3;