LESSON 69 / 215·2 min readIntermediate

Deterministic workflows

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Words made simple

A few useful meanings before you read the explanation.

Deterministic
Following steps or rules defined by code. The model does not decide which step should run next in a deterministic workflow.
Orchestration
Coordinating tasks: deciding their order, passing data between them, and handling waiting or failures.
State
The data describing where a workflow is now, what it already knows, and what still needs to happen.
More words from this lesson
Persistence
Saving information so it remains available after a request ends or a process restarts.
Idempotency
Making a repeated request have the same intended business effect as one request. It helps avoid duplicate submissions or payments.
Authorization
Checking what that identity is allowed to read or do. Being logged in does not grant access to every record.
Evaluation
Checking results against examples and clear criteria to find whether the system works well and where it fails.

🔴 MUST KNOW · Architecture determines where uncertainty is allowed.

Overview

  • A deterministic workflow follows explicitly coded transitions for given inputs and recorded external outcomes.
  • It can call nondeterministic services, but its orchestration rules remain controlled.
  • It is the natural extension of validation, transactions, and backend state machines you already know.

Why this matters

Critical processes require predictable enforcement, auditability, and recovery.

An everyday example

A checkout process always verifies stock and payment before confirming an order.

A technical example

validate → check ownership → calculate deductible → save claim → enqueue notification.

How it works

  1. Define states/rules
  2. Validate every transition
  3. Execute authorized activities
  4. Persist outcomes
  5. Retry or compensate according to policy.

Architecture and flow

Request → validate → check → calculate → execute → notify.

The insurance assistant example

Premium calculation, coverage rule evaluation, approval requirements, and claim submission are governed by code and authorized review.

When to use it

Known processes, money, permissions, deadlines, and regulated business decisions.

When to avoid it

Hardcoded branches can become impractical for open-ended language understanding; use a bounded model step there if needed.

Interview answer

“Deterministic workflows encode the allowed business process. External failures are handled explicitly rather than allowing a model to invent the next business rule.”

Benefits, trade-offs, and production considerations

  • Deterministic does not mean failure-free: databases and networks still fail.
  • Record external results, use idempotency, and test state transitions and compensation.
PAUSE & RECALL

Can you explain it without the notes?

Deterministic workflows

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

A deterministic workflow follows explicitly coded transitions for given inputs and recorded external outcomes. It can call nondeterministic services, but its orchestration rules remain controlled. It is the natural extension of validation, transactions, and…

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Agentic workflows

Adapted from 13_AI.MD · “Deterministic workflows”. Examples are study fragments; framework behavior can depend on your version.