A decentralized agent platform built on Flow blockchain, featuring scheduled transactions, automated recurring payments, and a consumer-grade UI for creating and managing on-chain automation agents.
Live Demo:
- Mainnet: flowmatic.up.railway.app
- Testnet: flowpilot.up.railway.app
Built for: Flow Forte Hacks Hackathon 2025
Status: ✅ Production Ready (95% complete)
Consumer-oriented agent platform bringing Flow's Scheduled Transactions to everyone with:
- No-Code Agent Creation - Visual interface for building agents without Cadence knowledge
- Agent Cockpit - Simple dashboard with Active/Completed agents and execution history
- Payment Agent Template - Automated recurring FLOW transfers (subscriptions, salaries, rent)
- Real-time Sync - Backend discovers agents via Find Labs API with smart caching
- Transaction Chaining - Handlers automatically schedule next execution for true recurring flows
Status: ✅ READY - Full end-to-end implementation working on testnet and mainnet
Flow Blockchain Transaction Discovery API:
- AgentScannerService - Direct integration with Find Labs API for scheduled transaction discovery
- Execution Chain Building - Groups transactions by scheduled_transaction → completed_transaction linkage
- State Reconciliation - Compares API data with local database for accurate agent tracking
- Smart Caching - 5-minute cache interval with force refresh option
- Pagination Support - Handles large transaction sets (up to 1000 records)
Implementation:
// Backend services:
backend/src/services/agentScannerService.js // 405 lines - Find Labs client & chain building
backend/src/routes/sync.js // 636 lines - Smart scan with state reconciliation
backend/src/routes/agents.js // Agent CRUD operationsAPI Endpoints Used:
GET /flow/v1/scheduled-transaction- Query scheduled transactions by ownerGET /flow/v1/scheduled-transaction/:id- Get transaction details- Uses Basic Auth:
FIND_LABS_USERNAME/FIND_LABS_PASSWORD - Supports both testnet and mainnet via
FLOW_NETWORKenv var
Status: ✅ Fully integrated and working
Scheduled Transactions (FLIP 330) Implementation:
- PaymentCronTransactionHandler - Production-ready Cadence contract implementing
FlowTransactionScheduler.TransactionHandler - Transaction Chaining - Handlers schedule next execution during current execution
- Execution History Tracking - Complete history with fees, timestamps, errors, block heights
- Cancellation Support - Cancel scheduled transactions with fee refunds
- Priority Levels - High/Medium/Low priority execution (affects fees)
Implementation:
cadence/PaymentAgent/contracts/PaymentCronTransactionHandler.cdc // Main handler contract
cadence/PaymentAgent/transactions/InitPaymentCronTransactionHandler.cdc // Setup transaction
cadence/PaymentAgent/transactions/SchedulePaymentCron.cdc // Schedule payments
cadence/PaymentAgent/transactions/CancelPaymentCron.cdc // Cancel payments
cadence/PaymentAgent/scripts/GetPaymentCronStatus.cdc // Query statusDeployed Contracts:
- Mainnet:
PaymentCronTransactionHandlerat0x651079a7b572ef10 - Testnet:
PaymentCronTransactionHandlerat0x6cc67be8d78c0bd1
Status: ✅ Fully deployed and working on both networks
- Purpose: Scheduled transaction discovery and monitoring
- Status: Fully integrated
- Endpoint: Environment-specific (testnet/mainnet)
- Authentication: Basic Auth (username/password)
- Data: Scheduled transactions, execution history, transaction chains, fees
- Features:
- Pagination support (100 records per page, up to 1000 total)
- Filters by owner address
- Tracks both scheduled and completed transactions
- Transaction chain linking (scheduled_transaction → completed_transaction)
Backend Integration:
backend/src/services/agentScannerService.js // 405 lines
- scanForAgents(userAddress) // Fetch all transactions
- buildExecutionChains(transactions) // Group into chains
- buildAgentFromChain(chain, isActive) // Build agent data- Purpose: Execute Cadence scripts and transactions
- Integration:
@onflow/fcllibrary + Flow React SDK - Network: Testnet (
https://rest-testnet.onflow.org) or Mainnet - Usage:
- Execute Cadence scripts (read data)
- User wallet transaction signing
- Account balance queries
- Contract interaction
Frontend Integration:
frontend/lib/flow/ // FCL integration
- auth.ts // Wallet connection
- cadence-transactions.ts // Transaction templates
- scheduled-transactions.ts // Scheduled tx hooks
- payment-agent-hooks.ts // Payment agent hooksStatus: FULLY IMPLEMENTED AND WORKING
Payment Agent Handler:
- ✅
PaymentCronTransactionHandler.cdc- ImplementsFlowTransactionScheduler.TransactionHandler - ✅ Transaction chaining - Each execution schedules the next
- ✅ Fee estimation and payment
- ✅ Priority levels (High/Medium/Low)
- ✅ Execution effort management
- ✅ Cancellation with refunds
Contracts:
cadence/PaymentAgent/contracts/PaymentCronTransactionHandler.cdc // 198 linesTransactions:
- ✅
InitPaymentCronTransactionHandler.cdc- One-time handler setup - ✅
SchedulePaymentCron.cdc- Schedule recurring payments - ✅
CancelPaymentCron.cdc- Cancel scheduled payments
Scripts:
- ✅
GetPaymentCronStatus.cdc- Query payment status
Deployed: Mainnet + Testnet
Full wallet integration for user-signed transactions:
// frontend/lib/flow/auth.ts
import * as fcl from "@onflow/fcl";
fcl.config({
'flow.network': 'testnet',
'accessNode.api': 'https://rest-testnet.onflow.org',
'discovery.wallet': 'https://fcl-discovery.onflow.org/testnet/authn',
});
// User signs transactions with their wallet
const txId = await fcl.mutate({
cadence: transactionCode,
args: [...],
limit: 9999,
});Features:
- ✅ Wallet connection (Dapper + others via Flow React SDK)
- ✅ Transaction signing (user-controlled)
- ✅ Account balance queries
- ✅ Cadence script execution
- ✅ React hooks for state management
Integration:
frontend/lib/flow/
- auth.ts // FCL configuration
- cadence-transactions.ts // Transaction templates
- scheduled-transactions.ts // Scheduled tx React hooks
- payment-agent-hooks.ts // Payment agent hooks
- error-handler.ts // Error handlingPayment Agent Contract:
PaymentCronTransactionHandler.cdc- Main handler contract (198 lines)- Implements
FlowTransactionScheduler.TransactionHandler - Handles recurring FLOW token transfers
- Manages payment configuration and state
- Emits
PaymentExecutedandPaymentCronCompletedevents
- Implements
Deployed on:
- Mainnet:
0x651079a7b572ef10 - Testnet:
0x6cc67be8d78c0bd1
Total Cadence Code: ~500 lines across contracts, transactions, and scripts
Native Flow scheduling system integration:
- ✅ Handler capability issuance (
auth(FlowTransactionScheduler.Execute) &{FlowTransactionScheduler.TransactionHandler}) - ✅ Fee estimation before scheduling
- ✅ Transaction scheduling with priority, effort, and timestamp
- ✅ Cancellation support
- ✅ Execution tracking and history
Dependencies:
FlowTransactionScheduler- Main scheduler contractFlowTransactionSchedulerUtils- Utility functionsFlowToken- For fee paymentsFungibleToken- Token standard
Status: ✅ Fully integrated and working
Payment Agent Contract - FULLY WORKING ✅
PaymentCronTransactionHandler.cdc- Main handler contract (198 lines)- Implements
FlowTransactionScheduler.TransactionHandler - Handles recurring FLOW token transfers
- Payment configuration management
- Event emission for monitoring
- Balance and recipient validation
- Transaction chaining for recurring payments
- Implements
Deployed: 0x651079a7b572ef10 (mainnet), 0x6cc67be8d78c0bd1 (testnet)
Transactions (3/3 - ALL CREATED):
✅ InitPaymentCronTransactionHandler.cdc - Initialize handler (one-time setup)
✅ SchedulePaymentCron.cdc - Schedule recurring payments
✅ CancelPaymentCron.cdc - Cancel scheduled payments
Scripts (1/1 - ALL CREATED):
✅ GetPaymentCronStatus.cdc - Query payment status
Total Deployed: 1 contract, ~500 lines working code on mainnet + testnet
API Services:
AgentScannerService- Find Labs API integration and execution chain building (405 lines)sync.js- Smart scan endpoint with state reconciliation (636 lines)agents.js- Agent CRUD operationsusers.js- User management
Data Integrations:
- Find Labs API (scheduled transaction discovery)
- MongoDB (agent state and user data)
- Prisma ORM (type-safe database client)
Database:
- MongoDB with Prisma ORM
- Models: User, Agent, ScanHistory, AgentExecution
- Indexes for performance optimization
Key Features:
- State reconciliation (compares API data with local DB)
- Smart caching (5-minute cache with force refresh)
- Execution chain building (groups transactions by linkage)
- Pagination support (handles large datasets)
Backend Structure:
backend/
├── src/
│ ├── services/
│ │ └── agentScannerService.js // 405 lines - Find Labs client
│ ├── routes/
│ │ ├── sync.js // 636 lines - Smart scan
│ │ ├── agents.js // Agent CRUD
│ │ └── users.js // User management
│ ├── config/
│ │ └── prisma.js // Database client
│ └── middleware/
│ ├── validation.js // Request validation
│ └── errorHandler.js // Error handling
└── prisma/
└── schema.prisma // Database schema
Framework:
- Next.js 15.5.4 App Router
- TypeScript strict mode
- Tailwind CSS 4
- Flow React SDK for wallet integration
- Radix UI components
Key Features:
- Agent Cockpit UI (Active/Completed agents with color-coded statuses)
- Agent Builder (Visual interface for creating agents)
- Execution History Viewer (Fees, timestamps, errors, explorer links)
- Real-time sync with backend
- Dark/light theme support
- Responsive design
Frontend Structure:
frontend/
├── components/
│ ├── agent-cockpit-wrapper.tsx // 902 lines - Main dashboard
│ ├── agent-row.tsx // Agent row UI
│ ├── agent-template-sidebar.tsx // Template selection
│ ├── template-config-panel.tsx // Agent configuration
│ ├── onboarding-*.tsx // Onboarding flow
│ └── ui/ // Radix UI components
├── lib/
│ ├── flow/
│ │ ├── auth.ts // FCL configuration
│ │ ├── cadence-transactions.ts // Transaction templates
│ │ ├── scheduled-transactions.ts // Scheduled tx hooks
│ │ └── payment-agent-hooks.ts // Payment agent hooks
│ └── api/
│ ├── client.ts // Backend API client
│ └── types.ts // TypeScript types
└── app/
└── page.tsx // Main page
Node.js 18+
MongoDB (Atlas or local instance)
Flow CLI 2.7.1+ (for contract deployment)
Flow Wallet (for testnet: https://wallet.flow.com)
Find Labs API credentials (contact Find Labs team)# Clone repository
git clone <repository-url>
cd FlowPilot
# Backend setup
cd backend
npm install
cp env.example .env
# Edit .env with MongoDB URL and Find Labs credentials:
# DATABASE_URL=mongodb://...
# FIND_LABS_USERNAME=...
# FIND_LABS_PASSWORD=...
# FIND_LABS_API_BASE_TESTNET=...
# FIND_LABS_API_BASE_MAINNET=...
# FLOW_NETWORK=testnet
npm run db:generate
npm run db:push
npm run dev # Starts on http://localhost:5000
# Frontend setup (in new terminal)
cd frontend
npm install
npm run dev # Starts on http://localhost:3000Access:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:5000/api - Swagger Docs:
http://localhost:5000/api-docs
Payment Agent:
- ✅ Contract deployed on mainnet + testnet
- ✅ 3/3 transactions created and tested
- ✅ 1/1 scripts created and tested
- ✅ Transaction chaining working
- ✅ Cancellation with refunds
- ✅ Execution history tracking
- ✅ FCL wallet transaction signing
- ✅ Backend API complete
Agent Discovery:
- ✅ Find Labs API integration
- ✅ Execution chain building
- ✅ State reconciliation
- ✅ Smart caching (5-minute interval)
- ✅ Pagination support
- ✅ Active/Completed agent separation
Frontend UI:
- ✅ Agent Cockpit dashboard
- ✅ Agent Builder interface
- ✅ Execution history viewer
- ✅ Real-time sync with backend
- ✅ Dark/light theme
- ✅ Responsive design
- ✅ Wallet connection (Flow React SDK)
Backend API:
- ✅ Smart scan endpoint (
POST /api/sync) - ✅ Agent CRUD operations
- ✅ User management
- ✅ Scan history tracking
- ✅ State reconciliation logic
- ✅ Error handling and validation
Database:
- ✅ MongoDB with Prisma ORM
- ✅ User, Agent, ScanHistory models
- ✅ Indexes for performance
- ✅ Relationship management
Agent Discovery:
⚠️ Large transaction sets (>1000) may require multiple scan requests⚠️ Cache may show stale data for up to 5 minutes (use force refresh)
Frontend:
⚠️ Some UI polish needed for edge cases⚠️ Agent deletion confirmation could be improved
Backend:
⚠️ Error messages could be more user-friendly⚠️ Rate limiting not implemented (basic only)
- Multiple agent templates (only Payment Agent currently)
- Advanced agent analytics
- Agent templates marketplace
- Multi-signature agent management
- Agent sharing/collaboration features
| Bounty | Status | Completion | Notes |
|---|---|---|---|
| Best Killer App - Consumer | ✅ READY | ~100% | Full end-to-end platform working |
| Best Use of Flow Forte Workflows | ✅ READY | ~100% | Scheduled transactions fully implemented |
| Find Labs API Integration | ✅ READY | ~100% | Fully integrated and working |
READY TO SUBMIT: All eligible bounties! 🎉
Breakdown:
- ✅ Best Killer App - Consumer: Full implementation
- ✅ Flow Forte Workflows: Scheduled transactions + chaining
- ✅ Find Labs Integration: Complete API integration
Overall Completion: 100% of core features ✅
What Works Right Now:
- ✅ Payment Agent contract deployed (mainnet + testnet)
- ✅ All transactions and scripts working
- ✅ Agent discovery via Find Labs API
- ✅ Execution chain building and tracking
- ✅ State reconciliation and caching
- ✅ Frontend dashboard with real-time sync
- ✅ Agent builder UI
- ✅ Execution history viewer
- ✅ Wallet integration (Flow React SDK)
- ✅ Backend API complete
Production Readiness: ✅ 95%
- Code: ✅ 100%
- TypeScript: ✅ 0 errors
- Backend build: ✅ SUCCESS
- Testnet: ✅ Contracts deployed
- Mainnet: ✅ Contracts deployed
- E2E testing: ✅ Working
- ✅ User-signed transactions (FCL - no backend signing)
- ✅ Environment variables for secrets
- ✅ Input validation (Express middleware)
- ✅ MongoDB injection prevention (Prisma)
⚠️ Rate limiting (basic only)⚠️ CORS (configured for production)
FlowPilot/
├── backend/ # Node.js + Express backend
│ ├── src/
│ │ ├── services/ # Business logic
│ │ │ └── agentScannerService.js
│ │ ├── routes/ # API endpoints
│ │ │ ├── sync.js
│ │ │ ├── agents.js
│ │ │ └── users.js
│ │ ├── config/ # Configuration
│ │ └── middleware/ # Express middleware
│ └── prisma/
│ └── schema.prisma # Database schema
├── frontend/ # Next.js frontend
│ ├── components/ # React components
│ │ ├── agent-cockpit-wrapper.tsx
│ │ ├── agent-row.tsx
│ │ └── ...
│ ├── lib/
│ │ ├── flow/ # Flow integration
│ │ └── api/ # Backend client
│ └── app/
│ └── page.tsx
├── cadence/ # Cadence contracts
│ └── PaymentAgent/
│ ├── contracts/
│ ├── transactions/
│ └── scripts/
└── flow.json # Flow configuration
Sync:
POST /api/sync- Smart scan (discover agents via Find Labs API)GET /api/sync/status/:address- Get scan status and history
Agents:
GET /api/agents/:userId- Get all agents for userGET /api/agents/agent/:agentId- Get agent detailsPUT /api/agents/agent/:agentId- Update agent metadataDELETE /api/agents/agent/:agentId- Deactivate agentGET /api/agents/stats/:userId- Get agent statistics
Users:
GET /api/users/:address- Get user profilePUT /api/users/:address- Update user profileGET /api/users/:address/scan-history- Get scan historyGET /api/users/:address/dashboard- Get dashboard data
Swagger Documentation: Available at /api-docs when backend is running
- Frontend Documentation - Next.js setup, components, Flow integration
- Backend Documentation - API endpoints, database schema, Find Labs integration
- Payment Agent Guide - Complete Cadence implementation guide
- Flow Documentation: https://developers.flow.com
- Cadence Language: https://cadence-lang.org/docs
- Flow React SDK: https://react.flow.com
- Scheduled Transactions: https://developers.flow.com/build/advanced-concepts/scheduled-transactions
- FLIP 330 Specification: https://github.com/onflow/flips/blob/main/protocol/20250609-scheduled-callbacks.md
- Find Labs API: Contact Find Labs team for API access
- Flow Forte Hacks: dorahacks.io/hackathon/forte-hacks
- Find Labs Docs: docs.find.xyz
- Flow Docs: developers.flow.com
- FCL Documentation: developers.flow.com/tools/fcl-js
MIT License
- Flow Team - For the incredible blockchain platform and Scheduled Transactions feature
- Find Labs - For the transaction discovery API
- Radix UI - For the accessible component library
- Vercel - For Next.js and deployment platform
Built with ❤️ for Flow Forte Hacks 2025