Moving from individual prompts to production systems requires thinking architecturally. Financial workflows aren’t just chains of prompts - they’re coordinated systems where multiple specialized agents work together. Understanding how to model these workflows is essential for building reliable, maintainable financial AI systems.
From Automation to Agentic Systems
Most organizations start with simple automation - fixed scripts that follow predetermined paths. The evolution toward agentic systems happens when you need flexibility: handling varied inputs, adapting to exceptions, and making decisions that weren’t explicitly programmed.
flowchart TB
subgraph Deterministic["Deterministic Automation"]
direction LR
I1[Input] --> S1[Step 1]
S1 --> S2[Step 2]
S2 --> S3[Step 3]
S3 --> O1[Output]
end
subgraph Agentic["Agentic Workflow"]
direction LR
I2[Input] --> P[Planning Agent]
P --> R{Router}
R -->|Path A| A1[Agent 1]
R -->|Path B| A2[Agent 2]
A1 --> E[Evaluator]
A2 --> E
E -->|Revise| P
E -->|Approve| O2[Output]
end
classDef blueClass fill:#4A90E2,stroke:#333,stroke-width:2px,color:#fff
class Agentic blueClass
The Generalization Leap
Consider a simple loan application processor that checks three things in order: credit score, income verification, and debt-to-income ratio. That’s deterministic automation.
The agentic version generalizes this:
- A planning agent understands the application type and decides what checks are needed
- Specialized agents handle each verification type
- A routing mechanism directs work based on application characteristics
- An evaluation loop catches issues and requests revisions
This generalization means the same system can handle different loan types, adapt when requirements change, and learn from edge cases.
Two Approaches to Workflow Modeling
Process-Centric (Deterministic)
Focus on the rigid connection between tasks:
- Identify all tasks
- Map their sequence and dependencies
- Define inputs/outputs for each
- Note decision points (usually simple if/else rules)
- Visualize as a flowchart
Agent-Centric (Agentic)
Focus on the agents themselves:
- Agent capabilities: What can each agent do?
- Goal structure: What objectives, how is success measured?
- Decision-making frameworks: How do agents evaluate options?
- Adaptation rules: How do agents learn from feedback?
- Environment constraints: What boundaries exist?
- Feedback loops: How does information flow back for improvement?
The Agent Complexity Spectrum
Not all agents are equal. They exist on a spectrum of complexity and autonomy:
| Agent Type | Description | Use Case |
|---|---|---|
| Direct Prompting | Send query directly to LLM | Simple Q&A |
| Augmented Prompting | Add system message defining persona | Role-specific responses |
| Knowledge Augmented | Persona + curated knowledge base | Domain-specific expertise |
| RAG Agent | Dynamic retrieval before answering | Large knowledge bases |
| Evaluation Agent | Assess outputs against criteria | Quality control |
| Routing Agent | Direct tasks to appropriate specialists | Multi-domain systems |
| Planning Agent | Break goals into executable steps | Complex task execution |
Choosing the Right Agent Type
flowchart TD
Q1{Need domain
expertise?}
Q1 -->|No| DP[Direct Prompting]
Q1 -->|Yes| Q2{Static or
dynamic knowledge?}
Q2 -->|Static| KA[Knowledge Augmented]
Q2 -->|Dynamic| RAG[RAG Agent]
Q3{Need quality
control?}
Q3 -->|Yes| EVAL[Evaluation Agent]
Q4{Multiple
domains?}
Q4 -->|Yes| ROUTE[Routing Agent]
Q5{Complex
goals?}
Q5 -->|Yes| PLAN[Planning Agent]
classDef blueClass fill:#4A90E2,stroke:#333,stroke-width:2px,color:#fff
classDef orangeClass fill:#F39C12,stroke:#333,stroke-width:2px,color:#fff
classDef greenClass fill:#27AE60,stroke:#333,stroke-width:2px,color:#fff
class RAG blueClass
class EVAL orangeClass
class PLAN greenClass
Visual Workflow Modeling
When designing agentic workflows, visual representation helps communicate complex systems clearly.
Modeling Guidelines
Use Standard Symbols
- Rectangles for tasks/agents
- Diamonds for decisions
- Arrows for flow direction
- Circles for start/end points
Label Clearly
Each node needs a descriptive name:
- “Validate BIC Code” instead of “Validate”
- “Assess Credit Risk” instead of “Check Risk”
- “Route by Transaction Type” instead of “Route”
Show Data Flow
Make explicit what data each agent uses and produces:
flowchart LR
A["Application
Parser
──────
In: Raw PDF
Out: Structured Data"] --> B["Credit
Checker
──────
In: SSN, Income
Out: Score, Report"]
B --> C["Risk
Assessor
──────
In: Credit Report
Out: Risk Level"]
Choose Appropriate Granularity
High-level for stakeholder communication:
flowchart LR
A[Receive Application] --> B[Validate & Enrich]
B --> C[Assess Risk]
C --> D[Make Decision]
Detailed for implementation:
flowchart TD
A[Parse PDF] --> B[Extract Fields]
B --> C[Validate Format]
C --> D{Valid?}
D -->|Yes| E[Lookup External Data]
D -->|No| F[Request Corrections]
E --> G[Calculate Metrics]
G --> H[Run Risk Model]
Applied Example: SWIFT Message Processing
SWIFT (Society for Worldwide Interbank Financial Telecommunication) messages are the backbone of international banking. Processing them requires multiple specialized capabilities - perfect for an agentic workflow.
The Multi-Agent Architecture
flowchart TD
MSG[SWIFT Message] --> VAL[Validator Agent]
VAL --> COR[Correction Agent]
COR --> OPT[Optimized Message]
OPT --> SCR[Initial Screener]
SCR --> TECH[Technical Analyzer]
TECH --> RISK[Risk Assessor]
RISK --> COMP[Compliance Checker]
COMP --> REV[Final Reviewer]
REV --> DEC{Decision}
DEC -->|Approve| OUT[Process Transaction]
DEC -->|Flag| FLAG[Manual Review Queue]
DEC -->|Reject| REJ[Rejection Handler]
classDef blueClass fill:#4A90E2,stroke:#333,stroke-width:2px,color:#fff
classDef orangeClass fill:#F39C12,stroke:#333,stroke-width:2px,color:#fff
classDef greenClass fill:#27AE60,stroke:#333,stroke-width:2px,color:#fff
class VAL blueClass
class COR blueClass
class SCR orangeClass
class REV greenClass
Agent Responsibilities
Validator Agent: Checks message structure and field validity
1 | validator_prompt = """ |
Correction Agent: Attempts to fix identified issues
1 | correction_prompt = """ |
Initial Screener: Quick triage for obvious issues
1 | screener_prompt = """ |
Technical Analyzer: Deep format validation
1 | technical_prompt = """ |
Risk Assessor: Evaluate transaction risk
1 | risk_prompt = """ |
Compliance Checker: Regulatory validation
1 | compliance_prompt = """ |
Final Reviewer: Synthesize all assessments
1 | final_review_prompt = """ |
Workflow Execution
1 | class SWIFTProcessor: |
Deterministic vs Agentic: When to Use Which
| Factor | Deterministic | Agentic |
|---|---|---|
| Input Variability | Low - structured, predictable | High - varied formats, edge cases |
| Decision Complexity | Simple rules suffice | Requires judgment, context |
| Error Tolerance | Fail fast is acceptable | Need graceful degradation |
| Auditability | Full trace is easy | Requires explicit logging |
| Maintenance | Update code for rule changes | Update prompts, potentially self-adapting |
| Cost | Lower (no LLM calls) | Higher (API costs) |
Hybrid Approach
Often the best solution combines both:
flowchart LR
I[Input] --> D1{Structured
format?}
D1 -->|Yes| DET[Deterministic
Validation]
D1 -->|No| AG1[Agentic
Parser]
AG1 --> DET
DET --> D2{Pass basic
checks?}
D2 -->|Yes| AG2[Agentic
Risk Assessment]
D2 -->|No| REJ[Reject]
AG2 --> DET2[Deterministic
Routing]
DET2 --> OUT[Output]
classDef orangeClass fill:#F39C12,stroke:#333,stroke-width:2px,color:#fff
classDef blueClass fill:#4A90E2,stroke:#333,stroke-width:2px,color:#fff
class DET orangeClass
class AG1 blueClass
class AG2 blueClass
Use deterministic processing for:
- Format validation (regex, schema checking)
- Simple routing rules
- Threshold-based decisions
- Compliance with known rules
Use agentic processing for:
- Unstructured input parsing
- Context-dependent decisions
- Edge case handling
- Quality assessment
Design Principles for Financial Workflows
1. Define Clear Agent Boundaries
Each agent should have:
- Single, well-defined responsibility
- Clear inputs and outputs
- Explicit success/failure criteria
2. Build in Observability
Every agent action should be logged:
1 | def run_agent(agent, input_data): |
3. Design for Failure
Assume any agent can fail:
- Define fallback behaviors
- Set maximum retry limits
- Establish escalation paths to human review
4. Separate Policy from Mechanism
Keep business rules external:
1 | # config/swift_rules.yaml |
5. Version Everything
Prompts, configurations, and agent definitions should all be versioned:
1 | @dataclass |
Takeaways
Agentic workflows generalize automation by adding planning, routing, and evaluation capabilities that adapt to varied inputs
Agent-centric modeling focuses on capabilities, goals, and decision frameworks rather than rigid task sequences
Visual modeling with standard symbols and clear labeling helps communicate complex systems to stakeholders
Agent types form a spectrum from simple direct prompting to autonomous planning agents - choose based on task complexity
Hybrid approaches combine deterministic processing for structured tasks with agentic processing for judgment-requiring decisions
Financial workflows benefit from multiple specialized agents working together with clear responsibilities and explicit handoffs
This is the fourth post in my Applied Agentic AI for Finance series. Next: Prompt Chaining and Routing in Trading Systems where we’ll explore sequential and branching workflow patterns for trading operations.
Comments