workflow-authoring
What it does
It is a reference for writing the script behind a workflow, covering parallel and sequential steps, checks and resuming. It is for people who build reusable agent workflows for larger jobs such as migrations or audits.
When to use it
- βWhen you are writing a script for a workflow that splits work across several agents.
- βWhen a large job such as a migration or audit needs parallel steps and checks.
- βWhen you need to choose between running steps in parallel or in sequence.
Skill link
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/workflow-authoring/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βHelp me write a workflow script that audits every module in this repo in parallel and then combines the findings.β
5 new skills a week. 1 minute to read.
How it works
The reference explains how to structure the script, when to fan out work, how to verify results, and how to combine them. It does not start a run by itself.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Workflow authoring reference
Everything below is about writing the script. Whether a workflow may run at all is decided by the Workflow tool's own opt-in rule β this reference does not authorize a run.
Reach for one to be comprehensive (decompose the work and cover every part in parallel), to be confident (independent perspectives and adversarial checks before an answer is committed to), or to take on scale a single context cannot hold β migrations, audits, broad sweeps. The script is where that structure is encoded: what fans out, what verifies, what synthesizes. Parallelism on its own is not a reason; work that is already one short sequence of edits belongs in the main loop.
Scout first, then orchestrate
The strongest pattern is hybrid: discover the work list in the main loop (list the files, scope the diff, read the failing test), then hand that list to a workflow. You do not need to know the shape of the work before the task β only before the orchestration step. When the work has distinct phases, run several small workflows across turns and read each result before choosing the next, rather than authoring one large script that runs unattended.
Common single-phase shapes: understand (parallel readers over subsystems,
merged into one map), design (independent approaches, judged, then
synthesized), review (dimensions, find, verify each finding), research (broad
sweep, deep read, synthesis), migrate (discover sites, transform each under
isolation: 'worktree', verify).
Script contract
The source is wrapped as an async IIFE, so top-level await and a top-level
return are both legal β and a trailing expression is not a return value.
End every successful path with an explicit return.
It is plain JavaScript, not TypeScript, and it cannot import anything. A
script with a dynamic import() anywhere in it β even in a branch that never
runs β is refused before it starts, so none of its agents runs first; do file,
network, and package work inside an agent instead.
The script may start with a literal export const meta = {...} declaration
with name, description, and optionally whenToUse and
phases: [{ title, detail? }]. It must be a pure literal β no variables,
calls, or interpolation β and it is stripped before execution, so nothing in
the script body can read it. Fields outside that list are dropped. The
approval dialog prints the name, the description, and each phase title with
its detail as a one-line explanation beside it: give every phase a detail,
because for a run that may dispatch hundreds of agents it is what the user
reads before approving. In a workflow an extension ships, whenToUse also lists
the workflow for the model to start when a request matches it; leave it out and
the workflow runs only when someone asks for it by name.
Injected globals, and nothing else:
phase(title)β open a phase. Everything dispatched afterwards is attributed to it in the live phase tree, until the next phase opens.log(msg)β one line into the run log the user watches.agent(prompt, opts?)β dispatch one subagent. See agent() options.parallel(thunks)β run thunks through the shared concurrency window, resolving to a position-aligned array.parallel()itself rejects on invalid arguments.pipeline(items, ...stages)β run each item through the stages independently. See Default topipeline().workflow(nameOrRef, args?, { stepId }?)β run a saved workflow inline. See Saved workflows and workflow().argsβ the structured value the caller passed, orundefined.budgetβ{ total, spent(), remaining() }. See Scaling to the token budget.
Pass THUNKS to parallel(), not eager calls: parallel([() => agent(...)]),
not parallel([agent(...)]). The eager form is refused outright: a
non-function element rejects the whole batch, and by then every agent() in it
has already been admitted, counted against the caps, and spent β with its
result discarded.
Each list a single call takes β the thunks of parallel(), and the items and
the stages of pipeline() β holds at most 4096 entries. A longer list rejects
the whole call before any of its thunks or stages runs; it is never truncated.
Like any invalid argument, that rejection can be caught, and inside an outer
parallel()/pipeline() it becomes that slot's null. The limit is per call,
not per run: split a larger input into batches of thunks and await each in
turn. Batching does not
FAQ
Does reading this start a workflow?
No. It explains how to write the script, and a run still needs your approval.
When should I not use a workflow?
When the work is one short sequence of edits, it belongs in the normal loop instead.
Can I run the work in phases?
Yes. The reference suggests running small workflows across turns and reading each result before the next.
Details
Original description by the author
Reference for writing a Workflow tool script (script API and gotchas, agent() options, pipeline() vs parallel(), verification and convergence patterns, resume, worked example). Load before authoring a script for a workflow the user already opted into; it does not itself authorize running one.
repo: QwenLM/qwen-code
Popularity
- GitHub stars
- 29k
- Ranking position
- #9788
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
codegraph
29kHelps your agent analyze an indexed codebase through its call graph, dependencies, dead code, hotspots and semantic search.
qwen-code-claw
29kHelps your agent hand coding tasks to Qwen Code, such as understanding a codebase, fixing bugs, refactoring code or generating a new project.
structured-debugging
29kTeaches your agent a step-by-step way to debug hard bugs: form a hypothesis, add targeted checks, test it and find the real cause before fixing.
tmux-real-user-testing
29kHelps your agent test a terminal app like a real user inside tmux, saving a step-by-step readable log with a screen snapshot of each action.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.