Workflows (Labs) are durable TypeScript scripts that chain agents, code steps, schedules, webhooks, issue/PR triggers, and human approvals into multi-stage runs that survive server restarts. Each completed step is checkpointed so restarts resume where they left off.
Use a scheduled task for a single prompt on a timer or webhook; use a workflow for multi-stage pipelines (e.g., triage → fix → approval → release).
Turn on Settings → Labs → Workflows on the server that will run them (or set "workflowsEnabled": true in ~/.t3/userdata/settings.json on headless servers). Existing runs pause while disabled and resume when re-enabled.
Place .ts files in ~/.t3/workflows/ (or the path in T3CODE_WORKFLOWS). The server watches the folder and hot-reloads valid edits.
- With an agent (recommended): Copy the
t3-workflowsskill into your agent's skills folder (e.g.~/.claude/skills/or~/.agents/skills/) and describe what you want. - Directly: Edit files in
~/.t3/workflows/or use Definitions on the Workflows page (Open workflows in the command palette; saving/deleting in the app requires terminal access).
Example (~/.t3/workflows/release.ts):
const { workflow, step, ask, stop, title } = T3;
export default workflow(
"release",
{ version: 1, payload: Schema.Struct({ name: Schema.String }) },
Effect.fn(function* (payload) {
yield* title(`Release ${payload.name}`);
const notes = yield* step("notes", { returns: Schema.String }, Effect.succeed("3 fixes"));
const answer = yield* ask("ship", {
title: `Ship ${payload.name}? ${notes}`,
choices: ["Ship", "Hold"],
});
if (Option.isNone(answer) || answer.value.choice !== "Ship") return yield* stop("held back");
return { shipped: payload.name };
}),
);T3,Effect,Schema, andOptionare globals—no imports needed.- Filenames may use letters, digits,
-,_, and.. Dot-files and subfolders are ignored (put shared helpers in a subfolder; restart the server after editing imported helpers). - Versioning: Keep older workflow versions defined while they have unfinished runs; bump
versionto deploy new steps alongside active runs.
t3 workflow start <name> --input '<json>' --key <key>
t3 workflow list [--status paused] [--tag <tag>] [--subject <url or id>]
t3 workflow show <run>
t3 workflow resume <run>
t3 workflow cancel <run> [--reason '<why>']
t3 workflow questions [--kind <kind>]
t3 workflow signal '{"choice":"yes"}' --run <run> --wait <name>
t3 workflow signal '<json>' --workflow <name> --channel <channel>
t3 workflow withdraw --run <run> --wait <name> [--reason '<why>']
t3 workflow hooks
t3 workflow store list
t3 workflow store set <key> '<json>'--keydeduplicates starts across retries and version bumps.signalanswers an open question or wakes a channel wait (signals sent before a channel wait are buffered for 7 days by default).withdrawcancels an open question soaskreturnsNone.storereads/writes shared state persisted between runs.
- Question kinds & tags: Declare
asks: { kindKey: "Label" }in workflow options and passkindtoask(...)to filter open questions under Needs you (andt3 workflow questions --kind <kind>). Usetags([...])to label runs for filtering. - Rich choices & links: Pass
links: [{ label, url }]and choice objects{ value, description, requireReason }to require an explanation before answering. Answers recordansweredAtandansweredBy. - Subjects: Call
subject(issueOrPrOrThreadOrUrl)(or pass{ subject }tostart(...)) to display and link the target item in run lists, issue/PR views, andt3 workflow list --subject <url>.
- Whole-workflow cap: Set
concurrency: 4in workflow options. - Step pools: Wrap a section in
within("builders", { limit: 4 }, ...)(limit: 1acts as a lock). Waiting runs show as Queued in FIFO order; resumed runs re-acquire their pools first. - Avoid nesting
withinon the same pool name (or a workflow's own concurrency pool), and avoid holding a lock acrossinvokeif the child needs the same pool. Step names starting with@pool:are reserved.
- Schedules:
everyruns on an interval;dailyruns at a local time of day (skipped if missed by >10 minutes while offline). - Webhooks: Run
t3 workflow hooksto get each hook's secret path (prepend your server URL). Deduplicates retries by delivery header (e.g.X-GitHub-Delivery), rejects bodies >1 MiB, and rate-limits to 60 runs/min (429). Blocked if managed policy disables webhooks. - Issues & PRs: Triggers automatically on new issues or PRs via Settings → Source control & issues (polled ~every minute; only items opened after the workflow first loads).
Open Open workflows from the command palette (web/desktop) to filter Needs you, Running, or All, inspect agent threads, answer questions, resume, or cancel runs.
- Agent steps: Each
agentstep runs in a regular thread (hidden from sidebar lists) that you can open live from the run. Supports customworkspace,runtimeMode,interactionMode,title, typedreturns, and linked environments. - Retries & pausing: Failed code steps auto-retry after 5, 20, and 80 minutes (or immediately on Resume). Failed or timed-out agent steps pause for manual resume (offline-start failures auto-retry). Cancelling stops active agent turns and child runs permanently.
- Skipped runs: Up to 500 skipped top-level runs are kept per workflow (configurable via Settings → Labs → Skipped runs kept or
"workflowSkippedRunsKept"insettings.json). - Always-on requirement: Runs only advance while the server that started them is online.