Dynamic workflows let Qoder CN CLI run structured, multi-agent processes in the background. They are well suited for tasks that require phased execution, large-scale concurrency, cross-validation, or the reuse of a fixed process.
A dynamic workflow places the orchestration plan in a JavaScript script. The script decides which subagents to start, how to divide phases, how to merge intermediate results, and what result to ultimately return to the current session.
You can use a dynamic workflow when a task is clearly larger than a single agent call: repository audits, deep research, migration planning, release checks, cross-file scans, or review processes that require multiple independent perspectives before being aggregated.
You can ask Qoder CN CLI to use a dynamic workflow in natural language:
You can also directly call a saved or built-in dynamic workflow by name:
Qoder CN CLI may create a dynamic workflow for the current request, or it may directly use an existing dynamic workflow when one matches the task. A dynamically generated workflow shows its plan before execution; you can run it, view the raw script, reject it with feedback, or cancel it.
Dynamic workflows run as background tasks. After it starts, Qoder CN CLI returns a run ID and continuously shows the execution progress in the task interface.
In the TUI, use
In the panel, you can view running and completed dynamic workflows and inspect their status, phases, agents, logs, output paths, errors, and final results.
A saved dynamic workflow can be reused by name. Qoder CN CLI discovers dynamic workflows from the following locations:
When names conflict, a project-level dynamic workflow takes precedence over plugin-level and built-in dynamic workflows. Team-shared processes are best placed in the project-level directory; personal processes that should not be committed to the repository are best placed in the user-level directory.
A saved dynamic workflow is a JavaScript file that begins with a
After saving it to
A saved dynamic workflow can receive input through
A dynamic workflow script is plain JavaScript. The script can use helper functions such as
A dynamic workflow may run multiple subagents and consume tokens quickly. When validating large or high-cost dynamic workflows, we recommend starting with a smaller scope.
Dynamic workflow scripts cannot directly access the shell, file system, network, Node.js APIs, or MCP services. All side effects occur through subagents, which are still subject to Qoder CN CLI's tool, permission, Hook, and sandbox settings.
Use Permissions to control what dynamic workflow subagents can do; use Hooks to enforce organization-level policies before and after tool calls.
When to Use Dynamic Workflows
| Approach | Suitable Scenarios |
|---|---|
| Subagent | A single focused subtask that only needs to return a summary to the main session. |
| Skill | Reusable instructions, domain knowledge, or a process the main agent should follow. |
| Dynamic workflow | Reusable orchestration that requires multiple subagents, multiple phases, parallel branches, or validation rounds. |
What Dynamic Workflows Can Do
| Capability | Description |
|---|---|
| Scripted orchestration | Keeps loops, branches, phases, and intermediate state in the dynamic workflow script. |
| Multi-agent dispatch | Starts multiple subagents for independent slices of work. |
| Phased execution | Shows progress with named phases such as scan, analyze, validate, and summarize. |
| Parallel or pipeline processing | Runs independent branches concurrently, or passes each item through multiple processing phases in sequence. |
| Background execution | After starting a dynamic workflow, you can continue using Qoder CN CLI. |
| Process reuse | Saves common processes as project-level, user-level, plugin-level, or built-in dynamic workflows. |
Running a Dynamic Workflow
You can ask Qoder CN CLI to use a dynamic workflow in natural language:
Viewing Dynamic Workflows
In the TUI, use /workflows to open the dynamic workflow task panel.
/tasks also shows dynamic workflow tasks alongside other background tasks.
While a dynamic workflow is running, you can view individual agents on the details page. If an agent is still controllable, you can skip or retry it on the details page.
Saving Dynamic Workflows
A saved dynamic workflow can be reused by name. Qoder CN CLI discovers dynamic workflows from the following locations:
| Scope | Location | Use Case |
|---|---|---|
| Project-level | .qoder/workflows | The dynamic workflow belongs to the current repository or team. |
| User-level | ~/.qoder-cn/workflows | A personal dynamic workflow that you want to use across projects. |
| Plugin | Dynamic workflows provided by a plugin | The dynamic workflow is distributed with a plugin. |
| Built-in | Dynamic workflows built into Qoder CN CLI | The dynamic workflow is provided by Qoder CN CLI. |
meta export object. The meta information tells Qoder CN CLI the dynamic workflow's name, description, phases, and, optionally, its use case or input schema.
.qoder/workflows/repo-audit.js, you can have Qoder CN CLI use it like this:
args. Target paths, issue IDs, research questions, options, or any value that differs from run to run but should not require modifying the script are all suitable to pass in through args.
How Dynamic Workflows Run
A dynamic workflow script is plain JavaScript. The script can use helper functions such as agent(), parallel(), pipeline(), phase(), log(), workflow(), args, and budget.
- Qoder CN CLI selects a saved dynamic workflow for the task, or creates a new one.
- If review is required, Qoder CN CLI shows the dynamic workflow's name, phases, script, and run options.
- The dynamic workflow starts as a background task.
- The script starts subagents and groups them into different phases.
- Intermediate results are kept in the dynamic workflow runtime and do not fill up the main session context.
- The final result is written to the dynamic workflow run output and summarized back in the current session.
.qoder/sessions.