taskflow-inbox-triage
$
npx mdskill add openclaw/openclaw/taskflow-inbox-triageTriage inbox items using TaskFlow with routing and summaries
- Classifies inbox items into business, personal, or end-of-day summary
- Uses TaskFlow, Slack, and agent runtime for triage and replies
- Routes items based on classification and waits for required replies
- Delivers categorized results and summaries to the user or agent
SKILL.md
.github/skills/taskflow-inbox-triageView on GitHub ↗
---
name: taskflow-inbox-triage
description: "Example TaskFlow pattern for inbox triage, intent routing, waiting on replies, and later summaries."
metadata: { "openclaw": { "emoji": "📥" } }
---
# TaskFlow inbox triage
This is a concrete example of how to think about TaskFlow without turning the core runtime into a DSL.
## Goal
Triage inbox items with one owner flow:
- business -> post to Slack and wait for reply
- personal -> notify the owner now
- everything else -> keep for end-of-day summary
## Pattern
1. Create one flow for the inbox batch.
2. Run one detached task to classify new items.
3. Persist the routing state in `stateJson`.
4. Move to `waiting` only when an outside reply is required.
5. Resume the flow when classification or human input completes.
6. Finish when the batch has been routed.
## Suggested `stateJson` shape
```json
{
"businessThreads": [],
"personalItems": [],
"eodSummary": []
}
```
Suggested `waitJson` when blocked on Slack:
```json
{
"kind": "reply",
"channel": "slack",
"threadKey": "slack:thread-1"
}
```
## Minimal runtime calls
```ts
const taskFlow = api.runtime.tasks.flow.fromToolContext(ctx);
const created = taskFlow.createManaged({
controllerId: "my-plugin/inbox-triage",
goal: "triage inbox",
currentStep: "classify",
stateJson: {
businessThreads: [],
personalItems: [],
eodSummary: [],
},
});
const child = taskFlow.runTask({
flowId: created.flowId,
runtime: "acp",
childSessionKey: "agent:main:subagent:classifier",
task: "Classify inbox messages",
status: "running",
startedAt: Date.now(),
lastEventAt: Date.now(),
});
if (!child.created) {
throw new Error(child.reason);
}
const waiting = taskFlow.setWaiting({
flowId: created.flowId,
expectedRevision: created.revision,
currentStep: "await_business_reply",
stateJson: {
businessThreads: ["slack:thread-1"],
personalItems: [],
eodSummary: [],
},
waitJson: {
kind: "reply",
channel: "slack",
threadKey: "slack:thread-1",
},
});
if (!waiting.applied) {
throw new Error(waiting.code);
}
const resumed = taskFlow.resume({
flowId: waiting.flow.flowId,
expectedRevision: waiting.flow.revision,
status: "running",
currentStep: "route_items",
stateJson: waiting.flow.stateJson,
});
if (!resumed.applied) {
throw new Error(resumed.code);
}
taskFlow.finish({
flowId: resumed.flow.flowId,
expectedRevision: resumed.flow.revision,
stateJson: resumed.flow.stateJson,
});
```
## Related example
- `skills/taskflow/examples/inbox-triage.lobster`
More from openclaw/openclaw
- 1passwordSet up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.
- acp-routerRoute plain-language requests for Pi, Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.
- apple-notesCreate, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.
- apple-remindersList, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.
- autoreviewAutoreview closeout: local dirty changes, PR branch vs main, parallel tests.
- bear-notesCreate, search, and manage Bear notes via grizzly CLI.
- blogwatcherMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
- blucliBluOS CLI (blu) for discovery, playback, grouping, and volume.
- browser-automationUse when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.
- camsnapCapture frames or clips from RTSP/ONVIF cameras.