Introduction
Imagine you want to complete a task that needs several steps done one after another or choose the right path based on what happens at each step. Chains help organize these steps so the task flows smoothly and correctly.
Think of making a sandwich where you first lay the bread, then add fillings in order (sequential). But if you want a vegetarian or meat sandwich, you pick the right ingredients based on your choice (router).
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Step 1 │ → → │ Step 2 │ → → │ Step 3 │ └─────────────┘ └─────────────┘ └─────────────┘ ↓ ┌─────────────┐ │ Router │ ├─────────────┤ │ Path A │ → → ┌─────────────┐ │ Path B │ → → │ Alternative │ └─────────────┘ └─────────────┘