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 is an orchestration layer. It decides when tasks run, what triggers them, and how they chain together. Think of it as the scheduler and workflow engine.
- Claude Code is an execution layer. It is an AI-powered coding and reasoning environment that can read files, write code, run commands, and interact with your system. Think of it as the intelligent worker.
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:
- Trigger system: Workflows can be triggered by cron schedules, webhook events, file changes, email arrivals, API calls, or manual invocation.
- Step sequencing: Each workflow consists of ordered steps. Steps can be model calls, tool invocations, conditional branches, or sub-workflow invocations.
- State management: Dispatch maintains state between steps. The output of step one becomes available as input to step two. Variables persist across the entire workflow execution.
- Error handling: Built-in retry logic, timeout management, fallback steps, and notification hooks for failure scenarios.
- Logging: Every workflow execution is logged with timestamps, step outputs, token usage, and error details.
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:
- Read and write files on your system
- Execute shell commands
- Search codebases
- Analyze errors and suggest fixes
- Maintain conversation context across a session
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:
- It runs on a schedule. Daily reports, weekly summaries, hourly monitoring checks — anything time-triggered belongs in Dispatch.
- It follows a predictable pattern. If the steps are the same every time (fetch data, process it, send results), Dispatch handles this cleanly.
- It runs unattended. If nobody is watching when the workflow executes, Dispatch's error handling and logging become essential.
- It needs reliability. Dispatch's retry logic, timeout handling, and notification system are built for production reliability. Ad-hoc scripts and Claude Code sessions do not have these guarantees.
- It chains multiple tools. When a workflow needs to call an API, process the result, query a database, format output, and send a message — Dispatch's step sequencing keeps this clean.
Common Dispatch use cases for OpenClaw operators:
Best Next Step
Use the marketplace filters to choose the right OpenClaw bundle, persona, or skill for the job you want to automate.
- Morning briefing: pull calendar, email summaries, and task priorities into a daily digest
- Repository monitoring: check for new issues, PRs, or security advisories on a schedule
- Content pipelines: draft social posts, generate summaries, or prepare newsletter content on a recurring basis
- System health checks: verify that services are running, disk space is adequate, and backups completed
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.