Use when a QwenPaw-backed Worker needs to decide whether to do work directly, use native subagents for internal parallelism, or create a temporary QwenPaw agent with a custom AGENTS.md and skills.
68
81%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill before splitting work inside a single Worker. WorkerFlow is not TeamHarness delegation.
| Need | Path |
|---|---|
| Current Worker can do it directly | No subagent |
| Same Worker needs short parallel inspection | QwenPaw native subagent |
Same Worker needs visible fan-out to custom roles, workspaces, AGENTS.md, or skills | Dynamic workflow via worker_agentflow workflow_run |
| Same Worker needs one manually controlled temporary subagent | create_temp_agent directly |
| Work needs a persistent team member or Leader acceptance | Do not use WorkerFlow; use the team workflow |
Use QwenPaw native subagents for short internal parallelism. The current Worker still owns the final result.
Do not create a temporary agent when no custom prompt, workspace, or skill set is required.
Use worker_agentflow with workflow_run when a custom AgentSpec-style
template has already been placed in the default QwenPaw workspace:
<QWENPAW_WORKING_DIR>/workspaces/default/subagents/<role>/
AGENTS.md
PROFILE.md # optional
SOUL.md # optional
skills/
<skill-id>/
SKILL.mdUse list_subagents first when you need to discover the templates available in
the default workspace. Use create_temp_agent directly only when you need
manual control outside a dynamic workflow.
Subagent template rules:
AGENTS.md should tell the temporary agent to begin analysis immediately.AGENTS.md should forbid greetings, self-introductions, and capability
summaries.AGENTS.md should define the subagent's focus area so the Worker can send the
complete source input instead of manually slicing the input.AGENTS.md should require
the same fixed output shape.Dynamic workflow lifecycle:
workflow_run with the explicit current DM/conversation roomId,
title, source input, optional merge.instruction, and either
subagents or DAG nodes.subagent
and a bounded task.workflow_run starts the Matrix card, creates tmp-... subagents, creates the
run-level shared directory, stores workflow.json, and returns
submitInstructions for nodes that are ready now.submitPrompt to its agentId using the available
QwenPaw agent communication tools.workflow_update with a steps row whose
id matches the node id, status is done, and summary contains the
short result.nodes, inspect every workflow_update response. If it returns
readyInstructions, immediately send each returned submitPrompt to its
agentId.workflow_update at meaningful phase changes: submitted, running,
retrying, merging, cleanup, done, or failed.delete_temp_agent.workflow_finish or workflow_fail.cleanup_shared.Example workflow_run input:
{
"action": "workflow_run",
"roomId": "!current-dm:example.test",
"runId": "run-review-auth",
"title": "Review auth module",
"input": "Review auth.py for this task...",
"subagents": [
{
"id": "security",
"subagent": "security-reviewer",
"task": "Check authentication and authorization risks."
},
{
"id": "tests",
"subagent": "test-reviewer",
"task": "Check test coverage gaps."
}
],
"merge": {
"instruction": "Return one severity-ordered finding list."
}
}DAG nodes example:
{
"action": "workflow_run",
"roomId": "!current-dm:example.test",
"runId": "pig-diagnosis-b001",
"title": "猪病诊断报告生成",
"input": "批次号 B001 的猪病诊断请求...",
"nodes": [
{
"id": "base_info",
"name": "基础信息梳理",
"role": "基础信息梳理",
"subagent": "base-info-agent",
"task": "处理基础信息。"
},
{
"id": "feed_cough",
"name": "采食与咳喘指标",
"role": "采食与咳喘指标",
"subagent": "feed-cough-agent",
"task": "分析采食及咳嗽波动。"
},
{
"id": "pathogen",
"name": "病原线索分析",
"role": "病原线索分析",
"subagent": "pathogen-agent",
"task": "分析病原及亚型。"
},
{
"id": "disease_analysis",
"name": "疾病综合研判",
"role": "疾病综合研判",
"subagent": "disease-analysis-agent",
"task": "综合基础信息、采食咳嗽和病原结果,判断猪病。",
"dependsOn": ["base_info", "feed_cough", "pathogen"]
},
{
"id": "medication",
"name": "用药与处置措施",
"role": "用药与处置措施",
"subagent": "medication-measures-agent",
"task": "基于猪病分析生成药物及措施方案。",
"dependsOn": ["disease_analysis"]
},
{
"id": "diagnosis_advice",
"name": "诊断建议",
"role": "诊断建议",
"subagent": "diagnosis-advice-agent",
"task": "基于猪病分析生成诊断建议。",
"dependsOn": ["disease_analysis"]
},
{
"id": "report",
"name": "最终报告汇总",
"role": "最终报告汇总",
"subagent": "report-agent",
"task": "汇总上游结果生成最终诊断报告。",
"dependsOn": ["medication", "diagnosis_advice"]
}
]
}For DAG workflows, workflow_run creates every node's temporary agent. Only
dependency-free nodes appear in submitInstructions. Dependent nodes appear in
waitingInstructions. The current Worker is the scheduler: submit ready nodes,
wait for their replies, call workflow_update with done steps, then submit
any downstream readyInstructions returned by that update. WorkerFlow uses the
done step ids as the dependency-completion signal and appends upstream summaries
to newly unblocked submit prompts.
File sharing:
/api/agents have separate
workspaces. Do not point their workspaceDir at the default workspace.workflow_run and create_temp_agent expose a run-level shared directory:
<default-workspace>/shared/workerflow/<sharedRunId>/.shared/inputs/.shared/outputs/<agent-id>/..workerflow/shared.json and a shared
symlink for discovery, but prompts should still include the absolute
shared.path, shared.inputs, and shared.output returned by the tool.cleanupWorkspace may delete that workspace.Workflow visibility:
workflow_run for visible multi-subagent work; it creates the first
Matrix m.notice card and records the returned eventId.workflow_run and workflow_start require an explicit current
DM/conversation roomId.
WorkerFlow does not fallback to Team Room or personal room.workflow_update, workflow_finish, and workflow_fail to edit the same
card through Matrix m.replace.<default-workspace>/shared/workerflow/<run-id>/workflow.json.Fan-out rules:
AGENTS.md.Rules:
tmp- ids for temporary agents.785c2db
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.