The Five Moves Framework
Understand the universal structure that turns complex processes into reliable agent workflows.
The Five Moves Framework is the core innovation of BPMCP. It provides a universal structure for any business process, creating perfect context boundaries for agents.
What is Five Moves?
Every business process, regardless of complexity, follows the same pattern:
- 5 Phases: The states where work happens
- 5 Flows: The transitions between phases
- Total: 10 Steps that agents can understand
This structure creates a 1000:1 context compression ratio, transforming enterprise chaos into manageable workflows.
The Universal Pattern
Phase Definitions
| Phase | Purpose | Common Actions | Example (Corporate Cards) |
|---|---|---|---|
| 1. Capture | Initial data entry | Create, Upload, Import | Capture expense, Attach receipt |
| 2. Enrich | Add context & details | Categorize, Tag, Annotate | Add category, Add project code |
| 3. Approve | Decision & validation | Review, Approve, Reject | Manager approval, Policy check |
| 4. Post | System integration | Record, Sync, Export | Post to ERP, Update ledger |
| 5. Pay | Settlement & closure | Transfer, Reimburse, Close | Process payment, Mark complete |
Flow Definitions
| Flow | From → To | Purpose | Validation |
|---|---|---|---|
| Flow 1 | Capture → Enrich | Validate completeness | All required fields present |
| Flow 2 | Enrich → Approve | Submit for review | Business rules satisfied |
| Flow 3 | Approve → Post | Execute decision | Approval obtained |
| Flow 4 | Post → Pay | Prepare settlement | System sync successful |
| Flow 5 | Pay → Complete | Finalize process | Payment confirmed |
Why 5+5=Perfect?
Cognitive Load
Research shows humans (and agents) work best with 5-7 chunks of information. The Five Moves Framework provides exactly 10 memorable steps.
Business Alignment
Every business process naturally fits this pattern:
- Input (Capture)
- Processing (Enrich, Approve)
- Output (Post, Pay)
Token Efficiency
Instead of feeding your agent 10,000 tokens of API documentation, Five Moves provides complete context in under 500 tokens.
Process Hierarchy
The Five Moves Framework sits within a larger hierarchy:
Domain
└── Process
├── Phase 1: Capture
│ ├── Atoms (business actions)
│ └── Tools (API implementations)
├── Flow 1: Validation
├── Phase 2: Enrich
│ ├── Atoms
│ └── Tools
├── Flow 2: Submission
└── ... (continuing through all 10 steps)Hierarchy Levels Explained
- Domain: High-level business area (P2P, O2C, H2R)
- Process: Specific workflow (Corporate Cards, Invoices)
- Phase: State where work happens (5 per process)
- Flow: Transition between phases (5 per process)
- Atom: Smallest business action (“Attach Receipt”)
- Tool: Concrete API call (
payhawk.attach_document)
Real-World Example: Corporate Cards
Let’s see how a corporate card expense follows Five Moves:
// The complete process structure
const corporateCardsProcess = {
domain: 'p2p',
id: 'corporate-cards',
name: 'Corporate Card Expenses',
phases: [
{
id: 'capture',
name: 'Phase 1: Capture',
atoms: [
{ id: 'capture-expense', name: 'Capture card transaction' },
{ id: 'attach-receipt', name: 'Attach receipt image' }
]
},
{
id: 'enrich',
name: 'Phase 2: Enrich',
atoms: [
{ id: 'add-category', name: 'Categorize expense' },
{ id: 'add-project', name: 'Assign to project' },
{ id: 'add-notes', name: 'Add description' }
]
},
{
id: 'approve',
name: 'Phase 3: Approve',
atoms: [
{ id: 'submit-approval', name: 'Submit for approval' },
{ id: 'manager-review', name: 'Manager reviews' },
{ id: 'policy-check', name: 'Check against policy' }
]
},
{
id: 'post',
name: 'Phase 4: Post',
atoms: [
{ id: 'post-to-erp', name: 'Post to ERP system' },
{ id: 'update-budget', name: 'Update budget tracking' }
]
},
{
id: 'pay',
name: 'Phase 5: Pay',
atoms: [
{ id: 'process-reimbursement', name: 'Process payment' },
{ id: 'send-confirmation', name: 'Send confirmation' }
]
}
],
flows: [
{ id: 'validate', name: 'Flow 1: Validate data' },
{ id: 'submit', name: 'Flow 2: Submit for review' },
{ id: 'execute', name: 'Flow 3: Execute approval' },
{ id: 'settle', name: 'Flow 4: Prepare settlement' },
{ id: 'complete', name: 'Flow 5: Complete process' }
]
};How Agents Navigate Five Moves
Agents use Five Moves to understand:
1. Where They Are
const currentPhase = await bpmcp.sessions.getCurrentPhase(sessionId);
// Returns: { phase: 2, name: 'Enrich', completed: ['capture'], remaining: ['approve', 'post', 'pay'] }2. What’s Possible
const availableActions = await bpmcp.atoms.listAvailable(sessionId);
// Returns atoms valid for current phase3. What’s Next
const nextSteps = await bpmcp.flows.getNext(sessionId);
// Returns: { flow: 'submit', requirements: [...], targetPhase: 'approve' }Benefits for Agent Builders
1. Predictable Structure
Every process follows the same pattern, making agent logic reusable.
2. Clear Boundaries
Phases and flows create natural checkpoints for validation.
3. Error Recovery
If something fails, agents know exactly which phase to retry.
4. Explainability
Agents can explain their actions in business terms.
5. Composition
Combine multiple processes while maintaining clarity.
Implementation Patterns
Sequential Processing
// Move through phases in order
for (let i = 1; i <= 5; i++) {
await processPhase(i);
if (i < 5) await executeFlow(i);
}State Machine
// Treat as state machine
const stateMachine = {
capture: { next: 'enrich', flow: 'validate' },
enrich: { next: 'approve', flow: 'submit' },
approve: { next: 'post', flow: 'execute' },
post: { next: 'pay', flow: 'settle' },
pay: { next: 'complete', flow: 'complete' }
};Event-Driven
// React to phase completions
bpmcp.on('phase:complete', async (phase) => {
const nextFlow = getFlow(phase);
await executeFlow(nextFlow);
});Common Patterns Across Domains
P2P (Procure-to-Pay)
- Capture: Invoice receipt, PO creation
- Enrich: Coding, matching
- Approve: Authorization, budget check
- Post: ERP recording
- Pay: Vendor payment
O2C (Order-to-Cash)
- Capture: Order entry
- Enrich: Pricing, inventory check
- Approve: Credit check
- Post: Fulfillment
- Pay: Collection
H2R (Hire-to-Retire)
- Capture: Application
- Enrich: Screening
- Approve: Offer
- Post: Onboarding
- Pay: First payroll
Best Practices
- Always Complete Phases - Don’t skip phases even if empty
- Validate at Flows - Use flows for business rule validation
- Atomic Operations - Keep atoms small and focused
- Idempotent Actions - Atoms should be safely retryable
- Clear Naming - Use business terminology, not technical
Next Steps
- Process Discovery - Find the right process
- Building Atoms - Create atomic business actions
- Flow Control - Manage transitions
- Real Example - See Five Moves in action