Skip to content

Analyzer Showcase

This page shows what the analyzer produces for each workflow pattern: the source code (from real fixture files) and the generated Mermaid diagram. Step-level details (types, errors, retry/timeout) are extracted when the type checker is available.

Linear steps

Result:Promise<{ user: User; orders: Order[]; }>Errors:NOT_FOUNDFETCH_ERRORSEND_ERROR
3 steps analyzed
getUserdeps.fetchUser
dep: fetchUserNOT_FOUND→ Usererr: "NOT_FOUND"
getOrdersdeps.fetchOrders
dep: fetchOrdersFETCH_ERROR→ Order[]err: "FETCH_ERROR"
notifydeps.sendEmail
dep: sendEmailSEND_ERRORerr: "SEND_ERROR"

step.sleep

Result:Promise<string>
2 steps analyzed
pausestep.sleep
sleep
longPausestep.sleep
sleep

step.retry

Result:Promise<any>Errors:NETWORK_ERROR
1 step analyzed
fetchstep.retry
dep: fetchDataretryretry: 3 exponential

step.withTimeout

Result:Promise<any>Errors:TIMEOUT
1 step analyzed
slowCallstep.withTimeout
dep: slowOpwithTimeouttimeout: 5000ms

step.try & step.fromResult

Result:Promise<any>Errors:RISKY_ERRORFETCH_ERROR
2 steps analyzed
attemptstep.try
dep: riskyOptry
loadstep.fromResult
dep: fetchResultfromResult

step.withFallback

Result:Promise<any>Errors:NOT_FOUNDnever
1 step analyzed
fetchWithFallbackstep.withFallback
dep: fetchPrimary

step.withResource

Result:Promise<any>Errors:ACQUIRE_ERRORUSE_ERROR
1 step analyzed
useConnstep.withResource
withResourcedeps.acquire → deps.useResource → inline

step.dep

Result:Promise<any>Errors:NOT_FOUND
1 step analyzed
getUserdeps.fetchUser
dep: userService→ { id: string; }err: "NOT_FOUND"

step.race

Result:Promise<any>Errors:MISS
2 steps analyzed
race.cacheA.cacheAdeps.cacheA
dep: cacheA→ stringerr: "MISS"
race.cacheB.cacheBdeps.cacheB
dep: cacheB→ stringerr: "MISS"

when / unless / whenOr / unlessOr

Result:Promise<ConditionalResult>Errors:AUDIT_FAILEDCOMPUTE_ERROR
4 steps analyzed
whenStepdeps.audit
dep: audit→ booleanerr: "AUDIT_FAILED"
unlessStepdeps.compute
dep: compute→ numbererr: "COMPUTE_ERROR"
whenOrStepdeps.audit
dep: audit→ booleanerr: "AUDIT_FAILED"
unlessOrStepdeps.compute
dep: compute→ numbererr: "COMPUTE_ERROR"

switch

Result:Promise<string>Errors:ADMIN_ERRORUSER_ERRORnever
3 steps analyzed
admindeps.adminAction
dep: adminActionADMIN_ERRORerr: "ADMIN_ERROR"
userdeps.userAction
dep: userActionUSER_ERRORerr: "USER_ERROR"
defaultdeps.defaultAction
dep: defaultAction

for / while / for-of / for-in

Result:Promise<string>Errors:PROCESS_ERROR
4 steps analyzed
forStepdeps.processItem
dep: processItemPROCESS_ERRORloop: forerr: "PROCESS_ERROR"
forOfStepdeps.processItem
dep: processItemPROCESS_ERRORloop: itemserr: "PROCESS_ERROR"
forInStepdeps.processItem
dep: processItemPROCESS_ERRORloop: objerr: "PROCESS_ERROR"
whileStepdeps.processItem
dep: processItemPROCESS_ERRORloop: whileerr: "PROCESS_ERROR"

Workflow ref

Result:Promise<{ user: User; enriched: Enriched; }>Errors:NOT_FOUND
1 step analyzed
getUserdeps.fetchUser
dep: fetchUserNOT_FOUND→ Usererr: "NOT_FOUND"

Complex (parallel + conditional + forEach)

Result:Promise<ComplexResult>Errors:ERR
4 steps analyzed
parallel.fetchBoth.fetchAdeps.fetchA
dep: fetchA→ stringerr: "ERR"
parallel.fetchBoth.fetchBdeps.fetchB
dep: fetchB→ stringerr: "ERR"
forEach.processAll.processItemdeps.processItem
dep: processItemloop: items→ stringerr: "ERR"
fetchAOnlydeps.fetchA
dep: fetchAERR→ stringerr: "ERR"

Saga workflow

Result:Promise<{ reservation: { reservationId: string; }; payment: { chargeId: string; }; }>Errors:UNAVAILABLERELEASE_FAILEDCHARGE_FAILEDNOTIFY_FAILED
3 steps analyzed
Reservedeps.reserve
dep: reservecompensable
Chargedeps.charge
dep: chargecompensable
Notifydeps.notify
dep: notifytry

See Static Analysis for the full API and Visualization for runtime diagrams.