pi-dynamic-workflows (GitHub repository)
Key point
**pi-dynamic-workflows** for Pi provides a dynamic workflow feature that lets the model write JavaScript directly to control multiple subagents.
Details
pi-dynamic-workflows is an extension for Pi inspired by Anthropic's Claude Code. This tool provides a dynamic workflow feature in which the model writes JavaScript scripts directly to distribute tasks across multiple independent subagents and then integrate the results back together.
It is optimized for codebase audits, multi-angle reviews, large-scale refactoring, and broad research tasks. When a user requests a workflow in natural language, the model writes and executes the script, and the user can watch progress in real time.
Workflow scripts support the following key Global API:
- agent(): Creates an independent subagent and returns its result
- parallel(): Runs multiple agent tasks in parallel
- pipeline(): Processes items through sequential stages and expands
- phase(): Groups progress for visualization
- budget(): Tracks token usage (total, spent, remaining)
For security and reproducibility, all scripts run inside a Node.js vm sandbox. As a result, non-deterministic or system-access features such as fs, network API, and Math.random() are intentionally restricted.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.