2026-01-18 11:07:47 -08:00
---
title: Lobster
2026-01-30 03:15:10 +01:00
summary: "Typed workflow runtime for OpenClaw with resumable approval gates."
description: Typed workflow runtime for OpenClaw — composable pipelines with approval gates.
2026-01-22 03:25:13 +00:00
read_when:
- You want deterministic multi-step workflows with explicit approvals
- You need to resume a workflow without re-running earlier steps
2026-01-18 11:07:47 -08:00
---
# Lobster
2026-01-30 03:15:10 +01:00
Lobster is a workflow shell that lets OpenClaw run multi-step tool sequences as a single, deterministic operation with explicit approval checkpoints.
2026-01-18 11:07:47 -08:00
2026-01-23 02:59:16 +00:00
## Hook
Your assistant can build the tools that manage itself. Ask for a workflow, and 30 minutes later you have a CLI plus pipelines that run as one call. Lobster is the missing piece: deterministic pipelines, explicit approvals, and resumable state.
2026-01-18 11:07:47 -08:00
## Why
Today, complex workflows require many back-and-forth tool calls. Each call costs tokens, and the LLM has to orchestrate every step. Lobster moves that orchestration into a typed runtime:
2026-01-30 03:15:10 +01:00
- **One call instead of many**: OpenClaw runs one Lobster tool call and gets a structured result.
2026-01-18 11:07:47 -08:00
- **Approvals built in**: Side effects (send email, post comment) halt the workflow until explicitly approved.
- **Resumable**: Halted workflows return a token; approve and resume without re-running everything.
2026-01-25 01:13:53 +00:00
## Why a DSL instead of plain programs?
Lobster is intentionally small. The goal is not "a new language," it's a predictable, AI-friendly pipeline spec with first-class approvals and resume tokens.
2026-01-31 21:13:13 +09:00
- **Approve/resume is built in**: A normal program can prompt a human, but it can’ t _pause and resume_ with a durable token without you inventing that runtime yourself.
2026-01-25 01:13:53 +00:00
- **Determinism + auditability**: Pipelines are data, so they’ re easy to log, diff, replay, and review.
- **Constrained surface for AI**: A tiny grammar + JSON piping reduces “creative” code paths and makes validation realistic.
- **Safety policy baked in**: Timeouts, output caps, sandbox checks, and allowlists are enforced by the runtime, not each script.
- **Still programmable**: Each step can call any CLI or script. If you want JS/TS, generate `.lobster` files from code.
2026-01-22 03:25:13 +00:00
## How it works
2026-01-30 03:15:10 +01:00
OpenClaw launches the local `lobster` CLI in **tool mode** and parses a JSON envelope from stdout.
2026-01-22 03:25:13 +00:00
If the pipeline pauses for approval, the tool returns a `resumeToken` so you can continue later.
2026-01-23 02:59:16 +00:00
## Pattern: small CLI + JSON pipes + approvals
Build tiny commands that speak JSON, then chain them into a single Lobster call. (Example command names below — swap in your own.)
```bash
inbox list --json
inbox categorize --json
inbox apply --json
```
```json
{
"action": "run",
"pipeline": "exec --json --shell 'inbox list --json' | exec --stdin json --shell 'inbox categorize --json' | exec --stdin json --shell 'inbox apply --json' | approve --preview-from-stdin --limit 5 --prompt 'Apply changes?'",
"timeoutMs": 30000
}
```
If the pipeline requests approval, resume with the token:
```json
{
"action": "resume",
"token": "< resumeToken > ",
"approve": true
}
```
AI triggers the workflow; Lobster executes the steps. Approval gates keep side effects explicit and auditable.
Example: map input items into tool calls:
```bash
gog.gmail.search --query 'newer_than:1d' \
2026-01-30 03:15:10 +01:00
| openclaw.invoke --tool message --action send --each --item-key message --args-json '{"provider":"telegram","to":"..."}'
2026-01-23 02:59:16 +00:00
```
2026-01-24 01:44:36 +00:00
## JSON-only LLM steps (llm-task)
For workflows that need a **structured LLM step** , enable the optional
`llm-task` plugin tool and call it from Lobster. This keeps the workflow
deterministic while still letting you classify/summarize/draft with a model.
Enable the tool:
```json
{
"plugins": {
"entries": {
"llm-task": { "enabled": true }
}
},
"agents": {
"list": [
{
"id": "main",
"tools": { "allow": ["llm-task"] }
}
]
}
}
```
Use it in a pipeline:
```lobster
2026-01-30 03:15:10 +01:00
openclaw.invoke --tool llm-task --action json --args-json '{
2026-01-24 01:44:36 +00:00
"prompt": "Given the input email, return intent and draft.",
"input": { "subject": "Hello", "body": "Can you help?" },
"schema": {
"type": "object",
"properties": {
"intent": { "type": "string" },
"draft": { "type": "string" }
},
"required": ["intent", "draft"],
"additionalProperties": false
}
}'
```
See [LLM Task ](/tools/llm-task ) for details and configuration options.
2026-01-23 02:59:16 +00:00
## Workflow files (.lobster)
2026-01-30 03:15:10 +01:00
Lobster can run YAML/JSON workflow files with `name` , `args` , `steps` , `env` , `condition` , and `approval` fields. In OpenClaw tool calls, set `pipeline` to the file path.
2026-01-23 02:59:16 +00:00
```yaml
name: inbox-triage
args:
tag:
default: "family"
steps:
- id: collect
command: inbox list --json
- id: categorize
command: inbox categorize --json
stdin: $collect.stdout
- id: approve
command: inbox apply --approve
stdin: $categorize.stdout
approval: required
- id: execute
command: inbox apply --execute
stdin: $categorize.stdout
condition: $approve.approved
```
Notes:
- `stdin: $step.stdout` and `stdin: $step.json` pass a prior step’ s output.
- `condition` (or `when` ) can gate steps on `$step.approved` .
2026-01-22 03:25:13 +00:00
## Install Lobster
2026-01-30 03:15:10 +01:00
Install the Lobster CLI on the **same host** that runs the OpenClaw Gateway (see the [Lobster repo ](https://github.com/openclaw/lobster )), and ensure `lobster` is on `PATH` .
2026-01-22 03:25:13 +00:00
## Enable the tool
2026-01-25 00:40:13 -08:00
Lobster is an **optional** plugin tool (not enabled by default).
Recommended (additive, safe):
```json
{
"tools": {
"alsoAllow": ["lobster"]
}
}
```
Or per-agent:
2026-01-22 03:25:13 +00:00
```json
{
"agents": {
"list": [
{
"id": "main",
"tools": {
2026-01-25 00:40:13 -08:00
"alsoAllow": ["lobster"]
2026-01-22 03:25:13 +00:00
}
}
]
}
}
```
2026-01-25 00:40:13 -08:00
Avoid using `tools.allow: ["lobster"]` unless you intend to run in restrictive allowlist mode.
2026-01-22 03:25:13 +00:00
2026-01-23 09:01:41 +00:00
Note: allowlists are opt-in for optional plugins. If your allowlist only names
2026-01-30 03:15:10 +01:00
plugin tools (like `lobster` ), OpenClaw keeps core tools enabled. To restrict core
2026-01-23 09:01:41 +00:00
tools, include the core tools or groups you want in the allowlist too.
2026-01-18 11:07:47 -08:00
## Example: Email triage
Without Lobster:
2026-01-31 21:13:13 +09:00
2026-01-18 11:07:47 -08:00
```
User: "Check my email and draft replies"
2026-01-30 03:15:10 +01:00
→ openclaw calls gmail.list
2026-01-18 11:07:47 -08:00
→ LLM summarizes
→ User: "draft replies to #2 and #5 "
→ LLM drafts
→ User: "send #2 "
2026-01-30 03:15:10 +01:00
→ openclaw calls gmail.send
2026-01-18 11:07:47 -08:00
(repeat daily, no memory of what was triaged)
```
With Lobster:
2026-01-31 21:13:13 +09:00
2026-01-22 03:25:13 +00:00
```json
{
"action": "run",
"pipeline": "email.triage --limit 20",
"timeoutMs": 30000
}
2026-01-18 11:07:47 -08:00
```
2026-01-22 03:25:13 +00:00
Returns a JSON envelope (truncated):
2026-01-31 21:13:13 +09:00
2026-01-22 03:25:13 +00:00
```json
2026-01-18 11:07:47 -08:00
{
2026-01-22 03:25:13 +00:00
"ok": true,
2026-01-18 11:07:47 -08:00
"status": "needs_approval",
2026-01-22 03:25:13 +00:00
"output": [{ "summary": "5 need replies, 2 need action" }],
2026-01-18 11:07:47 -08:00
"requiresApproval": {
2026-01-22 03:25:13 +00:00
"type": "approval_request",
2026-01-18 11:07:47 -08:00
"prompt": "Send 2 draft replies?",
2026-01-22 03:25:13 +00:00
"items": [],
2026-01-18 11:07:47 -08:00
"resumeToken": "..."
}
}
```
2026-01-22 03:25:13 +00:00
User approves → resume:
2026-01-31 21:13:13 +09:00
2026-01-18 11:07:47 -08:00
```json
{
2026-01-22 03:25:13 +00:00
"action": "resume",
"token": "< resumeToken > ",
"approve": true
2026-01-18 11:07:47 -08:00
}
```
2026-01-22 03:25:13 +00:00
One workflow. Deterministic. Safe.
2026-01-18 11:07:47 -08:00
2026-01-22 03:25:13 +00:00
## Tool parameters
2026-01-18 11:07:47 -08:00
### `run`
2026-01-22 03:25:13 +00:00
Run a pipeline in tool mode.
2026-01-18 11:07:47 -08:00
```json
{
"action": "run",
"pipeline": "gog.gmail.search --query 'newer_than:1d' | email.triage",
2026-02-19 14:58:01 +01:00
"cwd": "workspace",
2026-01-22 03:25:13 +00:00
"timeoutMs": 30000,
"maxStdoutBytes": 512000
2026-01-18 11:07:47 -08:00
}
```
2026-01-23 02:59:16 +00:00
Run a workflow file with args:
```json
{
"action": "run",
"pipeline": "/path/to/inbox-triage.lobster",
"argsJson": "{\"tag\":\"family\"}"
}
```
2026-01-18 11:07:47 -08:00
### `resume`
Continue a halted workflow after approval.
```json
{
"action": "resume",
"token": "< resumeToken > ",
"approve": true
}
```
2026-01-22 03:25:13 +00:00
### Optional inputs
2026-02-19 14:58:01 +01:00
- `cwd` : Relative working directory for the pipeline (must stay within the current process working directory).
2026-01-22 03:25:13 +00:00
- `timeoutMs` : Kill the subprocess if it exceeds this duration (default: 20000).
- `maxStdoutBytes` : Kill the subprocess if stdout exceeds this size (default: 512000).
2026-01-23 02:59:16 +00:00
- `argsJson` : JSON string passed to `lobster run --args-json` (workflow files only).
2026-01-22 03:25:13 +00:00
## Output envelope
Lobster returns a JSON envelope with one of three statuses:
- `ok` → finished successfully
- `needs_approval` → paused; `requiresApproval.resumeToken` is required to resume
- `cancelled` → explicitly denied or cancelled
The tool surfaces the envelope in both `content` (pretty JSON) and `details` (raw object).
## Approvals
If `requiresApproval` is present, inspect the prompt and decide:
- `approve: true` → resume and continue side effects
- `approve: false` → cancel and finalize the workflow
2026-01-23 02:59:16 +00:00
Use `approve --preview-from-stdin --limit N` to attach a JSON preview to approval requests without custom jq/heredoc glue. Resume tokens are now compact: Lobster stores workflow resume state under its state dir and hands back a small token key.
2026-01-23 01:29:14 +00:00
## OpenProse
OpenProse pairs well with Lobster: use `/prose` to orchestrate multi-agent prep, then run a Lobster pipeline for deterministic approvals. If a Prose program needs Lobster, allow the `lobster` tool for sub-agents via `tools.subagents.tools` . See [OpenProse ](/prose ).
2026-01-22 03:25:13 +00:00
## Safety
2026-01-18 11:07:47 -08:00
- **Local subprocess only** — no network calls from the plugin itself.
2026-01-30 03:15:10 +01:00
- **No secrets** — Lobster doesn't manage OAuth; it calls OpenClaw tools that do.
2026-01-22 03:25:13 +00:00
- **Sandbox-aware** — disabled when the tool context is sandboxed.
2026-02-19 14:58:01 +01:00
- **Hardened** — fixed executable name (`lobster` ) on `PATH` ; timeouts and output caps enforced.
2026-01-18 11:07:47 -08:00
2026-01-22 03:25:13 +00:00
## Troubleshooting
- **`lobster subprocess timed out` ** → increase `timeoutMs` , or split a long pipeline.
- **`lobster output exceeded maxStdoutBytes` ** → raise `maxStdoutBytes` or reduce output size.
- **`lobster returned invalid JSON` ** → ensure the pipeline runs in tool mode and prints only JSON.
- **`lobster failed (code …)` ** → run the same pipeline in a terminal to inspect stderr.
2026-01-18 11:07:47 -08:00
## Learn more
2026-02-07 15:40:35 -05:00
- [Plugins ](/tools/plugin )
2026-01-22 03:25:13 +00:00
- [Plugin tool authoring ](/plugins/agent-tools )
2026-01-23 02:59:16 +00:00
## Case study: community workflows
One public example: a “second brain” CLI + Lobster pipelines that manage three Markdown vaults (personal, partner, shared). The CLI emits JSON for stats, inbox listings, and stale scans; Lobster chains those commands into workflows like `weekly-review` , `inbox-triage` , `memory-consolidation` , and `shared-task-sync` , each with approval gates. AI handles judgment (categorization) when available and falls back to deterministic rules when not.
2026-02-06 10:08:59 -05:00
- Thread: [https://x.com/plattenschieber/status/2014508656335770033 ](https://x.com/plattenschieber/status/2014508656335770033 )
- Repo: [https://github.com/bloomedai/brain-cli ](https://github.com/bloomedai/brain-cli )