Sheets manual calculation: keep paid Sume calls out of formulas

Google Sheets can now pause automatic recalculation. Keep Sume job submits in a menu-driven Apps Script, not formulas, so a recalc never buys a render.

5 min readSume
All posts

Does Google Sheets' new manual calculation setting change how you should call Sume from a sheet? It changes what you can rely on, and the safe answer is the same either way: never put a paid Sume request inside a cell formula. Google's Workspace Updates post describes a setting that pauses automatic recalculation, off by default, found under File, Settings, Calculation Settings, rolling out from September 21, 2026, with no admin control (read 2026-10-04).

A custom function that submits a paid job is a hazard in either mode. With automatic calculation, a recalculation can run it again. With manual calculation, it may not run when you expect. Neither behavior is something a billing call should depend on.

What the setting does and doesn't do

The announcement is about formula recalculation in the spreadsheet. It does not describe Apps Script triggers or menu handlers, so do not assume it changes them. A function you run from a custom menu is explicit: it runs when a person clicks, once.

That is the property you want for a paid API. One click, one deliberate submit, a visible result in the sheet.

Where a Sume call can live in a sheet (read 2026-10-04)
PlacementWhen it runsSafe for paid jobs?
Cell formula or custom functionOn recalculation, which you may not controlNo
Menu item running an Apps Script functionWhen a person clicksYes, with an idempotency key
Time-driven triggerOn a schedule you setYes, for polling status

A menu-driven submit

The script below adds a Sume menu and a function that submits one image job per selected row that has no job id yet. It writes the job id back to column B, so a second click skips rows that already have one. It sends an Idempotency-Key built from the sheet and row, so even if the id write failed, a repeat returns the original job.

Store the key in Script Properties, not in a cell. Sume's guidance is to keep keys out of places others can read, and a shared sheet is such a place.

function onOpen() {
  SpreadsheetApp.getUi().createMenu('Sume')
    .addItem('Submit rows without a job id', 'submitRows')
    .addToUi();
}

function submitRows() {
  var key = PropertiesService.getScriptProperties().getProperty('SUME_API_KEY');
  if (!key) throw new Error('Set SUME_API_KEY in Script Properties');
  var sheet = SpreadsheetApp.getActiveSheet();
  var ssId = SpreadsheetApp.getActive().getId();
  var rows = sheet.getDataRange().getValues();
  for (var i = 1; i < rows.length; i++) {
    if (!rows[i][0] || rows[i][1]) continue;
    var res = UrlFetchApp.fetch('https://api.sume.com/v1/images', {
      method: 'post',
      contentType: 'application/json',
      headers: { 'x-api-key': key, 'Idempotency-Key': 'sheet-' + ssId + '-r' + (i + 1) },
      payload: JSON.stringify({ model: 'sume/auto', prompt: String(rows[i][0]) }),
      muteHttpExceptions: true
    });
    var body = JSON.parse(res.getContentText());
    sheet.getRange(i + 1, 2).setValue(res.getResponseCode() < 300 ? (body.job_id || body.id || 'accepted') : 'error ' + res.getResponseCode());
  }
}

Statuses without formulas

A 202 means accepted, not finished, so the sheet needs a second step to learn the outcome. Use a time-driven trigger or a second menu item that reads GET /v1/jobs/:id/status for rows that have an id but no result, and writes the status and, once completed, the artifact URL from GET /v1/jobs/:id/result. Honor next_poll_after_seconds rather than polling in a tight loop.

Mind Apps Script's own quotas. The post on UrlFetchApp's daily and runtime limits covers how to batch, and bulk AI videos from Sheets shows a longer example.

If you turn manual calculation on

Manual calculation is a good fit for a large ledger sheet you do not want to recompute while editing. It does not affect the menu approach above. If a colleague has it on and another has it off, the Sume submit behaves identically, because it never depended on recalculation. To check spend afterward, export usage with the approach in exporting API usage to CSV.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume