Inspiration
Freelancers and small agencies live and die by cash flow, but their money lives in one place (PayPal) while their work lives in another (a project plan). The result is a constant, manual reconciliation: Who paid? What's overdue? Is it safe to start the next phase? We wanted a copilot that reads the single source of truth, PayPal, and turns it into something a solo operator can act on in seconds: a clear financial picture, AI-drafted nudges for late payers, and a delivery timeline where the work literally unblocks the moment the money lands.
What it does
Flow connects to a PayPal account and turns live invoice data into three things:
- A financial dashboard (AG Studio on Amazon Bedrock) KPIs for invoiced, collected, outstanding, and overdue; collection-rate gauge; invoiced-vs-paid trends; and breakdowns by customer, work unit, and payment method. You can ask the AI to build new widgets on the fly.
- A payment-gated delivery timeline (Bryntum Gantt) every client is a project, every invoice a payment tranche, and every work phase is gated by the previous tranche. A past-due, unpaid tranche turns the next phase red and ⛔ blocked. The instant PayPal reports payment, the phase flips to unblocked/green live, with no refresh.
- An AI collections assistant (Bedrock) drafts friendly, context-aware payment reminders for overdue invoices, and (for authorized operators) sends them through PayPal after a single-use approval.
How we built it
Backend: Node and Express (TypeScript). PayPal REST for invoices, payments, reminders, and webhook signature verification. Amazon Bedrock (Claude Sonnet) via the Converse API for the dashboard AI and reminder drafting.
- Frontend: React + Vite. AG Studio for the analytics dashboard and natural-language widget building; Bryntum Gantt for the delivery timeline.
- Live updates: an in-process event emitter SSE (
/api/events); a debounced PayPal watcher that diffs invoice status/balances and broadcasts a fresh dashboard and timeline on every change. - Security: session login with distinct judge/operator passwords, same-origin/CSRF checks, rate limiting, and a single-use approval store. Legacy client-trusting endpoints are disabled on the hosted demo. Webhooks verify-before-acknowledgement and return 503 on failure so PayPal retries.
- Deploy: Render web service (Virginia, starter plan), built from a private GitHub repo. Secrets are injected via a local script straight from
.envto the Render API never through logs or chat.
Challenges we ran into
Payment truth vs. UI state. We route every change through a PayPal read, so the timeline only unblocks when PayPal actually confirms the payment.
- Sandbox quirks. Some PayPal sandbox endpoints (transaction search, balances) returned 403 for our app, so the dashboard degrades gracefully. "Recording" an external payment to simulate a customer paying required deleting prior external payments before an invoice could be reset for repeat demos.
- Headless rendering of rich widgets. Getting AG Studio and Bryntum to render fully in a headless browser for the recorded demo took careful waits on live data and layout.
- Build-time vs. run-time config. The AG Studio license is embedded at build time, so we had to set it before Render's first build rather than after.
Accomplishments that we're proud of
A real PayPal payment unblocks a delivery phase on screen in seconds which is verified end to end against the deployed service.
- Role-based access, server-side approvals bound to exact inputs, and real webhook signature verification.
- A polished, three-sponsor integration using AG Studio, Bryntum, and Render which is wired around PayPal with AWS Bedrock doing the AI work.
What we learned
- Make the Paypal the source of truth and design every state transition around its confirmation.
What's next for Flow for Paypal
- Deeper collections: scheduled reminder cadences, escalation tiers, and AI that picks tone based on client history.
- Cash-flow forecasting: project runway and expected-collection dates from invoice aging and payment behavior.
- Multi-currency and fees: normalize across currencies and surface true revenue.
- Payouts and spend: extend beyond receivables to subcontractor payouts and expenses for a full money picture.
- Extended analytics: more AG Studio report templates and saved views per client segment.
Built With
- ag
- amazon-web-services
- bedrock
- bryntum
- express.js
- render
- rest
- typescript