OpenClaw Workflow Tutorial: Build Your First Agent
39% of teams working with AI agents are still in the experimenting phase. They've seen the demos, understand the potential, and have maybe connected a tool or two — but haven't built a workflow that runs reliably end to end.
This openclaw workflow tutorial is for that group. We'll build two complete workflows from scratch — a research agent and an outreach agent — then combine them into a pipeline that demonstrates how OpenClaw's skill and tool system turns individual capabilities into something genuinely useful.
No prior OpenClaw experience required. By the end, you'll have working config files and a clear understanding of how the pieces fit together.
What Are OpenClaw Workflows
An OpenClaw workflow is a sequence of tool calls, skill invocations, and agent reasoning steps that accomplish a goal. Unlike traditional scripts where you hard-code every step, OpenClaw workflows are goal-driven — you describe what you want, and the agent figures out which tools to call and in what order.
This maps to what Anthropic calls prompt chaining: sequential steps where each consumes the prior step's output, with the agent deciding when to move between stages.
The practical architecture looks like this:
You (goal) → Agent (reasoning) → Tool A (data) → Agent (processing) → Tool B (action) → Result
The agent loop — reason, act, observe, repeat — runs automatically. Your job is to:
- Configure the tools your agent can access (MCP servers and skills)
- Define the goal clearly enough that the agent can break it into steps
- Set guardrails so the workflow stays on track
OpenClaw makes step 1 declarative (YAML config) and step 3 optional but recommended (skill instructions, iteration limits). Step 2 is just talking to your agent.
Workflow patterns you'll use
For this tutorial, we'll use two patterns:
Sequential chaining — Research workflow. Search → extract → analyze → output. Each step feeds the next.
Pipeline chaining — Outreach workflow. Find contacts → verify → personalize → send. Each step transforms data and passes it forward.
Both are simple enough to debug but powerful enough for production use. Research from arxiv (2512.08769) confirms the principle: don't build multi-agent systems for single-agent problems. Start simple.
Setting Up Your OpenClaw Environment
Install OpenClaw
If you haven't already:
npm install -g openclaw
Verify the installation:
openclaw --version
Create your workspace
OpenClaw organizes everything in a workspace directory. Create one for this tutorial:
mkdir ~/openclaw-tutorial
cd ~/openclaw-tutorial
openclaw init
This creates the basic workspace structure including the config file where we'll define our tools.
Configure your first MCP servers
Open openclaw.yaml (or your config file) and add the tools we'll use across both workflows:
mcp_servers:
tavily:
command: npx
args: ["-y", "tavily-mcp@latest"]
env:
TAVILY_API_KEY: "${TAVILY_API_KEY}"
apollo:
command: npx
args: ["-y", "@apollo/mcp-server"]
env:
APOLLO_API_KEY: "${APOLLO_API_KEY}"
reoon:
command: npx
args: ["-y", "@reoon/mcp-server"]
env:
REOON_API_KEY: "${REOON_API_KEY}"
instantly:
command: npx
args: ["-y", "@instantly/mcp-server"]
env:
INSTANTLY_API_KEY: "${INSTANTLY_API_KEY}"
Set your API keys
export TAVILY_API_KEY="tvly-your-key"
export APOLLO_API_KEY="your-apollo-key"
export REOON_API_KEY="your-reoon-key"
export INSTANTLY_API_KEY="your-instantly-key"
Most of these tools have free tiers: Tavily offers 1,000 searches/month, Apollo has a limited free plan, and Reoon provides trial verifications. You can build and test both workflows without spending anything.
Verify connections
Start OpenClaw and check that tools are connected:
openclaw start
Ask your agent a simple question that requires search:
What are the latest trends in AI agent frameworks?
If Tavily is connected, you'll see a tool call in the output. If not, check your API key and that npx is in your PATH. For detailed troubleshooting, see our MCP connection debugging guide — the same principles apply to OpenClaw.
Building a Research Workflow Step by Step
Our first workflow: a competitive research agent that gathers, analyzes, and summarizes information about a market segment.
Step 1: Define the skill
Create a skill file that teaches the agent how to do research systematically:
mkdir -p skills/research
Create skills/research/SKILL.md:
# Research Skill
## When to Use
Use this skill when asked to research a topic, company, market, or trend.
## Workflow
1. Start with a broad Tavily search to map the landscape
2. Identify the 3-5 most relevant sources from initial results
3. Use Tavily extract to pull full content from key sources
4. Cross-reference claims across multiple sources
5. Synthesize findings into a structured report
## Output Format
Always structure research output as:
- Executive summary (2-3 sentences)
- Key findings (bullet points with source citations)
- Data points (any numbers, dates, or metrics found)
- Gaps (what couldn't be verified or found)
## Guardrails
- Never present single-source claims as established facts
- Always include source URLs for verifiable claims
- If search results are thin, say so rather than padding with speculation
- Maximum 5 search queries per research task (avoid credit waste)
Step 2: Test the research workflow
With the skill in place, give your agent a research task:
Research the competitive landscape for AI-powered email outreach tools.
Focus on pricing, key features, and market positioning.
The agent will:
- Read the research skill instructions
- Run a broad Tavily search for AI email outreach tools
- Identify the most relevant results
- Extract detailed content from key pages
- Synthesize into the structured format defined in the skill
Watch the tool calls — you should see tavily_search followed by one or more tavily_extract calls, then the agent's synthesis.
Step 3: Refine based on output
First runs rarely produce perfect results. Common adjustments:
- Too broad? Add domain filters to the skill instructions: "Focus on tools with MCP or API integration, not general marketing platforms."
- Missing data? Add a step: "If pricing isn't found via search, check the tool's homepage directly with tavily_extract."
- Too many searches? Tighten the guardrail: "Maximum 3 search queries for initial research, 2 for follow-up."
The skill file is your primary control mechanism. Edit it, test again, iterate. This is tool-first design in practice — the tool configuration and skill instructions matter more than prompt engineering.
Building an Outreach Workflow Step by Step
Our second workflow: a sales outreach pipeline that finds prospects, verifies their contact information, and prepares personalized outreach.
Step 1: Define the outreach skill
Create skills/outreach/SKILL.md:
# Outreach Skill
## When to Use
Use this skill when asked to find prospects, build lead lists,
or prepare outreach campaigns.
## Workflow
1. Use Apollo to search for contacts matching the target criteria
2. For each contact, verify email with Reoon
3. Remove contacts with invalid or high-risk emails
4. Research each verified contact's company with Tavily (brief search)
5. Generate personalized email copy based on research
6. Queue the campaign in Instantly
## Guardrails
- Never send emails to unverified addresses
- Maximum 50 contacts per prospecting run
- Always include an unsubscribe option in email copy
- Personalization must reference something specific about
the company — no generic "I noticed your company" filler
- Wait for explicit approval before sending any campaign
Step 2: Connect the tools
The outreach workflow uses four MCP servers in sequence. Let's verify each one works:
Search Apollo for VP of Engineering at Series B SaaS companies in San Francisco, limit 5 results.
This should trigger an Apollo.io tool call and return a list of contacts. Then:
Verify this email address with Reoon: test@example.com
And confirm Instantly.ai is connected:
List my Instantly campaigns.
Each tool should respond without errors. If any fail, check the API key for that specific service.
Step 3: Run the pipeline
Now trigger the full workflow:
Find 10 VPs of Engineering at Series B fintech companies in New York.
Verify their emails, research their companies, and draft personalized
outreach emails. Don't send yet — I want to review first.
The agent chains through the full pipeline:
- Apollo search → returns contacts with names, titles, companies, emails
- Reoon verification → validates each email, flags high-risk addresses
- Tavily research → brief company research for personalization
- Email drafting → generates personalized copy using the research
- Stops for review → respects the "don't send yet" guardrail
The "wait for approval" step is critical. The skill instructions say "Wait for explicit approval before sending any campaign," and the user request reinforced it. Never skip human review on outreach — it's both a best practice and often a legal requirement.
Step 4: Review and send
After reviewing the drafted emails:
These look good. Queue them in Instantly as a new campaign
called "Fintech VPs - Feb 2026" with 2-day intervals between sends.
The agent creates the Instantly campaign with the approved copy and settings.
Combining Workflows for Complex Pipelines
The real power of OpenClaw workflows emerges when you chain them. Our research skill and outreach skill can combine into a pipeline:
Research → Outreach pipeline
Research the AI observability market — who are the key players and
what problems do their customers report? Then find 15 CTOs at
mid-stage companies in this space and prepare an outreach campaign
offering our monitoring solution.
The agent:
- Activates the research skill — searches, extracts, analyzes the market
- Uses research findings to inform targeting criteria
- Switches to the outreach skill — finds contacts, verifies, personalizes
- Personalizes email copy using specific insights from the research phase
Each skill handles its portion of the pipeline, and the agent manages the handoff between them. This is the orchestrator pattern in practice — the agent serves as the coordinator, each skill as a specialized worker.
Managing pipeline complexity
A few principles for keeping combined workflows reliable:
Keep individual skills focused. Each skill should handle one domain. Don't merge research and outreach into a single mega-skill — the agent reasons better with clear boundaries.
Limit total steps. Reliability compounds multiplicatively: 95% per step across 10 steps gives you 60% overall success. Keep pipelines under 8 distinct tool calls where possible.
Add checkpoints. For high-stakes actions (sending emails, making API calls with side effects), add explicit approval gates in the skill instructions. The "don't send without approval" pattern is a checkpoint.
Monitor token usage. Combined workflows consume more context. Put unchanging instructions (skill files, system prompts) at the front of context where they benefit from token caching — cached tokens are roughly 75% cheaper. Budget your context window: system instructions should use 10-15%, tool schemas 15-20%, and leave the rest for working memory.
For more on production-grade error handling and scaling patterns, see our guide on building agent workflows that survive production.
Saving and reusing workflows
Once a workflow is working, you can trigger it with a shorthand:
Run the fintech outreach pipeline for companies in Austin, TX.
Same criteria as last time, 20 prospects.
The agent recognizes the pattern from prior runs and applies the same skill sequence with updated parameters. Over time, your library of tested workflows becomes a reusable toolkit — the compound advantage of build openclaw workflow iterations that work.
Frequently Asked Questions
What are OpenClaw workflows?
OpenClaw workflows are goal-driven sequences where an AI agent uses tools and skills to accomplish multi-step tasks. Unlike hard-coded scripts, the agent decides which tools to call and in what order based on the goal you describe. Workflows are built from skills (instruction files that teach the agent specialized processes), MCP servers (external tools the agent can call), and the agent's own reasoning. You define the tools and guardrails; the agent handles execution.
How do I build my first OpenClaw workflow?
Start with three steps: configure one or two MCP servers in your openclaw.yaml (Tavily for search is the easiest starting point), create a skill file in skills/your-skill/SKILL.md with instructions for when and how to use the tools, and give your agent a task that matches the skill. The agent reads the skill instructions, calls the configured tools, and produces results. Iterate on the skill file based on output quality — this is your primary control mechanism. See our OpenClaw skills guide for details on skill architecture.
How many MCP servers should I use in a workflow?
Two to four MCP servers per workflow is the practical sweet spot. Each server adds tool schemas to the agent's context, and too many tools cause selection confusion or wasted tokens. A research workflow typically needs one to two tools (search + extraction). An outreach workflow typically needs three to four (prospecting + verification + sending + research). Combined pipelines may use more, but keep the total under eight distinct tool calls per run for reliability — each step compounds failure probability.
Can I combine multiple OpenClaw workflows?
Yes, and this is where OpenClaw's skill system shines. Each skill handles a focused domain (research, outreach, data analysis), and the agent coordinates between them based on the task. A prompt like "research this market, then find prospects and prepare outreach" activates both skills sequentially. Keep individual skills focused on one domain, add approval checkpoints before high-stakes actions, and limit total pipeline steps to maintain reliability. The agent manages handoffs between skills automatically.
How do I debug an OpenClaw workflow that's not working?
Start by isolating which step fails. Test each MCP server independently with a simple query — if a tool doesn't respond, the issue is configuration (check API keys, PATH, and config file format). If tools work individually but the workflow produces bad results, the problem is usually in the skill instructions — the agent is following them literally, so ambiguous instructions produce ambiguous results. Tighten the skill file, add explicit step ordering, and include guardrails for edge cases. OpenClaw logs tool calls and agent reasoning, so review the trace to see exactly where the workflow diverged from expectations.