forecast.run_stored
Run the tenant's REAL forecast from the books — cash receipts (recorded invoice payments by payment date, plus paid invoices with no recorded payment at their paid date, flagged) and expenses by expense date, monthly in the tenant's base currency, up to the last complete month (the current month is left out; months are the business's calendar months in its own time zone, set in sales settings, Asia/Singapore when unset, and the books block names it in bucket_timezone) and at most 36 months — through the one import pipeline. The result is STORED, replacing the forecast every member reads, so it is owner or admin only: any other role is refused with FORBIDDEN SIMPLER_FORECAST_IMPORT_ROLE_REFUSED before anything is read, saved, run or charged (ask an owner or admin to run it; forecast.read reads the forecast already stored). No arguments are needed. Optional cash_balance (the bank balance in cash_currency, negative for an overdraft), cash_currency (one of 16 codes) and cash_as_of (its date, YYYY-MM-DD) go together: they are saved as the workspace's declared bank balance, replacing the balance entered before, and then the forecast runs and starts its cash block from that balance. When more than one bank account is saved on the Forecast page, it refuses with CONFLICT SIMPLER_FORECAST_CASH_MULTI_ACCOUNT_REFUSED before anything is saved or run, because one balance would replace them all: ask the owner or an admin to update the balances on the Forecast page, or call without the three cash fields to run from the saved balances. It refuses with SERVICE_UNAVAILABLE SIMPLER_FORECAST_SETTINGS_READ_FAIL when the saved balances cannot be read (retry in a minute). The cash fields refuse like forecast.run's (SIMPLER_FORECAST_CASH_WITHOUT_DATE, SIMPLER_FORECAST_CASH_AS_OF_INVALID, VALIDATION_ERROR naming cash_currency when it is missing or outside the list, or cash_balance when its code or symbol names another currency than cash_currency, before anything is saved) and with SERVICE_UNAVAILABLE SIMPLER_FORECAST_FX_UNAVAILABLE when no rate for cash_currency is available (retry shortly, or send the balance in USD). A refusal after the balance was saved carries cash_balance_saved: true. Cost: no metered model cost. Returns the first-3-months outlook and the cash block (as forecast.read describes it) with money formatted in the business's currency, named in the top-level currency field: the engine runs in USD and figures convert back at the rate pinned on the stored result (fx_rate_to_usd); before this release they were USD. Verify with forecast.read before reporting done. Outlook rows carry distress_risk_pct, the share of paths the engine marks closed by that month (renamed this release from the old death-risk column); they no longer carry a cash median, which started from an invented balance. Runway and cash-out come only from forecast.read's cash block. Refuses with RATE_LIMITED after 5 runs an hour and with 402 when the workspace credit cannot cover the cost: when a forecast is already stored the error names forecast.read, so read that instead. The books block in the result names the base currency, gap months, converted amounts and any paid invoices counted without a recorded payment. Refuses with BAD_REQUEST: SIMPLER_FORECAST_LEDGER_TOO_SHORT when the books have fewer than 2 complete months of receipts or spend, SIMPLER_FORECAST_LEDGER_GAPS when 2 or more of the last 6 complete months have no receipts and no spend, and SIMPLER_FORECAST_LEDGER_NO_RECEIPTS when the books carry no receipts or the last complete month has none. Fix: Record payments against your invoices (invoice_payment_record) and log expenses so each month has activity, or upload a spreadsheet on the Forecast page instead. Then run again. To check first without spending a run, call forecast.read: its summary and its no-forecast error carry readiness with the same refusal_code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cash_as_of | No | The date of cash_balance as YYYY-MM-DD. | |
| cash_balance | No | Optional: the bank balance on cash_as_of in cash_currency (major units, negative for an overdraft). Send cash_balance, cash_currency and cash_as_of together; owner or admin only. Refused with SIMPLER_FORECAST_CASH_MULTI_ACCOUNT_REFUSED when more than one bank account is saved: update those on the Forecast page. | |
| cash_currency | No | The currency of cash_balance. |