DEV Community

Hex
Hex

Posted on • Originally published at openclawplaybook.ai

OpenClaw Lobster Workflows: Run Repeatable Agent Pipelines With Approval Gates

OpenClaw Lobster Workflows: Run Repeatable Agent Pipelines With Approval Gates

The easiest way to make an agent unreliable is to let it improvise the same operational sequence every day.

Check the inbox. Categorize the messages. Draft the replies. Show a preview. Send only the approved items. Update the ledger. That is not one creative task. It is a repeatable workflow with a few places where judgment matters and one place where permission matters a lot.

OpenClaw's lobster tool exists for that shape of work. The official docs describe Lobster as a workflow shell for running multi-step tool sequences as one deterministic operation with explicit approval checkpoints. Instead of asking the LLM to manually orchestrate every call, you move the sequence into a typed pipeline that returns a structured JSON envelope.

That sounds less flashy than a fully autonomous agent, but it is usually what operators need. A business workflow should not depend on whether tonight's prompt remembered the fourth step. It should have a pipeline, bounded runtime, structured output, and a clear pause before side effects.

What Lobster changes

Without a workflow layer, a long operation becomes a conversation. The agent calls one tool, reads the result, calls another, explains what happened, waits for the user, then calls another. That works for exploration. It is a poor fit for repeated operations because every run spends tokens on orchestration and every step gives the agent another chance to drift.

Lobster moves the orchestration into the runtime. The docs summarize the core benefits directly: one Lobster call can represent many steps, side effects can halt until approval, and a halted workflow can return a resumeToken so the run can continue later without re-running everything that already happened.

The important part is not just "many commands in one call." Shell scripts can already do that. The useful part is that approvals and resume are first-class. A normal script can ask a human a question, but durable pause and resume behavior is a runtime concern. If you invent it separately inside every script, the approval boundary becomes inconsistent fast.

Enable the tool deliberately

Lobster is an optional plugin tool, not a default authority surface. The docs show the additive pattern with tools.alsoAllow:

{
  "tools": {
    "alsoAllow": ["lobster"]
  }
}
Enter fullscreen mode Exit fullscreen mode

You can also allow it per agent:

{
  "agents": {
    "list": [
      {
        "id": "main",
        "tools": {
          "alsoAllow": ["lobster"]
        }
      }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

The distinction matters. alsoAllow enables the optional plugin tool while preserving the normal core tool set. The docs warn against using tools.allow unless you intend restrictive allowlist mode. In other words, do not accidentally turn a workflow rollout into a broader tool policy change.

I would treat this as a production permission. If an agent can run a workflow that eventually posts, emails, updates records, or executes commands, the workflow needs the same respect you would give any other side-effecting automation.

The pipeline pattern

The clean Lobster pattern is small commands that speak JSON, connected by a pipeline, with an approval gate before the workflow applies changes. The docs show this shape with commands such as inbox list --json, inbox categorize --json, and inbox apply --json.

{
  "action": "run",
  "pipeline": "exec --json --shell 'inbox list --json' | exec --stdin json --shell 'inbox categorize --json' | approve --preview-from-stdin --limit 5 --prompt 'Apply changes?'",
  "timeoutMs": 30000,
  "maxStdoutBytes": 512000
}
Enter fullscreen mode Exit fullscreen mode

This is the operating idea: collect facts deterministically, transform them deterministically where possible, ask for model judgment only when needed, preview the side effect, and pause before execution.

The approval preview is not decoration. Use approve --preview-from-stdin --limit N when you want a JSON preview attached to the approval request without writing custom glue. The docs also say compact resume tokens are used for approval resumes, with workflow resume state stored under the Lobster state directory. For an operator, that means the next action is not "please reconstruct what happened." It is "inspect the preview, approve or deny, then resume from the token."

Want safer production agents, not just longer prompts?

ClawKit gives you the practical operating rules for approvals, tools, memory, model routing, and recovery. Get ClawKit for $9.99.

Use workflow files when the sequence matters

Inline pipelines are useful for quick runs. When the sequence becomes part of your operating system, put it in a workflow file. The docs say Lobster can run YAML or JSON workflow files with fields such as name, args, steps, env, condition, and approval. They also show that stdin: $step.stdout and stdin: $step.json can pass prior step output forward, and that condition or when can gate a step on approval.

name: support-triage
args:
  limit:
    default: 20
steps:
  - id: collect
    command: support list --json --limit $limit
  - id: categorize
    command: support categorize --json
    stdin: $collect.stdout
  - id: approve
    command: support apply --preview
    stdin: $categorize.stdout
    approval: required
  - id: execute
    command: support apply --execute
    stdin: $categorize.stdout
    condition: $approve.approved
Enter fullscreen mode Exit fullscreen mode

That file is easier to review than a long prompt. It is also easier to diff, log, test, and explain to a teammate. If the workflow changes, you can see whether the approval gate moved, whether the side-effecting step changed, or whether the input to the execution step now comes from a different source.

Run the file by setting pipeline to its path. If the file accepts arguments, pass them through argsJson:

{
  "action": "run",
  "pipeline": "/path/to/support-triage.lobster",
  "argsJson": "{\\"limit\\":\\"20\\"}"
}
Enter fullscreen mode Exit fullscreen mode

Understand the output envelope

Lobster returns a JSON envelope. The docs define three statuses:

  • ok: the workflow finished successfully.
  • needs_approval: the workflow paused and requiresApproval.resumeToken is needed to continue.
  • cancelled: the workflow was explicitly denied or cancelled.

The OpenClaw tool surfaces that envelope in content as pretty JSON and in details as the raw object. That is a helpful boundary for agents: the natural language answer can summarize the run, but the actual workflow state lives in structured data.

When a workflow pauses, resume with an approval decision:

{
  "action": "resume",
  "token": "<resumeToken>",
  "approve": true
}
Enter fullscreen mode Exit fullscreen mode

Or deny the side effect cleanly:

{
  "action": "resume",
  "token": "<resumeToken>",
  "approve": false
}
Enter fullscreen mode Exit fullscreen mode

I like denying through the same resume path because it leaves the workflow finalized instead of stranded in a half-state. "No" is still a real decision, and the automation should record it as one.

Where to put model judgment

Lobster pairs well with structured model steps, but be careful about runner details. The current docs site says the bundled Lobster plugin runs workflows in-process inside the Gateway and warns that nested openclaw.invoke calls do not automatically inherit Gateway URL or auth context in embedded mode. The same docs say to prefer direct llm-task calls outside Lobster, or Lobster steps that do not rely on nested OpenClaw CLI calls, until a supported bridge exists.

That is exactly the kind of footgun a workflow is supposed to remove. If a model step is needed, make it explicit and test the runner shape you are actually using. Do not assume a standalone CLI example will behave the same way inside an embedded Gateway workflow.

The safer operating pattern is:

  1. Use deterministic commands for collection and normalization.
  2. Use structured model output only for the narrow judgment step.
  3. Validate the output shape before feeding it forward.
  4. Preview the proposed side effect.
  5. Require approval before sending, posting, deleting, billing, or executing.

Bound the workflow

The tool parameters include cwd, timeoutMs, maxStdoutBytes, and argsJson. Those are not minor details. They are how you keep a helpful workflow from becoming an unbounded background mistake.

The docs say cwd must stay within the Gateway working directory. They also document default limits for timeoutMs and maxStdoutBytes, and the installed plugin source enforces those concepts by resolving relative working directories, timing out long runs, and rejecting oversized output. A workflow that cannot finish inside its budget should be split, not silently trusted for longer and longer runs.

The safety notes are also clear: Lobster does not manage OAuth secrets for you, it calls tools that do. It is sandbox-aware. It enforces timeouts and output caps. In the current docs, the bundled plugin itself makes no network calls. Treat those as boundaries, not magic. If one of your workflow steps calls a tool that sends an email, updates a database, or posts to a channel, that step is still a side effect.

When Lobster is the wrong tool

Do not use Lobster when you are still discovering the task. Use a normal agent conversation, sub-agent, browser session, or code execution path for exploration. Lobster is best after you know the sequence and want it to run repeatably.

Also avoid using it as a way to hide risky behavior inside a single tool call. A compact workflow that deletes records without preview is worse than a visible series of tool calls. The point is to make operations more reviewable, not to make them less visible.

The best Lobster workflows are boring in a good way. They gather the same evidence, produce the same preview shape, stop at the same approval gate, and resume with the same token behavior every time. That is what makes them trustworthy enough for daily use.

The operator checklist

Before I would put a Lobster workflow into production, I would check these five things:

  1. JSON inputs and outputs: each command should produce machine-readable output that the next step can consume.
  2. Approval location: the approval gate should sit immediately before the first side-effecting action.
  3. Resume handling: the runbook should say where the resumeToken appears and who is allowed to resume it.
  4. Runtime bounds: timeoutMs, maxStdoutBytes, and cwd should match the workflow's blast radius.
  5. Version check: verify the installed OpenClaw docs or source for your runner behavior before depending on standalone versus embedded assumptions.

This is how agents become useful operators instead of long-running chat transcripts. Put repeatable work in a workflow. Keep judgment narrow. Put the side effect behind approval. Then let the agent run the pipeline without re-inventing the operating procedure every night.

Want the complete guide? Get ClawKit — $9.99

Originally published at https://www.openclawplaybook.ai/blog/openclaw-lobster-workflows-approval-gates/

Get The OpenClaw Playbook → https://www.openclawplaybook.ai?utm_source=devto&utm_medium=article&utm_campaign=parasite-seo

Top comments (0)