Use case

How to Analyze Cash Flow Using AI

Review historical cash movements, compare monthly net flow, and trace changes to transaction groups using the metrics in your Cube deployment.

  • Separate operating, investing, and financing activity
  • Reconcile cash inflows, outflows, and balances
  • Compare complete periods and inspect account groups

What is cash flow analysis with AI?

Cash flow analysis follows cash entering and leaving a business over a defined period. It groups movements into operating, investing, and financing activity according to the organization's finance-approved policy, then reconciles net movement with opening and closing cash where those balances are available.

An AI agent can query modeled transactions and summarize monthly totals or segments such as legal entity, account, or transaction group. Cube is the semantic layer for AI, so the same governed cash metrics can serve people and agents; the result still depends on clear definitions, dates, currency conversion, and source coverage.

This workflow describes historical cash movement. It does not forecast future cash, determine whether funds are available for obligations, or prove why a balance changed.

Start with consistent transaction rules

Agree on the cash movement date, currency, category rules, and transaction statuses before comparing periods. Keep unknown classifications visible and reconcile balances only at the same entity and currency scope.

Illustrative inputs for a June 2026 cash flow review, USD thousands
MetricIllustrative example
Reporting periodJune 1–30, 2026; posted date in UTC, compared with April and May.
Operating cash flow$540k cash in − $330k cash out = +$210k.
Investing cash flow$0 cash in − $130k cash out = −$130k.
Financing cash flow$60k cash in − $20k cash out = +$40k.
Cash reconciliation$630k opening cash + $120k net change = $750k closing cash.
The Prompt

Copy. Paste. Run your cash flow review.

Connect to Cube via MCP or our CLI, then run the prompt below in your preferred agent.

Start with a Cube deployment connected to your data and a model containing the metrics you want to analyze.

01Connect over MCP

Connect over MCP

Connect your agent to your existing Cube deployment and sign in through OAuth.

MCP endpoint
https://cubecloud.dev/mcp
Sign in to Cube

Complete OAuth in your agent to connect your Cube account.

Choose a deployment

Use your default deployment or select another one available to your account.

Read the MCP setup docs
01Connect with CLI

Connect with CLI

Install the Cube CLI and sign in from a terminal-capable agent.

Install the CLI
curl -fsSL https://raw.githubusercontent.com/cube-js/cube/master/install-cli.sh | sh
Log in (replace TENANT with your account name)
cube login --url https://TENANT.cubecloud.dev
Inspect API operations
cube spec --json
Read the CLI docs

02Run this prompt in your agent

Choose your agent and copy the prompt below.

Prompt for Codex
Use the Cube MCP server connected in Codex and select the intended deployment. Run read-only analytics queries. Run a historical cash flow review using my connected Cube deployment.Use read-only requests and keep financial identifiers and credentials private. DEFINITIONSInspect the model and report the cash inflow and outflow measures, transactiongrain, cash movement date, time zone, currency, account scope, and availableoperating, investing, and financing classifications. Follow the finance-approveddefinitions. Do not infer a category from an account name or transaction text.If a required definition or field is missing, explain the gap instead ofinventing a measure or result. ANALYSIS1. Review the three most recent complete calendar months available. State each   exact start and end date, the date field, and the time zone. Exclude an   incomplete month from period comparisons.2. For each month, report cash inflows, cash outflows, and net cash flow for   operating, investing, and financing activity. Use the model's sign   convention and calculate net flow as inflows minus outflows. Show unknown   or unclassified transactions separately.3. Report opening and closing cash balances when the model provides them. Check   that category totals reconcile to the total net movement and that opening   cash plus net movement equals closing cash at the same entity and currency   scope. State any reconciliation difference.4. Compare available segments such as legal entity, cash account, or transaction   group. Keep currencies separate unless the model has an approved conversion   definition; state the conversion basis when it is used.5. Net cash flow is an amount and has no denominator. Do not turn it into a   percentage rate. Calculate a ratio only when an approved metric defines its   denominator; otherwise compare absolute amounts. Describe large movements   as observations to investigate, not proven causes or forecasts. DATA HANDLINGUse the model's approved treatment of posted, pending, voided, and reversedtransactions. Do not silently drop missing dates, currencies, accounts, orclassifications. If the status rules or fields are unavailable, show the gapand explain how it limits the totals. OUTPUTReturn the metric definitions, exact periods, result tables, filters, andreconciliation checks. Summarize the largest observed movements and thefollow-up data that could explain them. Label results as historical; do notmake a cash forecast or claim a cause without supporting evidence.

How it works

1

Confirm the cash flow contract

Check the cash movement date, currency, transaction statuses, account scope, and finance-approved category rules. Keep any unknown or unmapped activity visible instead of assigning it by name.

2

Reconcile the period totals

Compare inflows, outflows, and net movement across operating, investing, and financing activity. When opening and closing balances exist, verify that opening cash plus net movement matches closing cash at the same scope.

3

Trace the largest movements

Break down a change by available account or transaction group, then inspect the underlying records. A category can show where cash moved; it does not establish why the movement happened or what comes next.

Compare net flow and category drivers

The chart compares monthly net cash flow with June category totals. Every amount is fictional and expressed in USD thousands; the worked example below shows the June reconciliation.

Worked example: fictional June 2026 cash flows, USD thousands
CategoryCash inflowsCash outflowsNet cash flow
Operating$540k$330k+$210k
Investing$0$130k−$130k
Financing$60k$20k+$40k
Total$600k$480k+$120k
  • June cash inflows total $600k and outflows total $480k, for net cash flow of +$120k. The category amounts reconcile: +$210k operating − $130k investing + $40k financing = +$120k.
  • With fictional opening cash of $630k, the +$120k movement gives closing cash of $750k. The April, May, and June net movements are +$130k, +$50k, and +$120k respectively.
  • Investing activity is the largest negative category in June. The totals point to transactions worth inspecting; they do not identify the reason or establish a future cash position.

This hand-calculated example and both images use fictional values, not a customer result, benchmark, or forecast. Historical cash movement alone cannot predict future liquidity; actual results depend on approved classifications, source coverage, dates, and currency handling.

Frequently Asked Questions

It summarizes cash entering and leaving a business over a defined period, usually grouped into operating, investing, and financing activity. A useful review states the date, currency, transaction rules, and scope behind each total.

Try Cube for free