workspace pack
workspace pack Copy the local workflow source code to the packaging staging directory and use tar to generate the .tgz package. The command only processes local files and does not request Workflow Server.
Workflow/Conversation verificationpackage.jsonandindex.ts;Kanban usespackage.json.workflowCode.projectType: "kanban"to identify and verify the HTML entryconfigured inworkflowCode.kanban.artifactDir. Continue to use the project root directoryindex.htmlif not configured_. The README can serve as the project’s description, but it is not a required file for upload. Images, fonts, and other binary resources are included in the archive and source code repository as-is.
The command does not install or check local project dependencies. Even if the project declares a third-party dependency and does not have a local node_modules, the source code can still be packaged; the dependency is manually installed by the user before running it locally, and the uploaded running product is installed and built by the server.
Command Format
pnpm exec workflow-code workspace pack <workflow> [--path <workflow-dir>] [--output <file.tgz>] [--project-group] [--dependency <alias>=<path>]
Parameter
| Parameter | Description |
|---|---|
<workflow> | Workflow name. The default source directory is workspace/workflow/<workflow>. |
--path <workflow-dir> | Specify the local source directory. |
--output <file.tgz> | Specifies the output package path. Write workspace/.packs when not passed. |
--project-group | Generate the project-group v1 archive for the Kanban root project. |
--dependency <alias>=<path> | Map a mutually confirmed alias in projectInfo.relatedProjects to an included project's local directory; repeatable. Unmapped confirmed relations remain external. |
Default Path
| item | Default value |
|---|---|
| repo root | WORKFLOW_REPO_ROOT, if not set, from the current directory or CLI file location up to find the root directory of the repository containing pnpm-workspace.yaml. |
| Source Directory | <repo-root>/workspace/workflow/<workflow> |
| Output Directory | <repo-root>/workspace/.packs |
| Output file name | <workflow>-<UTC timestamp>.tgz |
.workflowignore
pack reads only the project root .workflowignore and does not read .gitignore in the root or nested directories. The syntax supports comments, directory rules, wildcards, ** and ! reverse inclusions, and paths match by /.
| Scene | Behavior |
|---|---|
| Missing, empty file, or only comments | Upload all common files under the project, and output the number of files and the total size warning. |
.workflowignore Self hit rule | will remain in the archive. |
package.json, entry, or existing kanban.json excluded | Packing failed and the effective rule was indicated. |
| Symbolic links, special files, or case-conflict paths | Reject packaging, not by ignoring the rule release, to avoid the archive coverage differences between Windows, macOS and Linux. |
Kanban does not automatically preserve dist or other product directories; they are not implicitly excluded by the host. You should keep the actual artifactDir in .workflowignore, while excluding src/, test, and source map as needed. .gitignore Whether to ignore the product is independent of the upload.
Project Team Archiving
The project-group root must be a Kanban with workflowCode.projectInfo.relatedProjects. Every --dependency alias must match a mutually confirmed direct relation, and the local dependency UUID must match its declaration; pending relations cannot become included dependencies. Each related UUID is packaged only once. The archive contains project-group.json, the root project package, and the selected dependency packages; each project still selects source through its own .workflowignore.
Packaging will reject symbolic links, special tar entries, as well as .env*, KV, PersistentValue, scheduled tasks, execution history, SQLite, workflow-auth.json, and other host‑specific user configurations; the root user Kanban is also prohibited from declaring their own UUID as a source project. The project team does not carry any locally executed data, nor does it modify any Server states; data initialization is performed by the developer within the corresponding host environment Workflow.
Output
| Situation | Output |
|---|---|
| Success | { "archivePath": "<absolute path>" } |
| Packaging failed | Output error message with exit code 1. |
Example
pnpm exec workflow-code workspace pack hello
pnpm exec workflow-code workspace pack hello --path ./workspace/workflow/hello
pnpm exec workflow-code workspace pack hello --output ./workspace/.packs/hello.tgz
pnpm exec workflow-code workspace pack stock-kanban --project-group \
--path ./stock-kanban \
--dependency stocks=./stock-workflow
Subsequent commands
| Goal | Command |
|---|---|
| Upload the package you just typed | upload --file |
| View the remote version | versions |