# introducing pi-dynamic-workflows
> 采集时间: 2026-05-30 10:36:47
> 作者: Michael Livs (@micLivs)
> 来源: https://x.com/micLivs/status/2060115468531499224
> 共 14 条帖子
---
## 2026-05-29 05:46:17
introducing pi-dynamic-workflows
This is probably going to be a bigger token burner than pi-goal, BUT, dynamic workflows is the first implementation of subagents that i don't hate, mainly because it's "code mode" for subagents. agent writes a js-based workflow DSL into a dedicated tool, engine parses the workflow code and runs it.
the dsl implements some primitives for the agent (agent(), parallel(), pipeline(), phase() and log()) to keep it as simple as possible.
now available in [@badlogicgames](https://x.com/badlogicgames) pi!
pi install npm:pi-dynamic-workflows
[▶ 视频](https://x.com/micLivs/status/2060115468531499224)
视频缩略图: 
---
## 2026-05-29 05:46:29
**链接卡片**: [GitHub - Michaelliv/pi-dynamic-workflows](https://t.co/ZdMhWBd5es)

---
## 2026-05-29 06:29:59
it is exactly that, but without the vendor lock.
---
## 2026-05-29 07:00:17
traditionally workflows are idempotent and deterministic (specifically their execution steps), there are a bunch of things that will make a workflow non idempotent, for instance - writing a workflow that conditions steps on time based (or date, random numbers, etc) logic. the entire purpose of the vm is to have a place where i can remove access to these things and expose the agentic primitives. anything else is fair game...
---
## 2026-05-29 13:12:58
cheers! will add support for this soon
**链接卡片**: [](https://t.co/BH1XDiQ7eh)
---
## 2026-05-29 13:13:13
cheers!
---
## 2026-05-29 13:13:38
wasn't thinking about this at all actually, i like'd anthropic's idea here.
---
## 2026-05-29 13:14:21
Each subagent will still slop away as much as any agent slops on its own
---
## 2026-05-29 13:15:25
I wouldn't say it's a DAG, its plain JS with some restrictions...
---
## 2026-05-29 13:15:53
Man, i'm too tired.
---
## 2026-05-29 13:16:37
Will add support for forked agents soon!
**链接卡片**: [Support forked agents (fan-out from a shared parent context) · Issue #10 · Michaelliv/pi-dynamic-...](https://t.co/CSlpVYFUUY)

---
## 2026-05-29 17:19:14
Dm me a screenshot?
---
## 2026-05-29 19:31:46
the vm here is basically used as an "ergonomic coding surface" for the agent, just a way to inline business logic in a single tool call. you can obviously do the same thing with monty, or even bash.
**链接卡片**: [Ergonomic coding surfaces for agents (a.k.a Code Mode)](https://t.co/eSnuKD4c9p)

---
## 2026-05-30 04:00:06
Cheers!
---
---
## 中文翻译
# 介绍 pi-dynamic-workflows
> 采集时间: 2026-05-30 10:36:47
> 作者: Michael Livs (@micLivs)
> 来源: https://x.com/micLivs/status/2060115468531499224
> 共 14 条帖子
---
## 2026-05-29 05:46:17
介绍 pi-dynamic-workflows
这可能会比 pi-goal 消耗更多的 Token,但是,动态工作流是我第一个不讨厌的子代理实现,主要是因为它是子代理的“代码模式”。代理将基于 JS 的工作流 DSL 写入专用工具,引擎解析工作流代码并运行它。
该 DSL 为代理实现了一些原语(agent()、parallel()、pipeline()、phase() 和 log()),以尽可能保持简单。
现在 [@badlogicgames](https://x.com/badlogicgames) 的 pi 中已经可用!
pi install npm:pi-dynamic-workflows
[▶ 视频](https://x.com/micLivs/status/2060115468531499224)
视频缩略图: 
---
## 2026-05-29 05:46:29
**链接卡片**: [GitHub - Michaelliv/pi-dynamic-workflows](https://t.co/ZdMhWBd5es)

---
## 2026-05-29 06:29:59
正是如此,但没有厂商锁定。
---
## 2026-05-29 07:00:17
传统上,工作流是幂等的和确定性的(特别是其执行步骤),有很多东西会使工作流变得非幂等,例如 - 编写一个基于时间(或日期、随机数等)逻辑来设定步骤条件的工作流。VM 的全部意义在于拥有一个我可以移除对这些事物的访问权限并暴露代理原语的地方。除此之外的一切都是公平游戏...
---
## 2026-05-29 13:12:58
干杯!很快会添加对此的支持。
**链接卡片**: [](https://t.co/BH1XDiQ7eh)
---
## 2026-05-29 13:13:13
干杯!
---
## 2026-05-29 13:13:38
其实我根本没有考虑这个,我喜欢 Anthropic 在这点的想法。
---
## 2026-05-29 13:14:21
每个子代理仍然会像任何独立代理一样胡乱产出。
---
## 2026-05-29 13:15:25
我不敢说它是一个 DAG,它是带有一些限制的纯 JS...
---
## 2026-05-29 13:15:53
伙计,我太累了。
---
## 2026-05-29 13:16:37
很快会添加对分叉代理的支持!
**链接卡片**: [Support forked agents (fan-out from a shared parent context) · Issue #10 · Michaelliv/pi-dynamic-...](https://t.co/CSlpVYFUUY)

---
## 2026-05-29 17:19:14
私信给我发张截图?
---
## 2026-05-29 19:31:46
这里的 VM 基本上被用作代理的“符合人体工程学的编码界面”,只是一种在单个工具调用中内联业务逻辑的方式。你显然可以用 monty 做同样的事情,或者甚至 bash。
**链接卡片**: [Ergonomic coding surfaces for agents (a.k.a Code Mode)](https://t.co/eSnuKD4c9p)

---
## 2026-05-30 04:00:06
干杯!