# Chapter 4: Workflow Thinking
---
In the previous chapter, we explored the internal architecture of AI agents, including their core modules, memory systems, and architectural patterns. We learned how agents are built and how they operate in isolation.
However, in real‑world enterprise environments, agents rarely work alone. They are part of larger business processes that involve multiple steps, systems, and sometimes human intervention. This is where **workflow thinking** becomes essential.
Workflow thinking is about designing, orchestrating, and optimising sequences of tasks—some automated, some human—to achieve business outcomes. When combined with Agentic AI, workflows become intelligent, adaptive, and capable of handling complex, multi‑step processes.
In this chapter, we will explore how to design AI‑powered workflows, the difference between traditional and agentic workflows, and how to orchestrate agents within larger business processes. We will continue using the banking domain to ground our examples, with a focus on loan processing, customer onboarding, and fraud investigation workflows.
---
# 🎯 Learning Objectives
By the end of this chapter, you will be able to:
- Distinguish between traditional workflows and agentic workflows
- Design sequential, conditional, and parallel workflows
- Implement human‑in‑the‑loop patterns
- Understand workflow orchestration and choreography
- Apply error handling and fallback strategies
- Optimise workflows for performance and reliability
- Recognise common workflow patterns in banking
---
# What is a Workflow?
A **workflow** is a sequence of tasks, activities, or steps that are executed to achieve a specific business outcome.
In traditional systems, workflows are often:
- **Static** – Defined at design time
- **Linear** – Follow a fixed sequence
- **Deterministic** – Always produce the same result
- **Human‑driven** – Require manual intervention
In modern AI systems, workflows are evolving to become:
- **Dynamic** – Adapt based on context
- **Flexible** – Branch based on conditions
- **Intelligent** – Use AI to make decisions
- **Automated** – Execute with minimal human oversight
---
## Traditional Workflow Example
A traditional loan processing workflow:
```text
Customer Submits Application
↓
Data Entry (Manual)
↓
Credit Check (System)
↓
Underwriting (Human)
↓
Approval Decision (Human)
↓
Notification (System)
Each step is predefined and requires human involvement at key points.
Agentic Workflow Example
An agentic loan processing workflow:
Customer Submits Application
↓
Agent Collects Documents (Automated)
↓
Agent Verifies Data (System + AI)
↓
Agent Assesses Risk (AI Model)
↓
Agent Makes Decision → Low Risk (Auto‑Approve)
High Risk (Escalate to Human)
↓
Agent Sends Notification (Automated)
↓
Agent Learns from Outcome (Continuous)
The workflow adapts based on risk level and continuously improves.
Traditional vs. Agentic Workflows
| Aspect | Traditional Workflow | Agentic Workflow |
|---|---|---|
| Flexibility | Fixed, predefined | Dynamic, adaptive |
| Decision‑making | Human‑driven | AI‑driven with human oversight |
| Error Handling | Manual intervention | Automated recovery and fallback |
| Learning | None | Continuous improvement |
| Scalability | Limited by human capacity | Highly scalable |
| Integration | Point‑to‑point | Orchestrated across systems |
Types of Workflows
Workflows can be categorised based on their execution patterns.
Sequential Workflows
Tasks are executed one after another in a fixed order.
Banking Example: Customer onboarding workflow where identity verification must be completed before account creation.
Step 1: Collect Customer Data
Step 2: Verify Identity
Step 3: Perform KYC Check
Step 4: Create Account
Step 5: Send Welcome Communication
Conditional Workflows
The execution path depends on conditions or decisions.
Banking Example: Loan application workflow where the path depends on risk score.
Application Received
↓
Risk Assessment
↓
┌────┴────┐
↓ ↓
Low Risk High Risk
↓ ↓
Auto‑Approve Escalate to Underwriter
Parallel Workflows
Multiple tasks are executed simultaneously.
Banking Example: During a customer service interaction, the agent simultaneously checks account balance, transaction history, and credit score.
Customer Query
↓
┌────┴────┐
↓ ↓
Balance History
↓ ↓
└────┬────┘
↓
Response
Agentic Workflows
Workflows where AI agents make decisions, plan actions, and adapt dynamically.
Banking Example: A fraud investigation agent that collects evidence, analyses patterns, and decides whether to escalate.
Alert Triggered
↓
Agent Collects Evidence
↓
Agent Analyses Patterns
↓
Agent Decides → Low Risk (Close Case)
→ Medium Risk (Additional Review)
→ High Risk (Escalate)
Human‑in‑the‑Loop Patterns
While agents can operate autonomously, there are scenarios where human oversight is required—especially in regulated industries like banking.
Pattern 1: Human Approval
The agent makes a recommendation, but a human must approve the final action.
Banking Example: An agent recommends approving a loan, but an underwriter must review and approve.
Agent Decision → Human Approval → Execute
Pattern 2: Human Escalation
The agent recognises when it cannot handle a situation and escalates to a human.
Banking Example: A customer service agent detects a frustrated tone and escalates to a human agent.
Agent Attempts → Cannot Resolve → Escalate to Human
Pattern 3: Human Oversight
The agent operates autonomously, but a human monitors and can intervene.
Banking Example: A fraud detection agent blocks suspicious transactions, but a fraud analyst reviews the actions.
Agent Executes → Human Monitors → Intervene if Needed
Pattern 4: Human Feedback
The agent learns from human feedback to improve future performance.
Banking Example: A recommendation agent suggests investment strategies, and the customer provides feedback.
Agent Recommends → Human Accepts/Rejects → Agent Learns
Workflow Orchestration vs. Choreography
When multiple agents or systems are involved, we need coordination mechanisms.
Orchestration
A central coordinator (orchestrator) controls the workflow.
Banking Example: A loan origination system orchestrates the credit check, document verification, and underwriting steps.
Orchestrator
↓
┌───┴───┐
↓ ↓
Agent A Agent B
↓ ↓
└───┬───┘
↓
Orchestrator
Pros:
- Centralised control
- Easier to monitor
- Clear visibility
Cons:
- Single point of failure
- Bottleneck
Choreography
Each participant acts independently, following published events.
Banking Example: An event‑driven system where fraud detection, compliance, and customer service agents react to events.
Event → Agent A → Event → Agent B → Event → Agent C
Pros:
- Decentralised
- Highly scalable
- Resilient
Cons:
- Harder to monitor
- Complex to manage
Error Handling and Fallback Strategies
Workflows must be robust and handle failures gracefully.
Retry Pattern
Automatically retry failed operations.
Banking Example: If a credit bureau API call fails, retry up to 3 times before escalating.
Fallback Pattern
Provide alternative paths when primary operations fail.
Banking Example: If the primary risk assessment model is unavailable, fall back to a simpler rule‑based system.
Compensation Pattern
Undo or compensate for completed actions if a later step fails.
Banking Example: If a transaction is approved but subsequent checks fail, reverse the transaction.
Timeout Pattern
Set time limits for operations and handle timeouts.
Banking Example: If an external service takes too long, proceed with a default decision or escalate.
Designing Agentic Workflows in Banking
Let's design a complete agentic workflow for a banking process.
Customer Onboarding Workflow
Business Goal: Onboard a new customer with minimal friction while ensuring compliance.
Steps:
-
Customer Submits Information – The customer provides personal details through a web form or mobile app.
-
Agent Perceives Request – The agent receives the submission and extracts key information.
-
Agent Performs KYC Check – The agent verifies identity against government databases and watchlists.
-
Agent Performs AML Check – The agent screens the customer against AML databases.
-
Conditional Branching:
- If KYC/AML Pass: Proceed to account creation.
- If KYC/AML Fail: Escalate to human compliance officer.
-
Agent Creates Account – The agent initiates account creation in the core banking system.
-
Agent Sends Welcome Communication – The agent sends a welcome message with next steps.
-
Agent Updates Customer Profile – The agent stores the customer information in the CRM.
-
Agent Learns – The agent records outcomes and refines its processes.
Customer Submits Information
↓
Agent Perceives Request
↓
Agent Performs KYC Check
↓
Agent Performs AML Check
↓
┌──────┴──────┐
↓ ↓
Pass Fail
↓ ↓
Agent Creates Escalate to
Account Compliance
↓
Agent Sends
Communication
↓
Agent Updates
Customer Profile
↓
Agent Learns
Best Practices for Agentic Workflow Design
✅ Start with clear business objectives and success criteria
✅ Identify which steps can be automated and which require human intervention
✅ Design for failure—include retries, fallbacks, and escalations
✅ Use appropriate coordination patterns (orchestration vs. choreography)
✅ Build observability and monitoring into every workflow
✅ Test workflows with realistic scenarios and edge cases
✅ Continuously measure performance and optimise
✅ Document workflows for business and technical stakeholders
Common Mistakes
❌ Automating everything without considering human oversight requirements
❌ Ignoring error handling and failure scenarios
❌ Building workflows that are too rigid and cannot adapt
❌ Underestimating the complexity of multi‑step processes
❌ Neglecting monitoring and observability
❌ Designing workflows around systems rather than business outcomes
Interview Questions
-
What is the difference between a traditional workflow and an agentic workflow?
-
Explain the different types of workflows with banking examples.
-
What are the four human‑in‑the‑loop patterns?
-
What is the difference between orchestration and choreography? When would you use each?
-
How do you handle errors in a workflow?
-
Design a customer onboarding workflow for a bank using agents.
-
What is the compensation pattern and when would you use it?
-
How do you decide which steps to automate and which to keep manual?
-
How do you test agentic workflows?
-
How do you measure the success of an agentic workflow?
Practice Exercises
-
Design a sequential workflow for a customer service agent handling a complaint.
-
Design a conditional workflow for a fraud detection agent with escalation paths.
-
Design a parallel workflow for a wealth management agent analysing portfolio, market conditions, and risk factors.
-
Implement a human‑in‑the‑loop pattern for a loan approval workflow.
-
Draw a complete agentic workflow for a credit card application process.
Key Takeaways
- Workflows are sequences of tasks to achieve business outcomes
- Agentic workflows are dynamic, adaptive, and intelligent
- Sequential, conditional, and parallel workflows serve different needs
- Human‑in‑the‑loop patterns provide appropriate oversight
- Orchestration and choreography are complementary coordination patterns
- Error handling, fallbacks, and monitoring are essential for production workflows
Chapter Summary
In this chapter, you learned:
- The difference between traditional and agentic workflows
- Sequential, conditional, and parallel workflow types
- Human‑in‑the‑loop patterns
- Orchestration vs. choreography
- Error handling and fallback strategies
- How to design agentic workflows for banking processes
- Best practices and common pitfalls
You now understand how to design and orchestrate intelligent workflows that combine the power of AI agents with business processes. In the next chapter, we will explore multi‑agent systems and how agents collaborate to achieve complex goals.