LESSON 180 / 215·2 min readIntermediate

Workflows

ReferenceReference guide
01 Understand02 Recall03 Prepare

Words made simple

A few useful meanings before you read the explanation.

AI
Software techniques for tasks such as recognizing patterns, understanding language or generating content.
Deterministic
Following steps or rules defined by code. The model does not decide which step should run next in a deterministic workflow.
Durable
Able to retain progress and recover across interruptions. Durable workflows require appropriate storage and retry behavior.
More words from this lesson
Idempotency
Making a repeated request have the same intended business effect as one request. It helps avoid duplicate submissions or payments.
BullMQ
A Node.js job-queue library using Redis. It helps run background jobs and manage retries.
Temporal
A workflow system that records execution progress and helps long-running work recover after failures.

Beginner — Deterministic versus agentic workflow?

  • Deterministic transitions follow defined code and recorded outcomes.
  • Agentic transitions delegate some next-step choices to a model.
  • I use AI for language uncertainty and deterministic control for business invariants.

Intermediate — Why is idempotency important?

  • Retries can happen after a successful effect but before the response arrives.
  • A scoped operation key and payload hash let the service return the same receipt instead of creating another claim or sending another email.

Senior — Temporal or BullMQ?

  • I use a queue for isolated background jobs and a durable workflow platform for long-lived coordination, timers, and human events when justified.
  • BullMQ still needs explicit business lifecycle records; Temporal still needs idempotent activities and deterministic workflow logic.

Scenario — Submission timed out. Should you retry?

  • First classify the outcome as potentially unknown.
  • Query or reconcile the external receipt by operation key, then retry only under a documented idempotency contract.
  • Reporting failure immediately could encourage duplicate customer submissions.
PAUSE & RECALL

Can you explain it without the notes?

Workflows

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

Check your explanation

Beginner — Deterministic versus agentic workflow?

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Memory

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