Skip to main content
Time to complete: 15 minutesDifficulty: BeginnerPrerequisites: Expense system access, Email connectionYou’ll build: An agent that routes expense reports to managers every Monday

Why Automate This?

The Problem: Finance teams spend 5-10 hours weekly manually reviewing submitted expense reports, identifying the right approver, and sending email notifications. Reports sit in queues, approvals get delayed, and employees wait longer for reimbursements. The Solution: A Duvo agent that automatically processes submitted expense reports every Monday morning—extracting details, identifying the correct manager, and sending approval requests with all necessary information attached. Expected Results:
  • Reduce approval cycle from 3-5 days to same-day
  • Eliminate 5+ hours of manual routing per week
  • Zero missed or forgotten expense reports
  • Complete audit trail of all approvals

What You’ll Build

By the end of this tutorial, you’ll have an agent that:
  1. Checks your expense system for submitted reports from the past week
  2. Extracts employee details, amounts, and receipts
  3. Looks up each employee’s manager in your HR system
  4. Sends a formatted approval email with the report attached
  5. Updates the expense system status to “Pending Approval”

Before You Start

Make sure you have these ready:
Expense management system - You’ll need login credentials. Set up logins
Email connection - Connect Gmail or Outlook. Connect connection
HR system access (optional) - For automatic manager lookup. Otherwise, you can specify managers manually.

Create Your Agent

  1. Click ”+ Create Agent” from your dashboard
  2. Select “Use Agent Builder” (recommended for this tutorial)
Create Agent Button

Describe Your Workflow

Paste this prompt into the Agent Builder:
Click “Generate” to create the agent AOP.

Review Generated AOP

Duvo will generate structured AOP based on your description. Review it to ensure:
  • All systems are correctly identified (expense system, HR system, email)
  • The approval workflow matches your process
  • Error handling covers your edge cases
You can edit the AOP directly if you need to adjust any details.

Configure Connections

The agent needs access to your systems. Click “Connections” and ensure:
  1. Expense system - Add logins for your expense management platform
  2. Email - Connect your Gmail or Outlook account
  3. HR system (if using) - Add logins for manager lookup

Test Your Agent

Before scheduling, run a test:
  1. Click “Run Agent”
  2. Watch the agent execute each step in real-time
  3. Review the session log to verify correct behavior
Agent Running
What to check:
  • Did it find the correct expense reports?
  • Did it identify the right managers?
  • Did the email look correct? (Check your sent folder)
  • Did the status update in your expense system?

Schedule Weekly Runs

Once testing is successful, set up the Monday schedule:
  1. Go to Agent Settings > Schedule
  2. Select Weekly on Monday at 8:00 AM
  3. Save the schedule
Your agent will now automatically process expense reports every Monday morning.

Expected Results

When your agent runs successfully, you should see: In your expense system:
  • All “Submitted” reports now show “Pending Manager Approval”
  • Activity log shows the agent’s actions
In manager inboxes:
  • Formatted approval emails with report summaries
  • PDF attachments with full expense details
  • Clear approve/reject call-to-action
In Duvo:
  • Complete session log showing each step
  • Audit trail of all emails sent and status updates

Troubleshooting

  • Check filters: Verify the status filter matches your system (e.g., “Submitted” vs “Pending”)
  • Check date range: Ensure the 7-day lookback is correct for your timezone
  • Check permissions: Confirm the logins have read access to all reports
  • HR system connection: Verify logins are correct and not expired
  • Missing manager data: Some employees may not have managers assigned—add a fallback in your AOP
  • Field mapping: Check that employee IDs match between systems
  • Email connection: Re-authorize if token expired
  • Spam filters: Check if emails are being blocked
  • Rate limits: If processing many reports, add delays between emails
  • Write permissions: Confirm logins can update report status
  • Field name: Verify the status field name matches your system exactly

Take It Further

Once your basic agent is working, consider these enhancements:
Different users can set their own thresholds. Learn about Agent Memory
  • Finance Manager: “Auto-approve reports under $500 from employees in my department.”
  • Director: “Auto-approve all reports under 2,000.Flaganythingover2,000. Flag anything over 2,000 for my review.”

Human-in-the-Loop

Add approval steps before emails are sent

Agent Memory

Personalize approval thresholds per user

Files

Upload your expense policy for the agent to reference

Refining Your Agent

Improve agent performance over time