Menu

Explorer & Settings

Tempo Explorer Submit Project
Back to all projects

agentrails-dataverse-integration

by kmatthewsio · Updated 5 months ago

Dataverse integration for AgentRails x402 payments. Sync agent payment data to Dataverse for Power BI reporting, model-driven apps, and enterprise security roles.

In the AI payments ecosystem

agentrails-dataverse-integration is an early-stage project in the AI payments / x402 ecosystem, focused on ai-agents, dataverse, power-automate, power-bi. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like AgenticCommerce, agentrails-copilot-actions, ClawRouter, x402-client, solcex-autonomous-vanguard, awesome-molt-ecosystem.

README.md View on GitHub →

AgentRails Dataverse Integration

Sync x402 payment data from AgentRails into Microsoft Dataverse. Once in Dataverse, payment data is available in Power BI, model-driven apps, canvas apps, and enterprise security roles.

What's Included

agentrails-dataverse-integration/
├── README.md                          # This file
├── schema/
│   └── agent-payments-table.md        # Dataverse table definition
├── flow-template.json                 # Power Automate sync flow
├── solution/                          # Exported Dataverse solution (coming soon)
└── LICENSE

Architecture

┌──────────────────────┐     Every 15 min      ┌──────────────────────┐
│   AgentRails API     │ ◄──────────────────── │   Power Automate     │
│   api.agentrails.io  │ ────────────────────► │   (Sync Flow)        │
│                      │   GET /api/x402/       │                      │
│   x402 Payments      │   payments?limit=100   │   Upsert to          │
│   Agent Data         │                        │   Dataverse           │
└──────────────────────┘                        └──────────┬───────────┘
                                                           │
                                                           v
                                                ┌──────────────────────┐
                                                │   Dataverse          │
                                                │   ar_agentpayment    │
                                                │                      │
                                                │   ┌────────────┐     │
                                                │   │ Power BI   │     │
                                                │   │ Reports    │     │
                                                │   └────────────┘     │
                                                │   ┌────────────┐     │
                                                │   │ Model-     │     │
                                                │   │ Driven App │     │
                                                │   └────────────┘     │
                                                │   ┌────────────┐     │
                                                │   │ Security   │     │
                                                │   │ Roles      │     │
                                                │   └────────────┘     │
                                                └──────────────────────┘

Dataverse Table: Agent Payments

The ar_agentpayment table mirrors the x402 payment records from the AgentRails API.

Column Type Description
Payment ID Text (PK) pay_abc123
Resource Text API endpoint path
Network Choice Blockchain network (Base, Ethereum, Arc)
Amount (USDC) Currency Payment amount
Payer Address Text Ethereum wallet (sender)
Recipient Address Text Ethereum wallet (receiver)
Transaction Hash Text On-chain tx hash
Status Choice Pending / Settled / Failed
Created At DateTime Payment initiated
Settled At DateTime On-chain settlement
Sync Timestamp DateTime Last sync time

See schema/agent-payments-table.md for the full schema including indexes, views, and column security recommendations.

Power Automate Sync Flow

The flow-template.json defines a Power Automate flow that:

  1. Triggers every 15 minutes on a recurrence schedule
  2. Calls GET /api/x402/payments?limit=100 with your API key
  3. Parses the JSON response
  4. Upserts each payment into the Dataverse table (insert if new, update if exists)

Sync Logic

  • Uses paymentId as the natural key for deduplication
  • Updates status, settledAt, and transactionHash on existing records (payments can transition from Pending to Settled)
  • Maps CAIP-2 network IDs to Dataverse choice values
  • Sets ar_synctimestamp on every upsert for monitoring
  • Runs 20 concurrent iterations for performance

Import the Flow

  1. Go to make.powerautomate.com
  2. Click My flows > Import > Import Package
  3. Upload flow-template.json
  4. Configure the connections:
    • HTTP connector: Built-in (no extra connection needed)
    • Dataverse connector: Select your environment
  5. Set the AgentRails_ApiKey parameter to your API key
  6. Turn on the flow

Note: The flow template uses the HTTP connector for API calls. If you've imported the custom connector, you can replace the HTTP action with the connector's GetPayments operation for a cleaner setup.

What You Can Do With Dataverse Data

Power BI Dashboard

Connect Power BI to the ar_agentpayment table for:

  • Payment volume over time
  • Revenue by network
  • Settlement success rate
  • Agent spending breakdown
  • Top payer/recipient addresses

Model-Driven App

Build a model-driven app for operations teams to:

  • Browse and search payment records
  • Filter by status, network, or date range
  • Drill into individual payment details
  • Export filtered records to Excel

Canvas App

Build a mobile-friendly canvas app for:

  • Real-time payment status on the go
  • Agent balance monitoring
  • Quick search by payment ID or transaction hash

Alerts

Combine with Power Automate to:

  • Alert on failed payments
  • Notify when daily volume exceeds a threshold
  • Escalate when an agent's balance is low
  • Report weekly settlement summaries

Dataverse Solution Export

The solution/ directory is a placeholder for the exported Dataverse managed solution (.zip). This will be added after creating and testing the table in a Power Platform environment.

To export the solution yourself:

  1. Create the table and columns per schema/agent-payments-table.md
  2. Add the table to a Dataverse solution
  3. Export as managed or unmanaged
  4. Place the .zip in the solution/ directory

Prerequisites

  • Power Platform environment with Dataverse database
  • AgentRails API key (sign up free)
  • Power Automate license (included with most M365 plans)

Related Repos

Repo Description
agentrails-copilot-actions Copilot Studio action definitions
agentrails-powerplatform-demo Custom connector + security roles
AgenticCommerce Core x402 payment infrastructure

License

MIT - see LICENSE

All USDC projects →