clawflows
OpenClaw workflow automation: multi-step task chains, conditional logic, triggers, schedule
What this skill does
# clawflows
## Purpose
This skill automates workflows in OpenClaw by defining multi-step task chains, incorporating conditional logic, triggers, and scheduling to streamline complex operations.
## When to Use
Use this skill for repetitive task sequences, like processing data pipelines, conditional decision-making (e.g., if a file exists, then execute), event-driven triggers (e.g., on API call), or scheduled jobs (e.g., daily reports). Apply it in scenarios requiring orchestration, such as integrating multiple OpenClaw tools or external services.
## Key Capabilities
- Define task chains: Specify steps in a JSON config, e.g., {"steps": [{"name": "step1", "action": "run_script"}, {"name": "step2", "action": "send_email"}]}
- Conditional logic: Use if-else in configs, e.g., {"condition": "if status == 'success' then next: step2 else: abort"}
- Triggers: Set event-based triggers like webhooks or file changes, e.g., via {"trigger": {"type": "http", "endpoint": "/webhook"}}
- Scheduling: Use cron-style schedules, e.g., {"schedule": "0 0 * * *"} for midnight daily runs
- Error recovery: Built-in retries for failed steps, configurable per step
## Usage Patterns
To create and run a workflow, start by defining a config file (JSON/YAML), then use CLI or API to execute. For simple flows, use CLI directly; for programmatic use, integrate via API. Always set environment variables for authentication, e.g., export CLAWFLOWS_API_KEY=$SERVICE_API_KEY. Test flows in isolation before scheduling. Common pattern: Load config, validate, run, and monitor output.
## Common Commands/API
Use the OpenClaw CLI for quick operations:
- Create a flow: `clawflows create --name myworkflow --config path/to/config.json --cluster community`
- Run a flow: `clawflows run --flow-id 123 --env VAR=VALUE` (outputs status JSON)
- Schedule a flow: `clawflows schedule --flow-id 123 --cron "0 9 * * *" --trigger-type http`
- API endpoints: POST /api/workflows to create (body: {"name": "myworkflow", "steps": [...] }), GET /api/workflows/{id} to retrieve
Code snippet for API call in Python:
```python
import requests
headers = {"Authorization": f"Bearer {os.environ['CLAWFLOWS_API_KEY']}"}
response = requests.post("https://api.openclaw.com/api/workflows", headers=headers, json={"name": "test", "steps": [{"action": "echo hello"}]})
print(response.json())
```
Config format example (JSON):
{
"steps": [
{"name": "step1", "action": "run_command", "command": "ls -l"},
{"name": "step2", "condition": "step1.success", "action": "log_message", "message": "Success!"}
]
}
## Integration Notes
Integrate clawflows with other OpenClaw skills by referencing them in step actions, e.g., {"action": "call_skill", "skill_id": "another_skill"}. For authentication, use env vars like $CLAWFLOWS_API_KEY for API requests. When combining with external tools, map outputs via JSON paths, e.g., in config: {"input_mapping": {"var1": "$.output.data"}}. Ensure compatibility by specifying cluster in commands, e.g., --cluster community. For webhooks, expose an endpoint that triggers flows via POST /api/triggers/{flow-id}.
## Error Handling
Common errors include authentication failures (HTTP 401), invalid configs (e.g., syntax errors in JSON), or step timeouts. To handle: Check for $CLAWFLOWS_API_KEY before running; use `clawflows validate --config path/to/config.json` to catch issues early. In code, wrap API calls in try-except blocks:
```python
try:
response = requests.post("https://api.openclaw.com/api/workflows", headers=headers, json=data)
response.raise_for_status()
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.status_code} - {e.response.text}")
```
For runtime errors, configure retries in config, e.g., {"step": {"action": "...", "retries": 3, "timeout": 30}}. Monitor logs with `clawflows logs --flow-id 123` and abort on critical failures using conditional steps.
## Concrete Usage Examples
Example 1: Automate a data backup flow. Create a config file: {"steps": [{"name": "backup", "action": "run_command", "command": "rsync /data/ backup-server:"}, {"condition": "backup.success", "action": "send_email", "to": "[email protected]", "subject": "Backup complete"}]} Then run: `clawflows create --name backupflow --config backup.json` and schedule: `clawflows schedule --flow-id 456 --cron "0 2 * * *"`
Example 2: Trigger a workflow on file change. Define: {"trigger": {"type": "file_watch", "path": "/monitored/dir"}, "steps": [{"action": "process_file", "file": "$.trigger.file"}]} Execute via API: POST /api/workflows with the config, then monitor with `clawflows run --flow-id 789 --watch`.
## Graph Relationships
- Relates to: openclaw-core (for basic task execution), openclaw-triggers (for event handling), community-cluster (as part of the ecosystem)
- Depends on: authentication services for API access
- Integrates with: external APIs via steps, e.g., for data fetching or notifications
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.