Lesson 3. Workflow Diagram#
Goal: create a visual diagram of how the agent works.
Why You Need a Diagram#
A diagram helps you:
- Visualize the logic (understand how the agent works without reading code)
- Find errors (if the diagram is complex or messy → simplify)
- Communicate with the client (show the diagram, explain how the agent works)
- Implement the agent (diagram = development instructions)
How to Draw the Diagram#
Tools:
- Draw.io (free, online, many templates)
- Figma (free, great for collaboration)
- Miro (free for small projects, good for brainstorming)
- n8n (if using n8n, you can export the diagram)
Diagram elements:
- Rectangle — action (send message, call API, save data)
- Diamond — condition (IF: if X, then Y, else Z)
- Oval — start / end of workflow
- Arrows — data flow (what goes from one block to another)
Example Diagram (Lead Qualification Bot)#
[Start]
↓
[Lead writes /start in Telegram]
↓
[Bot sends greeting]
↓
[Bot asks question 1: "What's your budget?"]
↓
[Lead answers]
↓
[Validation: is budget a number?]
↓ (yes) ↓ (no)
[Save] [Ask to enter again]
↓
[Bot asks question 2: "When do you plan to buy?"]
↓
[Lead answers]
↓
[Save]
↓
[Bot asks question 3: "Ready for a meeting?"]
↓
[Lead answers]
↓
[Save]
↓
[Bot asks question 4: "What's your name?"]
↓
[Lead answers]
↓
[Save]
↓
[Bot asks question 5: "Phone?"]
↓
[Lead answers]
↓
[Validation: is phone in correct format?]
↓ (yes) ↓ (no)
[Save] [Ask to enter again]
↓
[Bot asks question 6: "Comment?"]
↓
[Lead answers (optional)]
↓
[Determine temperature]
↓ (IF)
├─ [budget > 200K AND timeline "week" AND ready "yes"] → temperature = "Hot"
├─ [budget 100–200K AND timeline "month"] → temperature = "Warm"
└─ [else] → temperature = "Cold"
↓
[Create deal in CRM (Bitrix24)]
↓
[Send notification to sales rep (Telegram)]
↓
[Bot sends confirmation to lead: "A sales rep will contact you"]
↓
[End]
Simplified Visual Diagram#
If the text diagram seems complex, draw it in Draw.io or Figma:
┌─────────────┐
│ Start (lead)│
└──────┬──────┘
│
▼
┌────────────────────┐
│ Greeting + Q1 │ (Bot asks question 1)
└──────┬─────────────┘
│
▼
┌────────────────────┐
│ Q2, Q3, Q4, Q5, Q6 │ (Bot asks remaining questions)
└──────┬─────────────┘
│
▼
┌────────────────────┐
│ Determine temp. │ (IF: hot / warm / cold)
└──────┬─────────────┘
│
├─────────────────────────┐
▼ ▼
┌─────────────┐ ┌─────────────────┐
│ CRM (deal) │ │ Notification mgr│
└──────┬──────┘ └────────┬────────┘
│ │
└────────┬────────────────┘
▼
┌─────────────┐
│ Confirmation│ (Bot → lead: "Sales rep will contact you")
└──────┬──────┘
│
▼
┌────────┐
│ End │
└────────┘