LESSON 05 / 16·2 min readIntermediate

What the Deterministic Rules Engine Does

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Once facts are validated, the rules engine evaluates the current workflow state and chooses the permitted next step.

A simplified example:

Python
def next_step(state, facts):
    if not state.customer_verified:
        return "request_verification"

    if facts.get("transaction_id") is None:
        return "ask_for_transaction"

    if not state.dispute_reason_confirmed:
        return "ask_dispute_reason"

    if not state.action_confirmed:
        return "request_confirmation"

    return "submit_approved_dispute"

This is illustrative pseudocode, not a complete production dispute policy. Real implementations should also enforce authorization, idempotency, connector error handling, and audit requirements.

The key difference is that the next step comes from explicit rules and state, not from an open-ended LLM instruction.

PAUSE & RECALL

Can you explain it without the notes?

What the Deterministic Rules Engine Does

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

Check your explanation

Once facts are validated, the rules engine evaluates the current workflow state and chooses the permitted next step.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Workflow State and the Ledger

Adapted from 19_deterministic_workflow_engine_learnings.md · “4. What the Deterministic Rules Engine Does”. Examples are study fragments; framework behavior can depend on your version.