1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
32 small wins to finish your pathNext lesson →
Three tickets through the desk
Three tickets, three paths: an order that exists, one that does not, and a message with no order in it.
The flow is created once per ticket, with a database file so a paused flow can be picked up later.
from crewai.flow.persistence import SQLiteFlowPersistence
from desk import SupportDesk
db = SQLiteFlowPersistence("desk.db")
for message in ["Where is my order A17?", "Where is my order B22?", "Can you help me?"]:
desk = SupportDesk(persistence=db, suppress_flow_events=True)
desk.kickoff(inputs={"message": message})
print(desk.state.reply)A17 went through the router to the crew: the clerk called lookup_order, the writer wrote the email, and the guardrail passed it. B22 took the same path, and the tool's answer that the order does not exist became the email, so the desk did not invent a status. The third ticket named no order, so the flow asked for one without calling a model at all.
Try it yourself
- Send a ticket that mentions two orders and see which one the router picks.
- Add a fourth ticket about a delivery date.
- Print
desk.stateafter each run and watch the fields fill in.
Every expert started right here.