@maplezzk/pi-dynamic-workflows
Claude-Code-style dynamic workflow orchestration for Pi. Fork of michaelliv/pi-dynamic-workflows.
Package details
Install @maplezzk/pi-dynamic-workflows from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@maplezzk/pi-dynamic-workflows- Package
@maplezzk/pi-dynamic-workflows- Version
1.1.3- Published
- Jul 31, 2026
- Downloads
- 523/mo · 332/wk
- Author
- maplezzk
- License
- MIT
- Types
- extension
- Size
- 103.2 KB
- Dependencies
- 2 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./index.ts",
"../pi-extensions-i18n/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-dynamic-workflows
Claude-Code-style dynamic workflow orchestration for Pi.
Fork notice: This package is a fork of michaelliv/pi-dynamic-workflows (MIT license). Full credit to the original author michaelliv for the design and implementation. Changes in this fork: monorepo integration, i18n support, and config migration from environment variables to a slash command.
Features
- Define multi-agent workflows as plain JavaScript scripts with
meta,phase(),agent(),parallel(), andpipeline()primitives - Static validation of workflow scripts via acorn AST parsing
- Optional subagent backend via
pi-interactive-subagentsfor real tool access per agent - Async background execution mode with live status widget
- Configurable via
/config:workflowslash command (persisted to JSON)
Installation
pi install npm:@maplezzk/pi-dynamic-workflows
Configuration
Run /config:workflow to interactively configure:
- Execution backend:
workflow(built-in in-process agent) orsubagent(requirespi-interactive-subagentsto be installed and loaded; each agent gets a real tool session) - Async mode: run workflows in the background with a live status widget
Config is persisted to ~/.pi/agent/extensions/pi-dynamic-workflows/config.json.
Environment variables are supported as fallback only:
| Variable | Values | Effect |
|---|---|---|
PI_WORKFLOW_BACKEND |
subagent |
Use subagent backend (fallback) |
PI_WORKFLOW_ASYNC |
true |
Enable async mode (fallback) |
JSON config takes priority over environment variables.
Note: The
subagentbackend depends on thepi-interactive-subagentsextension injecting its capabilities intoglobalThis.__pi_subagentsat runtime. If the backend is set tosubagentbut that extension is not installed/loaded, everyagent()call in the workflow will fail.
Troubleshooting
Error: the subagent execution backend requires the pi-interactive-subagents extension, which is not currently loaded
Cause: the workflow execution backend is set to subagent, but the pi-interactive-subagents extension is not installed or not loaded, so globalThis.__pi_subagents is not injected.
The subagent backend can be activated by either of:
- The
PI_WORKFLOW_BACKEND=subagentenvironment variable - The persisted config written by
/workflow-config(~/.pi/agent/extensions/pi-dynamic-workflows/config.json)
Fix (choose one):
Install and load the extension (keep using the subagent backend):
pi install npm:@maplezzk/pi-interactive-subagentsSwitch back to the built-in
workflowbackend: run/config:workflowand set the execution backend toworkflow. The persisted config takes priority over environment variables, so this overridesPI_WORKFLOW_BACKEND.If you enabled it via an environment variable, remove
export PI_WORKFLOW_BACKEND=subagentfrom your shell config (e.g..zshrc/.zshenv) and restart pi.
/workflow-config and /pi-workflow-config remain available as compatibility aliases.
Usage
// In a workflow script passed to the workflow tool:
export const meta = {
name: 'my_workflow',
description: 'Does something useful',
phases: [{ title: 'Phase 1' }]
};
phase('Phase 1');
const result = await agent('Analyze the codebase', {
label: 'code analysis',
schema: { type: 'object', properties: { summary: { type: 'string' } }, required: ['summary'] }
});
License
MIT — see original repository for details.