inquiry v1

examples/inquiry/temporal/inquiry.flow · dandori doc

Jev picks the kind of a customer's inquiry and says how sure it is; an agent reads the inquiry for an order number and its point, and for its kind too, which the flow takes when Jev is not sure enough of its own. A rule decides the desk that takes it and how soon it is answered; another agent drafts the first reply; and a ticket goes into the desk's system. Jev picks, agents read and write (a model the company runs itself reads, Claude writes), and the rule decides. Written for Temporal: Jev and the agents are activities dandori writes, Jev called with TypeSafe's key (TYPESAFE_API_KEY), the reading sent to the company's Ollama, which serves Open Responses (`url`), and the draft to Claude with the key the worker has; the rule runs in the worker of the workflow as a local activity, its answer kept in the history as a marker; and filing the ticket is an activity you write

flow
on failureon unsure, failuresome order_idnoneon failureinquiry v162 reading = read_inquiry(…)agent · gpt-oss:20b · http://ollama.internal:11434/v1retry 2 times every 10 seconds · timeout 1 minute64 by_hand = file_ticket(…)a task you writeretry 2 times every 5 secondstimeout, failure → the workflow fails!65 succeed ticket_id = by_hand.ticket_id, desk = general67 kind = pick_kind(…)jev · jev-1.13.0 · confidence 0.8 else unsureretry 2 times every 1 second · timeout 10 seconds68 let kind = reading.kind69 decision = routing(…)rule inquiry_routing.rule · localtimeout, failure → the workflow fails!70 let subject = "An inquiry about {kind}"71 match reading.order_id72 let subject = "An inquiry about {kind} (order {order_id…74 draft = draft_reply(…)agent claude · claude-sonnet-5timeout 1 minute75 let draft = none76 t = file_ticket(…)a task you writeretry 2 times every 5 secondstimeout, failure → the workflow fails!77 succeed ticket_id = t.ticket_id, desk = decision.desk

Calls

LineCallCallsRetriesTimeoutWhen it fails
62reading = read_inquiry(…)agent · gpt-oss:20b · http://ollama.internal:11434/v12 times every 10 seconds (failure, timeout)1 minutetimeout, failure → line 63
64by_hand = file_ticket(…)a task you write, key2 times every 5 seconds (failure, timeout)—timeout, failure → the workflow fails
67kind = pick_kind(…)jev · jev-1.13.0 · confidence 0.8 else unsure2 times every 1 second (failure, timeout)10 secondsunsure, timeout, failure → line 68
69decision = routing(…)rule inquiry_routing.rule, a local activity on Temporal2 times, after 1 second and 2 (failure)—timeout, failure → the workflow fails
74draft = draft_reply(…)agent claude · claude-sonnet-5—1 minutetimeout, failure → line 75
76t = file_ticket(…)a task you write, key2 times every 5 seconds (failure, timeout)—timeout, failure → the workflow fails

Ends

LineEnd
65succeed ticket_id = by_hand.ticket_id, desk = general
77succeed ticket_id = t.ticket_id, desk = decision.desk