Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/docs/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ The `agentOS()` actor (from `@rivet-dev/agentos`) wraps the raw VM in a [Rivet A

### Workflows

- **Durable multi-step tasks.** A workflow is the actor's `run` handler wrapped in `workflow()`, where each `ctx.step()` is recorded, retried, and resumed independently.
- **Durable multi-step tasks.** A workflow is an actor defined with `workflow({ ... })` from [`@rivet-dev/workflows`](/workflows/docs/), where each `ctx.step()` is recorded, retried, and resumed independently.
- **Crash-proof.** If the process dies mid-run, replay skips completed steps and continues where it left off.
- **Composable.** The output of one step feeds the next: clone a repo, let an agent fix a bug, run the tests. See [Workflows & Graphs](/agentos/docs/workflows).

Expand Down
10 changes: 7 additions & 3 deletions docs/content/docs/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ description: "Orchestrate multi-step coding-agent tasks with durable agentOS wor
skill: true
---

Orchestrate multi-step agent tasks with durable workflows that survive crashes and restarts. Build them with RivetKit's `workflow()` run handler, where each `ctx.step()` is recorded, retried, and resumed independently, and the output of one step can feed into the next.
Orchestrate multi-step agent tasks with durable workflows that survive crashes and restarts. Define them with [`@rivet-dev/workflows`](/workflows/docs/): each `ctx.step()` is recorded, retried, and resumed independently, and the output of one step can feed into the next.

```bash
npm install @rivet-dev/agentos @rivet-dev/workflows
```

## Basic workflow

A workflow is the durable `run` handler of an actor. Wrap it in `workflow()` and drive a multi-step agent task as an ordered series of steps: clone the repo, let an agent fix the bug, then run the tests. Each actor instance is one workflow run initialized with creation input, so no application queue is required.
A workflow is an actor defined with `workflow({ ... })` from `@rivet-dev/workflows`. Its `run` function drives a multi-step agent task as an ordered series of steps: clone the repo, let an agent fix the bug, then run the tests. Each actor instance is one workflow run initialized with creation input, so no application queue is required.

Session creation and prompting happen within the step that uses them, so a session never has to outlive the work it backs (sessions are ephemeral and would not survive a replay). Steps reach the agentOS VM, a separate actor, through `ctx.client()`.

Expand All @@ -28,7 +32,7 @@ Output of one agent session feeds into the next. Each session is created and com

## Recommendations

- Build the actor's `run` handler with `workflow()` so each `ctx.step()` is durable: recorded, retried, and resumed independently across crashes and restarts.
- Define the actor with `workflow({ ... })` so each `ctx.step()` in `run` is durable: recorded, retried, and resumed independently across crashes and restarts.
- Keep step names stable across code changes. Renaming a step breaks replay for in-progress workflows.
- Create and close sessions within the step that uses them. Sessions are ephemeral, so keep their lifetime scoped to one unit of work.
- Pass data between steps via the filesystem or step return values, not session state.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/integrations/rivet-actors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ Deploy to one of the supported platforms:

## Learn more

See the [agentOS quickstart](/agentos/docs/quickstart/) for VM configuration and the [Rivet Actor documentation](/actors/docs/) for state, actions, events, queues, workflows, and deployment.
See the [agentOS quickstart](/agentos/docs/quickstart/) for VM configuration and the [Rivet Actor documentation](/actors/docs/) for state, actions, events, queues, and deployment. For durable multi-step tasks, see the [Workflows docs](/workflows/docs/).
2 changes: 1 addition & 1 deletion docs/content/integrations/vercel-eve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ See the `agentOS()` [configuration reference](/agentos/docs/embedded#configurati

Rivet World stores Eve workflow runs in Rivet Actors so they resume instead of restarting.

[Read the Rivet Workflows integration documentation →](/actors/integrations/workflow-sdk/)
[Read the Workflow SDK integration documentation →](/actors/integrations/workflow-sdk/)

## Advanced

Expand Down
2 changes: 1 addition & 1 deletion examples/apps-ai-builder/fixtures/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"check-types": "tsc --noEmit"
},
"dependencies": {
"rivetkit": "2.3.10"
"rivetkit": "2.3.17"
},
"devDependencies": {
"typescript": "5.7.3"
Expand Down
4 changes: 2 additions & 2 deletions examples/apps-hello-world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Apps router, and deploys generated files from a separate script. The app runs at

The uploaded fixture serves an HTML page at `/` and a JSON endpoint at
`/api/hello`. It does not use RivetKit because it has no durable or coordinated
state; the SQLite, workflows, and multiplayer examples add RivetKit while still
serving ordinary HTTP requests.
state; the SQLite and multiplayer examples add RivetKit while still serving
ordinary HTTP requests.

Run the checked workspace example with Node.js 22 or newer:

Expand Down
2 changes: 1 addition & 1 deletion examples/apps-multiplayer/fixtures/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"check-types": "node --check src/index.mjs"
},
"dependencies": {
"rivetkit": "2.3.10"
"rivetkit": "2.3.17"
}
}
2 changes: 1 addition & 1 deletion examples/apps-sqlite/fixtures/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"check-types": "node --check src/index.mjs"
},
"dependencies": {
"rivetkit": "2.3.10"
"rivetkit": "2.3.17"
}
}
18 changes: 0 additions & 18 deletions examples/apps-workflows/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions examples/apps-workflows/fixtures/app/package.json

This file was deleted.

37 changes: 0 additions & 37 deletions examples/apps-workflows/fixtures/app/src/index.ts

This file was deleted.

23 changes: 0 additions & 23 deletions examples/apps-workflows/package.json

This file was deleted.

11 changes: 0 additions & 11 deletions examples/apps-workflows/src/actors.ts

This file was deleted.

23 changes: 0 additions & 23 deletions examples/apps-workflows/src/client.ts

This file was deleted.

26 changes: 0 additions & 26 deletions examples/apps-workflows/src/server.ts

This file was deleted.

12 changes: 0 additions & 12 deletions examples/apps-workflows/tsconfig.json

This file was deleted.

56 changes: 0 additions & 56 deletions examples/crash-course/workflows.ts

This file was deleted.

2 changes: 1 addition & 1 deletion examples/flue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@rivet-dev/agentos": "workspace:*",
"@rivet-dev/agentos-flue": "workspace:*",
"@rivet-dev/flue": "2.3.9",
"rivetkit": "2.3.10"
"rivetkit": "2.3.17"
},
"devDependencies": {
"@types/node": "^24.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Run multi-step agent work that survives crashes and restarts. Reach for this whe

## How it works

A RivetKit `actor` whose `run` handler is built with `workflow()` orchestrates the steps, while a separate `agentOS` VM actor does the actual work over the client. Each workflow actor instance represents one run and stores its immutable creation input in actor state. Each `ctx.step(...)` is recorded, retried, and resumed independently: if the process crashes mid-run, replay skips completed steps and continues from where it left off. Output flows step-to-step through return values and the VM filesystem — the bug-fixer chains clone -> fix -> test -> record, and the code-reviewer writes a review file and feeds it into the next step. No application queue is required; AgentOS itself serializes prompts targeting the same session.
A `workflow({ ... })` actor from `@rivet-dev/workflows` orchestrates the steps, while a separate `agentOS` VM actor does the actual work over the client. Each workflow actor instance represents one run and stores its immutable creation input in actor state. Each `ctx.step(...)` is recorded, retried, and resumed independently: if the process crashes mid-run, replay skips completed steps and continues from where it left off. Output flows step-to-step through return values and the VM filesystem — the bug-fixer chains clone -> fix -> test -> record, and the code-reviewer writes a review file and feeds it into the next step. No application queue is required; AgentOS itself serializes prompts targeting the same session.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low · The README uses the wrong product name

This changed paragraph still refers to “AgentOS,” but the repository convention requires the product name to always be spelled agentOS. Rename this occurrence so the published example does not reintroduce the deprecated capitalization.


## Run it

Expand Down
2 changes: 1 addition & 1 deletion examples/workflows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@agentos-software/opencode": "workspace:*",
"@agentos-software/pi": "workspace:*",
"zod": "^4.1.11",
"@rivet-dev/agentos": "workspace:*",
"@rivet-dev/workflows": "1.0.0",
"rivetkit": "catalog:rivetkit"
},
"devDependencies": {
Expand Down
Loading
Loading