This tutorial will guide you through setting up your first automation with OpenClaw (formerly Moltbot, Clawdbot). We'll create a practical example: a daily briefing that runs every morning. By the end, you'll understand how to automate any task. Estimated time: 15-20 minutes.

📚 Reference: For complete automation features, webhook setup, hooks, and all configuration options, see the Automation Reference Guide.

What We'll Build

We'll create a Daily Briefing Automation that:

  • Runs automatically every morning at 9 AM
  • Sends you a summary of the day ahead
  • Demonstrates cron job configuration
  • Can be easily customized for your needs

This example covers the fundamentals you need to automate any task.

Prerequisites

Before starting, ensure you have:

  • OpenClaw installed and running - Complete the Getting Started Tutorial
  • A channel connected - Follow the Channel Setup Tutorial
  • Gateway running - Your OpenClaw Gateway should be active
  • Basic understanding of cron syntax - We'll explain it, but familiarity helps

Step 1: Understand Automation Types

OpenClaw supports several automation types:

⏰ Cron Jobs

Scheduled tasks that run at specific times (daily, weekly, etc.)

🔗 Webhooks

Trigger actions from external services (GitHub, Sentry, etc.)

💓 Heartbeat

Continuous monitoring with configurable intervals

For this tutorial, we'll focus on cron jobs - the most common automation type. See the Automation Reference for webhooks and other types.

Step 2: Plan Your Automation

Before writing configuration, let's plan what our automation will do:

Automation Details

  • What: Send a daily briefing message
  • When: Every morning at 9:00 AM
  • How: Use OpenClaw's agent to generate and send the briefing
  • Where: Send to your connected channel (Telegram, WhatsApp, etc.)

Understanding Cron Syntax

Cron uses a time-based schedule format:

Cron Format
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)
│ │ │ │ │
* * * * *

Examples:

  • 0 9 * * * - Every day at 9:00 AM
  • 0 */6 * * * - Every 6 hours
  • 0 9 * * 1 - Every Monday at 9:00 AM
  • */15 * * * * - Every 15 minutes

Step 3: Create Your Automation

Now let's add the automation to your OpenClaw configuration.

Step 3.1: Open Configuration File

Open your OpenClaw configuration file:

Open Configuration
nano ~/.clawdbot/moltbot.json
# or use your preferred editor

Step 3.2: Add Cron Configuration

Add the cron section to your configuration. Here's a complete example:

Automation Configuration
{
  "agent": {
    "model": "anthropic/claude-opus-4-5"
  },
  "cron": {
    "jobs": [
      {
        "schedule": "0 9 * * *",
        "command": "agent --message 'Create my daily briefing for today. Include: weather summary, calendar events, and any important reminders.'"
      }
    ]
  }
}

What this does:

  • "schedule": "0 9 * * *" - Runs at 9:00 AM every day
  • "command" - The command to execute (sends a message to the agent)
  • The agent will process the message and send the response to your connected channel
✅ Customization: You can customize the message to ask for anything you want in your daily briefing - news summaries, task lists, weather, calendar events, etc.

Step 4: Save and Restart

After adding your automation configuration:

  1. Save the configuration file
  2. Restart your Gateway to load the new automation
Restart Gateway
# If running as service:
openclaw gateway restart

# Or if running manually, stop and restart:
openclaw gateway --port 18789 --verbose

The Gateway will now load your cron jobs and schedule them according to your schedule.

Step 5: Test Your Automation

You don't have to wait until 9 AM to test! Let's verify it works:

Method A: Test Immediately

Run the command manually to test:

Test Automation
openclaw agent --message 'Create my daily briefing for today. Include: weather summary, calendar events, and any important reminders.'

This should trigger the same response your automation will send. Check your connected channel for the message.

Method B: Test with Short Schedule

For testing, you can temporarily change the schedule to run more frequently:

Test Schedule (Every 5 Minutes)
{
  "cron": {
    "jobs": [
      {
        "schedule": "*/5 * * * *",
        "command": "agent --message 'Test briefing'"
      }
    ]
  }
}

Remember to change it back to your desired schedule after testing!

Step 6: Verify Automation is Running

Check that your automation is scheduled correctly:

Check Gateway Logs

Look for messages in your Gateway logs indicating cron jobs are loaded:

View Logs
# If running as service, check logs:
openclaw gateway logs

# Or check system logs (macOS):
log show --predicate 'process == "openclaw"' --last 5m

Wait for Scheduled Time

If you set it to run at a specific time, wait until that time and check your channel for the automated message.

✅ Success: If you receive the automated message at the scheduled time, your automation is working correctly!

More Automation Examples

Here are more practical automation examples you can use:

Example 1: Weekly Summary

Weekly Summary
{
  "cron": {
    "jobs": [
      {
        "schedule": "0 18 * * 5",
        "command": "agent --message 'Create a weekly summary of my accomplishments and tasks completed this week.'"
      }
    ]
  }
}

Runs every Friday at 6:00 PM.

Example 2: Reminder Check

Reminder Check
{
  "cron": {
    "jobs": [
      {
        "schedule": "0 8 * * *",
        "command": "agent --message 'Check my calendar and remind me of any important events or deadlines today.'"
      }
    ]
  }
}

Runs every morning at 8:00 AM.

Example 3: Multiple Automations

You can have multiple cron jobs:

Multiple Jobs
{
  "cron": {
    "jobs": [
      {
        "schedule": "0 9 * * *",
        "command": "agent --message 'Daily briefing'"
      },
      {
        "schedule": "0 18 * * *",
        "command": "agent --message 'Evening summary'"
      },
      {
        "schedule": "0 0 * * 1",
        "command": "agent --message 'Weekly planning session'"
      }
    ]
  }
}

Troubleshooting

Automation Not Running

If your automation doesn't run:

  1. Check cron syntax: Verify your schedule format is correct
  2. Verify Gateway is running: openclaw gateway status
  3. Check configuration file: Ensure JSON is valid (no syntax errors)
  4. Review Gateway logs: Look for error messages about cron jobs
  5. Restart Gateway: Sometimes a restart is needed to load new automations

Wrong Time Zone

Cron jobs use your system's timezone. If times seem wrong:

  • Check your system timezone: date
  • Adjust your schedule accordingly
  • Or set a specific timezone in your system settings

Command Not Executing

If the command doesn't execute:

  • Test the command manually first (outside of cron)
  • Check that the agent command syntax is correct
  • Verify your channel is connected (for message delivery)

Next Steps

Now that you understand automation basics, explore advanced features:

🔗 Set Up Webhooks

Trigger automations from external services like GitHub, Sentry, or custom apps.

Webhooks Guide →

💓 Use Heartbeat

Set up continuous monitoring with configurable intervals.

Heartbeat Guide →

🔧 Advanced Automation

Combine with skills, webhooks, and complex workflows.

Advanced Guide →

Best Practices

  • Start Simple - Begin with basic cron jobs before complex webhooks
  • Test First - Always test commands manually before automating
  • Monitor Logs - Keep an eye on automation execution logs
  • Handle Errors - Ensure automations handle failures gracefully
  • Be Mindful of Rate Limits - Don't create automations that hit API limits
  • Secure Webhooks - If using webhooks, add authentication

Continue Learning