Remote OpenClaw

Remote OpenClaw Blog

Building Workflows: OpenClaw Dispatch vs Native Claude Code

7 min read ·

If you are building automation with OpenClaw, you will quickly encounter two paths: OpenClaw Dispatch and Claude Code. They sound similar — both involve AI doing work on your behalf — but they solve fundamentally different problems. Choosing the wrong one for your use case wastes time and produces brittle workflows.

This guide explains the architectural differences, shows you when each tool is the right choice, and walks through how to combine them for serious production automation. For the full Dispatch reference, see the Claude Dispatch guide.


The Core Difference

The simplest way to understand the difference:

Dispatch tells Claude Code (or any other model endpoint) what to do and when. Claude Code does the actual thinking and acting. They are different layers of the same automation stack, not alternatives to each other.

The confusion comes from the fact that both can be used independently. You can run Dispatch workflows that use simple local models instead of Claude Code. You can use Claude Code interactively without Dispatch at all. But the most powerful setups combine them.


How Dispatch Works Under the Hood

Dispatch is OpenClaw's built-in workflow engine. It provides:

A Dispatch workflow definition looks something like this:

{
  "name": "daily-repo-summary",
  "trigger": { "cron": "0 8 * * 1-5" },
  "steps": [
    {
      "name": "pull-recent-commits",
      "tool": "git-log",
      "params": { "since": "24h", "repo": "/path/to/repo" }
    },
    {
      "name": "summarize",
      "model": "glm-4.7-flash",
      "prompt": "Summarize these commits into a concise daily report: {{steps.pull-recent-commits.output}}"
    },
    {
      "name": "send-report",
      "tool": "send-message",
      "params": { "channel": "team-updates", "content": "{{steps.summarize.output}}" }
    }
  ]
}

Dispatch does not need Claude Code. It can use any model endpoint — Ollama, OpenRouter, or direct API calls. Claude Code is one possible execution backend, not a requirement.


How Claude Code Works Under the Hood

Claude Code is Anthropic's CLI for Claude. It provides an interactive environment where Claude can:

The key architectural difference from Dispatch: Claude Code is session-based and interactive. It starts, you collaborate with it, and it ends when the session is done. There is no persistent scheduling, no automatic triggers, no state management between sessions (beyond what you manually save).

Claude Code excels at complex, open-ended tasks that require reasoning, adaptation, and human feedback within a session. Dispatch excels at repetitive, predictable tasks that run on a schedule without human involvement. See the full Claude Code guide for setup and usage details.


When to Use Dispatch

Use Dispatch when your automation meets these criteria:

Common Dispatch use cases for OpenClaw operators:

Marketplace

Free skills and AI personas for OpenClaw — browse the marketplace.

Browse the Marketplace →

When to Use Claude Code

Use Claude Code when your work meets these criteria:

  • It requires real-time reasoning. Debugging a failing test, exploring a new codebase, or designing an architecture — tasks where the next step depends on what you just learned.
  • It benefits from human feedback. When you want to review intermediate results, adjust direction, or approve actions before they execute.
  • It is a one-off or exploratory task. Investigating a production incident, prototyping a new feature, or analyzing an unfamiliar dataset.
  • It requires deep code understanding. Claude Code's ability to search codebases, read multiple files, and maintain context across a complex investigation is unmatched by Dispatch's step-by-step approach.

Common Claude Code use cases:

  • Debugging complex issues across multiple files and services
  • Prototyping new features with real-time feedback
  • Code review and refactoring sessions
  • Exploring and documenting unfamiliar codebases
  • Writing and testing automation scripts before moving them to Dispatch

Combining Dispatch and Claude Code

The most powerful pattern is using both tools together. Here is how:

Pattern 1: Prototype in Claude Code, deploy in Dispatch

Build and test your workflow interactively in Claude Code. Once it works reliably, convert the steps into a Dispatch workflow definition. This gives you the best of both: rapid iteration during development and reliable unattended execution in production.

Pattern 2: Dispatch triggers Claude Code for complex steps

A Dispatch workflow runs a simple cron schedule, but one step requires complex reasoning — analyzing a codebase, writing a nuanced summary, or making a judgment call. That step invokes Claude Code as a tool, passing in the necessary context and receiving the result back into the workflow.

Pattern 3: Claude Code investigates Dispatch failures

When a Dispatch workflow fails, the error notification triggers a Claude Code session that automatically investigates the failure — reading logs, checking system state, and either fixing the issue or generating a detailed incident report for human review.

For the full workflow automation guide, including more patterns and configuration examples, see the dedicated resource.


Practical Workflow Examples

Example 1: Daily standup summary (Dispatch only)

This workflow runs every morning at 8 AM, pulls yesterday's git commits and completed tasks, generates a summary, and posts it to a team channel. Every step is predictable and repeatable — pure Dispatch territory.

Example 2: PR review assistant (Claude Code only)

When you open a pull request and want AI review, you start a Claude Code session, point it at the PR diff, and collaborate interactively on code quality, potential bugs, and improvement suggestions. This requires real-time reasoning and benefits from human feedback — pure Claude Code territory.

Example 3: Weekly security audit (Dispatch + Claude Code)

Dispatch triggers a weekly cron job that collects dependency versions, checks for known CVEs, and scans configuration files. If potential issues are found, the workflow invokes Claude Code to analyze the findings, assess severity, and draft remediation recommendations. The results are compiled into a report and sent to the team.


Frequently Asked Questions

Should I use OpenClaw Dispatch or Claude Code for automation?

Use OpenClaw Dispatch when you need persistent, scheduled automation that runs unattended — daily reports, recurring data pulls, periodic system checks. Use Claude Code when you need interactive, session-based work where you are actively collaborating with the AI on code, debugging, or exploration. Dispatch is for automation that runs while you sleep. Claude Code is for work you do while sitting at the keyboard.

Can OpenClaw Dispatch trigger Claude Code sessions?

Yes. Dispatch can invoke Claude Code as a tool within a workflow. This is useful when a scheduled task requires code-level intelligence — for example, a daily cron job that uses Claude Code to review pull requests, generate reports from code analysis, or run automated tests. Dispatch handles the scheduling and orchestration while Claude Code handles the code-aware reasoning.

Is Dispatch free with OpenClaw?

The Dispatch feature is included in OpenClaw at no additional cost. However, every Dispatch workflow execution consumes model tokens. If you are using a paid API provider like OpenRouter or Anthropic's API, those token costs apply to Dispatch runs just like they apply to interactive sessions. With local Ollama models, Dispatch runs are effectively free beyond your hardware costs.

What happens when a Dispatch workflow fails?

Dispatch supports configurable retry logic, error notifications, and fallback actions. You can set a workflow to retry a specific number of times with backoff intervals, send a notification on failure, or trigger an alternative workflow. Without explicit error handling configured, failed workflows log the error and stop. Production deployments should always include retry and notification settings.