Phase 7 / Ep 34: Agent Custom Workflow —— Enabling Agents to Define Their Own Working Style
🎯 Learning Objective: Enable Agents to autonomously create and manage workflows.
1. Cron Scheduled Tasks
Enable Agents to execute tasks according to a schedule:
# Send daily report at 8 AM every day
openclaw cron add "Daily Briefing" --schedule "0 8 * * *" --action "Summarize yesterday's important events and send via Telegram"
# Check server status every hour
openclaw cron add "Server Inspection" --schedule "0 * * * *" --agent ops-agent --action "Check CPU, memory, disk usage"
# Generate weekly report every Monday
openclaw cron add "Weekly Report" --schedule "0 9 * * 1" --action "Organize all conversation summaries from this week and generate a weekly report"
# List all scheduled tasks
openclaw cron list
# Remove a task
openclaw cron remove "Daily Briefing"
2. Agent Collaboration
Define collaboration rules via BOOTSTRAP.md:
# Collaboration Rules
When the user requests research:
1. Forward the task to research-agent
2. Wait for research-agent to return results
3. Organize and inform the user
When the user requests deployment:
1. First, have code-agent run tests
2. After tests pass, have ops-agent execute deployment
3. Notify the user once deployment is complete
sequenceDiagram
actor User as 🧑 User
participant PA as 🧑💼 Personal
participant CA as 💻 Code Agent
participant OA as 🔧 Ops Agent
User->>PA: "Help me deploy the latest version"
PA->>CA: "Please run tests to confirm the code is correct"
CA->>CA: npm test → ✅ All passed
CA->>PA: "Tests passed, ready for deployment"
PA->>OA: "Please deploy the main branch to production"
OA->>OA: docker compose up -d
OA->>PA: "Deployment complete, service restarted"
PA->>User: "✅ Deployment complete! Tests passed + service restarted"3. Agent Self-Evolution
Agents can improve themselves based on feedback:
# BOOTSTRAP.md
## Self-Improvement
Every Sunday at 10 PM:
1. Review all conversations from this week
2. Identify recurring issues
3. Update common Q&A in MEMORY.md
4. If a certain Skill is frequently used, suggest installing a more efficient alternative version
Next Episode Preview: Ep 35, In-depth Session Analysis—The complete lifecycle of conversation creation, maintenance, compression, and archiving.