Skip to content

GoogleSheets adaptor should support multi-range update and throttling  #1476

@redietr

Description

@redietr

1. Multi-Range Support for batchUpdateValues

Problem

The current batchUpdateValues implementation only supports updating a single range at a time. When users need to update multiple non-contiguous ranges, they must call batchUpdateValues multiple times, which:

  • Quickly exhausts Google's rate limit (60 writes/minute/user)
  • Defeats the purpose of the batch API
  • Causes failures in parallel workflow scenarios

Current Behavior

batchUpdateValues({
  spreadsheetId: '1abc...',
  range: 'Sheet1!A1:B2',
  values: [['a', 'b'], ['c', 'd']],
  valueInputOption: 'RAW'
});

This sends a single ValueRange object to the API.

Proposed Behavior

Support a data parameter that accepts an array of ValueRange objects, aligning with Google's spreadsheets.values.batchUpdate API:

batchUpdateValues({
  spreadsheetId: '1abc...',
  data: [
    { range: 'Sheet1!A1', values: [['value1']] },
    { range: 'Sheet1!B5', values: [['value2']] },
    { range: 'Sheet1!D10:E11', values: [['a', 'b'], ['c', 'd']] }
  ],
  valueInputOption: 'RAW'
});

2. Request Throttling / Rate Limit Handling

Problem

Google Sheets API enforces a limit of 60 write requests per minute per user. When multiple OpenFn workflows run in parallel or a single workflow makes rapid sequential calls, users hit 429 Too Many Requests errors.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions