How to Build an AI-Powered Cashflow Dashboard Agent with n8n (Free Template)

How to Build an AI-Powered Cashflow Dashboard Agent with n8n (Free Template)

Financial teams waste 10-15 hours weekly pulling data from multiple systems to create cashflow reports. This n8n agent eliminates that manual work by automatically syncing payment data from Stripe and QuickBooks, analyzing trends with AI, and generating executive-ready dashboards. You'll learn how to build a complete automation that runs on schedule, processes financial data intelligently, and delivers insights without human intervention.

The Problem: Manual Cashflow Reporting Kills Productivity

Finance teams face a recurring nightmare: compiling cashflow data from disconnected systems.

Current challenges:

  • Logging into 3-5 different platforms to export transaction data
  • Manual reconciliation between payment processors and accounting software
  • Copy-pasting numbers into spreadsheets for 2-3 hours per report
  • Outdated dashboards that lag business reality by days or weeks
  • Human error in calculations leading to incorrect forecasts

Business impact:

  • Time spent: 10-15 hours per week per analyst
  • Cost: $15,000-25,000 annually in labor for a single report type
  • Decision lag: 3-7 days between data availability and executive action
  • Error rate: 5-8% in manual data entry affecting forecast accuracy

CFOs need real-time visibility, but traditional BI tools require expensive implementations and technical resources most small-to-midsize companies lack.

The Solution Overview

This n8n agent creates an automated cashflow intelligence system. It connects directly to Stripe for payment data and QuickBooks for accounting records, merges the datasets, applies AI analysis to identify trends and anomalies, then generates formatted dashboards delivered via email or Slack. The workflow runs on a schedule (daily, weekly, or custom intervals) without human intervention. What makes this effective: it eliminates API complexity through n8n's visual interface, uses AI to interpret financial patterns humans might miss, and delivers actionable insights in executive-friendly formats.

What You'll Build

This automation delivers a complete cashflow intelligence system with enterprise-grade capabilities.

Component Technology Purpose
Payment Data Source Stripe API Real-time transaction and payout data
Accounting Data Source QuickBooks API Expense tracking and account balances
Data Processing n8n Function Nodes Merge, clean, and calculate cashflow metrics
AI Analysis OpenAI GPT-4 Trend identification and anomaly detection
Dashboard Generation Google Sheets + Charts Visual cashflow reports with graphs
Delivery System Email/Slack Automated distribution to stakeholders
Scheduling Engine n8n Cron Trigger Daily/weekly execution without manual starts

Key capabilities:

  • Automatic data synchronization from multiple financial platforms
  • Intelligent reconciliation between payment and accounting systems
  • AI-powered trend analysis with natural language insights
  • Customizable date ranges and reporting periods
  • Error handling with notification alerts
  • Historical data tracking for month-over-month comparisons

Prerequisites

Before starting, ensure you have:

  • n8n instance (cloud or self-hosted version 1.0+)
  • Stripe account with API access (requires View permissions on payments)
  • QuickBooks Online account with OAuth credentials
  • OpenAI API key with GPT-4 access
  • Google Workspace account for Sheets and Gmail
  • Basic JavaScript knowledge for Function node customization
  • Understanding of cashflow concepts (operating, investing, financing activities)

API access requirements:

  • Stripe: Generate restricted API key at dashboard.stripe.com/apikeys
  • QuickBooks: Create OAuth app at developer.intuit.com
  • OpenAI: API key from platform.openai.com/api-keys
  • Google: Enable Sheets and Gmail APIs in Cloud Console

Step 1: Configure Data Source Connections

This phase establishes secure connections to your financial data platforms.

Set up Stripe integration

  1. Create HTTP Request node for Stripe API
  2. Set authentication to "Header Auth"
  3. Add header: Authorization: Bearer sk_live_[your_key]
  4. Configure endpoint: https://api.stripe.com/v1/balance_transactions
  5. Add query parameters: limit=100&created[gte]=[unix_timestamp]

Node configuration:

{
  "method": "GET",
  "url": "https://api.stripe.com/v1/balance_transactions",
  "authentication": "headerAuth",
  "headerAuth": {
    "name": "Authorization",
    "value": "Bearer {{$credentials.stripeApiKey}}"
  },
  "qs": {
    "limit": 100,
    "created[gte]": "={{Math.floor(Date.now()/1000) - 86400*30}}"
  }
}

Why this works:
Stripe's balance_transactions endpoint provides the complete financial picture—not just charges, but refunds, fees, and actual payouts. Using unix timestamps in the query ensures you capture exactly 30 days of data without timezone complications.

Set up QuickBooks integration

  1. Add QuickBooks node from n8n's native integrations
  2. Select "Get All" operation for "Transaction" resource
  3. Configure OAuth2 credentials through n8n's credential manager
  4. Set filters: TxnDate >= [30_days_ago]
  5. Enable pagination to handle accounts with 500+ transactions

Why this approach:
QuickBooks' native n8n node handles OAuth token refresh automatically, eliminating authentication failures that plague custom HTTP implementations. The Transaction resource captures expenses, bills, and payments in a single call.

Step 2: Data Processing and Reconciliation

This phase transforms raw API responses into unified cashflow metrics.

Merge financial datasets

  1. Add Merge node after both API calls
  2. Set mode to "Combine" with "Match on Field"
  3. Configure matching: Stripe description field to QuickBooks Memo
  4. Handle unmatched records with "Keep All" setting

Node configuration:

// Function node: Calculate net cashflow
const stripeData = $input.first().json.data;
const qbData = $input.last().json.QueryResponse.Transaction;

let cashflow = {
  inflows: 0,
  outflows: 0,
  net: 0,
  period: '30_days'
};

// Process Stripe transactions
stripeData.forEach(txn => {
  if (txn.type === 'charge' || txn.type === 'payout') {
    cashflow.inflows += txn.amount / 100; // Convert cents to dollars
  }
  if (txn.type === 'refund' || txn.fee > 0) {
    cashflow.outflows += Math.abs(txn.amount) / 100;
  }
});

// Process QuickBooks expenses
qbData.forEach(txn => {
  if (txn.TxnType === 'Bill' || txn.TxnType === 'Expense') {
    cashflow.outflows += parseFloat(txn.TotalAmt);
  }
});

cashflow.net = cashflow.inflows - cashflow.outflows;

return { json: cashflow };

Why this logic:
Financial reconciliation requires handling different data structures. Stripe measures in cents; QuickBooks uses dollars. This function normalizes both into a consistent format while categorizing transactions by cashflow type (operating vs. financing activities).

Variables to customize:

  • period: Change from 30 to 7, 90, or 365 for different reporting windows
  • txn.type filters: Add 'transfer' or 'adjustment' based on your Stripe setup
  • Currency conversion: Multiply by exchange rate if handling multi-currency

Step 3: AI-Powered Analysis

This phase applies machine learning to identify patterns and generate insights.

Configure OpenAI analysis

  1. Add OpenAI node after cashflow calculation
  2. Select "Message a Model" operation with GPT-4
  3. Set temperature to 0.3 for consistent financial analysis
  4. Configure system prompt for financial context

Prompt configuration:

System: You are a financial analyst specializing in cashflow management. Analyze the provided cashflow data and identify: 1) Significant trends (>15% change), 2) Anomalies requiring attention, 3) Actionable recommendations for improving cash position.

User: Analyze this 30-day cashflow:
Inflows: ${{$json.inflows}}
Outflows: ${{$json.outflows}}
Net Cashflow: ${{$json.net}}
Previous Period Net: ${{$json.previous_net}}

Provide analysis in 3 bullet points, each under 50 words.

Why this works:
Low temperature (0.3) ensures the AI doesn't hallucinate numbers or provide creative but inaccurate financial advice. The structured prompt forces concise, actionable output that executives can act on immediately. Comparing current to previous periods enables trend detection.

Add anomaly detection logic

// Function node: Flag unusual patterns
const current = $json.net;
const previous = $json.previous_net;
const variance = ((current - previous) / previous) * 100;

let alerts = [];

if (variance > 20) {
  alerts.push({
    type: 'positive_spike',
    message: `Cashflow increased ${variance.toFixed(1)}% - investigate revenue drivers`,
    severity: 'info'
  });
}

if (variance < -20) {
  alerts.push({
    type: 'negative_spike',
    message: `Cashflow decreased ${variance.toFixed(1)}% - review expense categories`,
    severity: 'warning'
  });
}

if (current < 0) {
  alerts.push({
    type: 'negative_balance',
    message: 'Negative net cashflow detected - immediate action required',
    severity: 'critical'
  });
}

return { json: { alerts, variance } };

This logic catches the three most critical cashflow scenarios: unexpected growth (investigate to replicate), concerning decline (investigate to prevent), and negative position (immediate intervention needed).

Step 4: Dashboard Generation and Delivery

This phase creates visual reports and distributes them to stakeholders.

Build Google Sheets dashboard

  1. Add Google Sheets node with "Append" operation
  2. Configure to write to "Cashflow_Dashboard" sheet
  3. Map fields: Date, Inflows, Outflows, Net, AI_Insights, Alerts
  4. Add second Sheets node for chart generation using Apps Script

Sheet structure:

Column A: Date (YYYY-MM-DD)
Column B: Inflows ($)
Column C: Outflows ($)
Column D: Net Cashflow ($)
Column E: AI Analysis (text)
Column F: Alert Level (info/warning/critical)

Apps Script for auto-charting:

function createCashflowChart() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const dataRange = sheet.getRange('A2:D32'); // Last 30 days
  
  const chart = sheet.newChart()
    .setChartType(Charts.ChartType.LINE)
    .addRange(dataRange)
    .setPosition(2, 8, 0, 0) // Column H
    .setOption('title', '30-Day Cashflow Trend')
    .setOption('hAxis', {title: 'Date'})
    .setOption('vAxis', {title: 'Amount ($)'})
    .build();
    
  sheet.insertChart(chart);
}

Configure email delivery

  1. Add Gmail node after Sheets update
  2. Set operation to "Send Email"
  3. Configure recipients from workflow variables
  4. Attach Google Sheets link in body

Email template:

Subject: Daily Cashflow Report - {{$now.format('YYYY-MM-DD')}}

Body:
<h2>Cashflow Summary</h2>
<p><strong>Net Cashflow:</strong> ${{$json.net.toLocaleString()}}</p>
<p><strong>Change vs. Previous Period:</strong> {{$json.variance}}%</p>

<h3>AI Insights</h3>
{{$json.ai_analysis}}

<h3>Alerts</h3>
{{$json.alerts.map(a => `<li>${a.message}</li>`).join('')}}

<p><a href="{{$json.sheet_url}}">View Full Dashboard</a></p>

Why this delivery method:
Email provides a paper trail for compliance, while the embedded Sheets link enables drill-down analysis. Executives get the summary in their inbox; analysts can explore the full dataset without switching tools.

Workflow Architecture Overview

This workflow consists of 12 nodes organized into 4 main sections:

  1. Data ingestion (Nodes 1-4): Cron trigger initiates execution, parallel HTTP requests fetch Stripe and QuickBooks data simultaneously
  2. Processing logic (Nodes 5-8): Merge node combines datasets, Function nodes calculate metrics and detect anomalies, OpenAI node generates insights
  3. Dashboard creation (Nodes 9-10): Google Sheets nodes append data and trigger chart generation via Apps Script
  4. Output delivery (Nodes 11-12): Gmail node sends formatted report, Slack node posts alert summary to finance channel

Execution flow:

  • Trigger: Cron schedule at 6:00 AM daily (configurable)
  • Average run time: 45-60 seconds for 30 days of data
  • Key dependencies: Stripe, QuickBooks, OpenAI, Google Sheets APIs must be accessible

Critical nodes:

  • HTTP Request (Stripe): Handles pagination for accounts with 1000+ transactions per month
  • Function (Cashflow Calculator): Core business logic—errors here break the entire workflow
  • OpenAI: Provides natural language insights—fallback to static analysis if API fails
  • Google Sheets: Persistent storage for historical trend analysis

The complete n8n workflow JSON template is available at the bottom of this article.

Key Configuration Details

Critical Configuration Settings

Stripe Integration

Required fields:

  • API Key: Your Stripe secret key (starts with sk_live_ or sk_test_)
  • Endpoint: https://api.stripe.com/v1/balance_transactions
  • Timeout: 30 seconds (increase to 60 for accounts with high transaction volume)

Common issues:

  • Using Charges endpoint instead of Balance Transactions → Misses refunds and fees
  • Not handling pagination → Only captures first 100 transactions
  • Incorrect date filtering → Duplicates or misses data on month boundaries

QuickBooks OAuth Configuration

Required credentials:

  • Client ID and Secret from developer.intuit.com
  • Redirect URI: Must match exactly what's configured in n8n (including trailing slash)
  • Scopes: com.intuit.quickbooks.accounting minimum

Token refresh handling:

// Function node: Check token expiration
const tokenExpiry = $credentials.quickbooks.expiresAt;
const now = Date.now();

if (now > tokenExpiry - 300000) { // Refresh 5 min before expiry
  // n8n handles refresh automatically, but log for monitoring
  console.log('QuickBooks token refreshed at:', new Date().toISOString());
}

Why this approach:
QuickBooks OAuth tokens expire after 60 minutes. Proactive monitoring prevents mid-workflow authentication failures that corrupt data. The n8n credential system handles refresh automatically, but logging enables troubleshooting.

OpenAI Analysis Parameters

Optimal settings for financial analysis:

  • Model: gpt-4 (not gpt-3.5-turbo—accuracy matters for financial data)
  • Temperature: 0.3 (low variance for consistent analysis)
  • Max tokens: 300 (sufficient for 3 bullet points)
  • Top P: 0.9 (slight creativity for insight generation)

Cost optimization:
At $0.03 per 1K tokens, each analysis costs ~$0.01. Running daily for a month: $0.30. Using gpt-3.5-turbo reduces cost to $0.03/month but sacrifices nuanced financial understanding.

Testing & Validation

Component testing sequence:

  1. Test Stripe connection: Run workflow manually, inspect HTTP Request output—should return JSON array with data property containing transaction objects
  2. Verify QuickBooks sync: Check that Transaction count matches QuickBooks dashboard (Reports → Transaction List by Date)
  3. Validate calculations: Compare Function node output to manual Excel calculation—net cashflow should match within $1 due to rounding
  4. Review AI insights: Run with known data patterns (e.g., 50% revenue spike) and verify AI identifies the trend
  5. Check dashboard formatting: Open Google Sheets link—data should populate in correct columns with proper number formatting

Common troubleshooting:

Issue Cause Solution
"Unauthorized" error on Stripe API key lacks permissions Regenerate key with "Read" access to Balance
QuickBooks returns empty array Date filter excludes all transactions Remove date filter temporarily to verify connection
AI analysis is generic Prompt lacks specific data Ensure cashflow values are interpolated: ${{$json.net}}
Chart doesn't appear in Sheets Apps Script trigger not set Manually run createCashflowChart() once to initialize

Validation checklist:

  • Workflow completes without errors in test run
  • Cashflow numbers match manual calculation within 2%
  • AI insights reference specific dollar amounts from data
  • Email arrives within 2 minutes of workflow completion
  • Google Sheets updates with new row containing current date

Deployment Considerations

Production Deployment Checklist

Area Requirement Why It Matters
Error Handling Add Error Trigger node with email notification Prevents silent failures—you'll know within minutes if APIs fail
Monitoring Webhook to status page (e.g., Uptime Robot) Detect workflow execution failures within 5 minutes vs. discovering at month-end
Credentials Use n8n's credential encryption, never hardcode Protects financial API access from unauthorized use
Rate Limiting Add Wait node (500ms) between API calls Prevents 429 errors from Stripe/QuickBooks during high-volume periods
Data Retention Archive Google Sheets monthly to separate tabs Maintains 12+ months of history without slowing chart generation
Backup Export workflow JSON weekly to version control Enables rollback if configuration changes break production

Error handling strategy:

// Function node: Wrap API calls with try-catch
try {
  const response = await fetch('https://api.stripe.com/v1/balance_transactions', {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });
  
  if (!response.ok) {
    throw new Error(`Stripe API returned ${response.status}`);
  }
  
  return response.json();
} catch (error) {
  // Send alert to Slack
  await fetch(slackWebhook, {
    method: 'POST',
    body: JSON.stringify({
      text: `Cashflow workflow failed: ${error.message}`,
      channel: '#finance-alerts'
    })
  });
  
  // Return empty dataset to prevent workflow crash
  return { data: [] };
}

Monitoring recommendations:

  • Set up n8n workflow execution webhook to external monitoring service
  • Configure Slack alerts for critical errors (negative cashflow, API failures)
  • Review execution logs weekly for performance degradation
  • Track API quota usage to avoid unexpected service interruptions

Use Cases & Variations

Real-World Use Cases

Use Case 1: SaaS Subscription Business

  • Industry: B2B Software
  • Scale: 500-1000 recurring charges per month
  • Modifications needed: Add Stripe subscription data endpoint, calculate MRR alongside cashflow, integrate with ChartMogul for cohort analysis
  • Benefit: Correlate cashflow with subscription metrics (churn, expansion revenue)

Use Case 2: E-commerce Retailer

  • Industry: Online retail with inventory
  • Scale: 2000+ transactions per day
  • Modifications needed: Add Shopify API for order data, integrate inventory costs from QuickBooks, calculate gross margin alongside cashflow
  • Benefit: Identify products draining cash vs. generating profit

Use Case 3: Agency with Project-Based Billing

  • Industry: Marketing/consulting services
  • Scale: 20-50 projects simultaneously
  • Modifications needed: Add project tracking from Asana or Monday.com, map expenses to specific projects, calculate project-level profitability
  • Benefit: Identify which clients/projects contribute most to positive cashflow

Use Case 4: Multi-Location Franchise

  • Industry: Retail/food service with 5-10 locations
  • Scale: Separate Stripe accounts per location
  • Modifications needed: Loop through multiple Stripe API keys, aggregate data by location, generate location-specific dashboards
  • Benefit: Compare cashflow performance across locations to identify best practices

Customizations & Extensions

Customizing This Workflow

Alternative Integrations

Instead of Stripe:

  • PayPal Commerce: Use PayPal REST API /v1/reporting/transactions endpoint—requires 3 node changes (HTTP Request config, authentication, response parsing)
  • Square: Better for brick-and-mortar retail—swap Stripe node for Square API with OAuth—handles inventory-linked transactions
  • Authorize.net: Use for traditional merchant accounts—requires XML parsing instead of JSON (add XML node)

Instead of QuickBooks:

  • Xero: Better for international businesses—use Xero native n8n node—nearly identical configuration to QuickBooks
  • FreshBooks: Ideal for freelancers/small agencies—simpler API with fewer fields to map
  • Wave: Free accounting software—requires custom HTTP nodes (no native n8n integration)

Workflow Extensions

Add automated forecasting:

  • Insert Function node after cashflow calculation
  • Implement linear regression on 90-day historical data
  • Project next 30 days of cashflow based on trend
  • Nodes needed: +3 (Function for regression, Set for formatting, IF for alert thresholds)
  • Accuracy: ±15% for stable businesses, less reliable for seasonal operations

Scale to handle multiple entities:

  • Replace single API calls with Loop node iterating over entity list
  • Add entity identifier to all data records
  • Generate separate dashboards per entity with consolidated summary
  • Performance improvement: Parallel execution reduces runtime from 5 minutes to 90 seconds for 5 entities

Add budget variance analysis:

  • Import budget data from Google Sheets or QuickBooks
  • Calculate actual vs. budget for each category
  • Flag variances exceeding 10% threshold
  • Nodes needed: +4 (Google Sheets Read, Function for comparison, IF for thresholds, Set for formatting)

Integration possibilities:

Add This To Get This Complexity
Slack integration Real-time alerts in #finance channel Easy (2 nodes)
Power BI connector Executive dashboards with drill-down Medium (6 nodes)
Airtable sync Collaborative cashflow planning Easy (3 nodes)
Notion database Document cashflow insights with context Medium (5 nodes)
Twilio SMS Critical alerts to CFO mobile Easy (2 nodes)
Zapier webhook Connect to 1000+ other apps Easy (1 node)

Advanced customization: Multi-currency handling

// Function node: Convert all transactions to base currency
const exchangeRates = await fetch('https://api.exchangerate-api.com/v4/latest/USD');
const rates = await exchangeRates.json();

const transactions = $input.all();
let convertedTransactions = [];

transactions.forEach(txn => {
  const currency = txn.json.currency.toUpperCase();
  const amount = txn.json.amount;
  
  if (currency !== 'USD') {
    const convertedAmount = amount / rates.rates[currency];
    convertedTransactions.push({
      ...txn.json,
      original_amount: amount,
      original_currency: currency,
      amount: convertedAmount,
      currency: 'USD',
      exchange_rate: rates.rates[currency]
    });
  } else {
    convertedTransactions.push(txn.json);
  }
});

return convertedTransactions.map(t => ({ json: t }));

This enables businesses operating in multiple countries to consolidate cashflow in a single currency for accurate reporting.

Get Started Today

Ready to automate your cashflow reporting?

  1. Download the template: Scroll to the bottom of this article to copy the complete n8n workflow JSON
  2. Import to n8n: Go to Workflows → Import from URL or File, paste the JSON
  3. Configure your services: Add API credentials for Stripe, QuickBooks, OpenAI, and Google Sheets in n8n's credential manager
  4. Test with sample data: Run the workflow manually and verify data appears correctly in Google Sheets
  5. Customize for your business: Adjust date ranges, add your specific expense categories, modify AI prompts for your industry
  6. Deploy to production: Set your Cron schedule (recommend 6 AM daily) and activate the workflow

Immediate next steps:

  • Replace placeholder API keys with your production credentials
  • Update email recipient list in the Gmail node
  • Adjust the Cron trigger to match your reporting schedule (daily at 6 AM, weekly on Monday, etc.)
  • Add your company logo to the email template for branded reports

Need help customizing this workflow for your specific accounting setup or integrating additional financial platforms? Schedule an intro call with Atherial at atherial.ai/contact. We specialize in building production-grade n8n automations for finance teams.


Complete N8N Workflow JSON Template

{
  "name": "Cashflow Dashboard Agent",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 6 * * *"
            }
          ]
        }
      },
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://api.stripe.com/v1/balance_transactions",
        "authentication": "headerAuth",
        "headerAuth": "stripeCredentials",
        "qs": {
          "limit": 100,
          "created[gte]": "={{Math.floor(Date.now()/1000) - 86400*30}}"
        }
      },
      "name": "Fetch Stripe Data",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [450, 200]
    },
    {
      "parameters": {
        "resource": "transaction",
        "operation": "getAll",
        "filters": {
          "query": "SELECT * FROM Transaction WHERE TxnDate >= '{{$now.minus({days: 30}).format('YYYY-MM-DD')}}'"
        }
      },
      "name": "Fetch QuickBooks Data",
      "type": "n8n-nodes-base.quickbooks",
      "typeVersion": 1,
      "position": [450, 400]
    },
    {
      "parameters": {
        "mode": "combine",
        "combinationMode": "mergeByPosition"
      },
      "name": "Merge Financial Data",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 2,
      "position": [650, 300]
    },
    {
      "parameters": {
        "functionCode": "const stripeData = $input.first().json.data || [];
const qbData = $input.last().json.QueryResponse?.Transaction || [];

let cashflow = {
  inflows: 0,
  outflows: 0,
  net: 0,
  period: '30_days',
  date: new Date().toISOString().split('T')[0]
};

stripeData.forEach(txn => {
  if (txn.type === 'charge' || txn.type === 'payout') {
    cashflow.inflows += txn.amount / 100;
  }
  if (txn.type === 'refund' || txn.fee > 0) {
    cashflow.outflows += Math.abs(txn.amount) / 100;
  }
});

qbData.forEach(txn => {
  if (txn.TxnType === 'Bill' || txn.TxnType === 'Expense') {
    cashflow.outflows += parseFloat(txn.TotalAmt || 0);
  }
});

cashflow.net = cashflow.inflows - cashflow.outflows;

return { json: cashflow };"
      },
      "name": "Calculate Cashflow",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [850, 300]
    },
    {
      "parameters": {
        "resource": "message",
        "model": "gpt-4",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a financial analyst specializing in cashflow management. Analyze the provided cashflow data and identify: 1) Significant trends (>15% change), 2) Anomalies requiring attention, 3) Actionable recommendations."
            },
            {
              "role": "user",
              "content": "Analyze this 30-day cashflow:
Inflows: ${{$json.inflows}}
Outflows: ${{$json.outflows}}
Net Cashflow: ${{$json.net}}

Provide analysis in 3 bullet points, each under 50 words."
            }
          ]
        },
        "options": {
          "temperature": 0.3,
          "maxTokens": 300
        }
      },
      "name": "AI Analysis",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [1050, 300]
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "={{$env.GOOGLE_SHEET_ID}}",
        "range": "Cashflow_Dashboard!A:F",
        "values": {
          "values": [
            {
              "column": "Date",
              "value": "={{$json.date}}"
            },
            {
              "column": "Inflows",
              "value": "={{$json.inflows}}"
            },
            {
              "column": "Outflows",
              "value": "={{$json.outflows}}"
            },
            {
              "column": "Net",
              "value": "={{$json.net}}"
            },
            {
              "column": "AI_Insights",
              "value": "={{$json.ai_analysis}}"
            }
          ]
        }
      },
      "name": "Update Dashboard",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 3,
      "position": [1250, 300]
    },
    {
      "parameters": {
        "sendTo": "={{$env.FINANCE_TEAM_EMAIL}}",
        "subject": "Daily Cashflow Report - {{$now.format('YYYY-MM-DD')}}",
        "emailFormat": "html",
        "message": "<h2>Cashflow Summary</h2>
<p><strong>Net Cashflow:</strong> ${{$json.net.toLocaleString()}}</p>
<p><strong>Inflows:</strong> ${{$json.inflows.toLocaleString()}}</p>
<p><strong>Outflows:</strong> ${{$json.outflows.toLocaleString()}}</p>

<h3>AI Insights</h3>
<p>{{$json.ai_analysis}}</p>

<p><a href='https://docs.google.com/spreadsheets/d/{{$env.GOOGLE_SHEET_ID}}'>View Full Dashboard</a></p>"
      },
      "name": "Send Report Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [1450, 300]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch Stripe Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch QuickBooks Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Stripe Data": {
      "main": [
        [
          {
            "node": "Merge Financial Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch QuickBooks Data": {
      "main": [
        [
          {
            "node": "Merge Financial Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Financial Data": {
      "main": [
        [
          {
            "node": "Calculate Cashflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Cashflow": {
      "main": [
        [
          {
            "node": "AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Analysis": {
      "main": [
        [
          {
            "node": "Update Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Dashboard": {
      "main": [
        [
          {
            "node": "Send Report Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Copy this JSON and import it directly into your n8n instance to get started immediately.