Spreadsheet with more than 64 columns: nest them in one Sume input key

A Sume run input allows 64 top-level keys and 2 MiB. Nested keys do not count toward the 64, so a 90-column sheet row fits under a single key.

3 min readSume
All posts

What happens when a spreadsheet row has 90 columns?

The input of a Format run must be a JSON object with at most 64 top-level keys and at most 2 MiB. A row built by turning every column into a key goes over the first limit at column 65 and the request is refused with a 400. Only top-level keys are counted: nested keys are not.

So the fix is not to drop columns. Put the row under one key, such as row, and the object has a single top-level key however wide the sheet is.

How do I nest the columns?

Keep a few top-level keys the recipe depends on, and put the rest in a dict. Your Format's instructions then say where to look: for example, the product facts are under row. Remember that the agent reads these as context, so keep headers readable.

def to_input(headers, values, lead=("sku", "language")):
    row = dict(zip(headers, values))
    top = {k: row.pop(k) for k in lead if k in row}
    return {**top, "row": row}

headers = [f"col_{i}" for i in range(90)] + ["sku", "language"]
values = list(range(90)) + ["M-1", "ko"]
payload = to_input(headers, values)
print(len(payload), "top-level keys;", len(payload["row"]), "nested")

What other input limits apply?

The sample prints 3 top-level keys and 90 nested ones. The 2 MiB cap is on the whole object, so a few very long text cells are the usual way to hit it, not column count. Media URLs in input also count toward a budget of 30 files, so a sheet with 40 image columns needs a different approach, such as one contact-sheet image or a smaller per-row selection.

In a bulk queue, each of the up to 100 items has its own input, so these limits apply per item, not to the queue.

  • Keep identifiers like SKU at the top level so they are easy to find in receipts.
  • Check the serialized size before you send, since a 2 MiB failure arrives as a 400.
  • Strip empty columns; blank cells add nothing for the agent.
  • Describe the nested key in the Format's SKILL.md.

Sources

Related posts

More in Formats

All Formats posts

Written by Sume