don't use loops, design state machines
222,122 次观看
60 条评论
评论来自 X (Twitter) 上的原帖

@dzhng
do this today at
21 个赞

@DavidKPiano
What does the state machine for this example look like?
18 个赞

@dzhng
My version actually don't use a full deterministic state machine, I want to keep the flexibility of AI with minimal guardrails:
3 个赞

@kachar136
Hot take: it's not loops vs state machines, it's both. The state machine defines what "done" looks like; the loop is the engine that grinds until it gets there. No loop = agent stalls mid-task. No state machine = it loops forever toward nothing. Winners design both.
17 个赞

@dzhng
Agreed, but that's not catchy and doesn't go viral 😂
8 个赞

@BrianVia
We’re inventing computer science from first principles
16 个赞

@dzhng
😂 just slowly moving up the ladder of abstraction
5 个赞

@dzhng
A loop is just a state machine with 2 states 😅
19 个赞

@dzhng
😂

@orbofweed
sir this is a kanban board /s
2 个赞

@duetchat
🪩🪩🪩
2 个赞

@dcolinmorgan
🤯🤯🤯this looks insanely powerful! 2026 -- what a year 🚀🚀 reworking stack for 3rd time in 10 days 😵💫
2 个赞

@dzhng
Give it a try at and tell me how it goes! Happy to give you some free credits :)
1 个赞

@JasonSzesze
Sweet @duetchat
2 个赞

@dzhng
@duetchat Niceeeee

@muskirac
It's n8n all over again 🤔
2 个赞

@dzhng
Na, it's not a workflow engine actually, it's just the bare minimum guardrails. All workflow logic is done by agent / codegen
1 个赞

@SenseNopedOut
this is what he meant. same same
1 个赞

@dzhng
yup agreed. just adding a tangible example
1 个赞

@robschaper
State machines can be designed to run in a loop, they can also act like a DAG with an outcome certain. For example, you can have four state machines in a loop, made of four DAGs, each run updates an S3 bucket, which has a trigger to run the next state machine, etc... Cheers.
1 个赞





















