GoliathDevelopersGet an API key
Reference/Workflowsgenerated from the gateway manifest

saveWorkflowTableRows

Create or replace rows.

POST/api/v1/callWRITEidempotent · 24 hruns as the key's owner
View as Markdown

Create or replace rows (rows: a row is replaced WHOLE, never merged) and delete rows (deleteRowIds) of one table in a single write; a deleted row or a replaced cell is gone for good, so this needs the person's approval. Pass expectedUpdatedAt = the table's updatedAt from getWorkflowTable so a save over someone else's newer edit is refused (CONFLICT) instead of overwriting it. Returns the table's shape and rowCount; read rows back with getWorkflowTable.

curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "saveWorkflowTableRows",
    "variables": {
      "input": {
        "workflowTableId": "<workflowTableId>"
      }
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

const result = await goliath.workflows.saveWorkflowTableRows(
  {
    input: {
      workflowTableId: '<workflowTableId>'
    }
  },
  { idempotencyKey: crypto.randomUUID() },
)
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    operationId: 'saveWorkflowTableRows',
    variables: {
      input: {
        workflowTableId: '<workflowTableId>'
      }
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

inputSaveWorkflowTableRowsInput!required

Upserts and deletes rows of one table in a single write, which is what the grid does when a user saves.

workflowTableIdID!required
rows[SaveWorkflowTableRowInput!]

Rows to create or replace. A row is replaced whole, never merged.

deleteRowIds[ID!]

Rows to delete, by id.

expectedUpdatedAtDateTime

Optimistic-concurrency token: the table's `updatedAt` as the editor loaded it. When provided and the row has changed since, the save is refused with CONFLICT rather than replacing whatever the other editor committed. Omit only on create, where there is nothing to conflict with.

importPartWorkflowTableImportPartInput

Set when this save is one part of a CSV import. The part is labelled on its history entry, and may carry at most 200 rows so the entry records every one.

Every field, all the way down
variables
[
  {
    "name": "input",
    "type": "SaveWorkflowTableRowsInput!",
    "required": true,
    "description": "Upserts and deletes rows of one table in a single write, which is what the grid does when a user saves.",
    "defaultValue": null,
    "fields": [
      {
        "name": "workflowTableId",
        "type": "ID!",
        "required": true,
        "description": null,
        "defaultValue": null
      },
      {
        "name": "rows",
        "type": "[SaveWorkflowTableRowInput!]",
        "required": false,
        "description": "Rows to create or replace. A row is replaced whole, never merged.",
        "defaultValue": null,
        "fields": [
          {
            "name": "id",
            "type": "ID",
            "required": false,
            "description": "Null creates a new row.",
            "defaultValue": null
          },
          {
            "name": "key",
            "type": "String!",
            "required": true,
            "description": "For a `COUNTY_FIPS` table, exactly 5 digits. Ignored when `keyParts` is given: the key is then derived from the parts.",
            "defaultValue": null
          },
          {
            "name": "keyLabel",
            "type": "String",
            "required": false,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "keyLevel",
            "type": "Int",
            "required": false,
            "description": "Which level of the table's `keyShape` the row belongs to. Absent means the primary level.",
            "defaultValue": null
          },
          {
            "name": "keyParts",
            "type": "[WorkflowTableRowKeyPartInput!]",
            "required": false,
            "description": "The row's key, one entry per part of its level, in order. Absent means `key` and `keyLabel` as the single exact part, which is every table with one exact key.",
            "defaultValue": null,
            "fields": [
              {
                "name": "match",
                "type": "WorkflowTableKeyMatch!",
                "required": true,
                "description": "How one part of a Workflow Table's key is compared with the subject's value. EXACT: Equal, in the key kind's canonical spelling. RANGE: Inside the row's inclusive range. Only offered for kinds whose values have an order: a ZIP code, for one.",
                "defaultValue": null,
                "enumValues": [
                  "EXACT",
                  "RANGE"
                ]
              },
              {
                "name": "value",
                "type": "String",
                "required": false,
                "description": null,
                "defaultValue": null
              },
              {
                "name": "label",
                "type": "String",
                "required": false,
                "description": null,
                "defaultValue": null
              },
              {
                "name": "rangeStart",
                "type": "String",
                "required": false,
                "description": null,
                "defaultValue": null
              },
              {
                "name": "rangeEnd",
                "type": "String",
                "required": false,
                "description": null,
                "defaultValue": null
              }
            ]
          },
          {
            "name": "isDefault",
            "type": "Boolean!",
            "required": true,
            "description": "At most one row per table may be the default, counting rows this call is not touching.",
            "defaultValue": null
          },
          {
            "name": "cells",
            "type": "[SaveWorkflowTableCellInput!]!",
            "required": true,
            "description": "Values by column. A column absent here, or present with an empty string, holds no value for this row.",
            "defaultValue": null,
            "fields": [
              {
                "name": "columnId",
                "type": "ID!",
                "required": true,
                "description": null,
                "defaultValue": null
              },
              {
                "name": "value",
                "type": "String!",
                "required": true,
                "description": null,
                "defaultValue": null
              }
            ]
          }
        ]
      },
      {
        "name": "deleteRowIds",
        "type": "[ID!]",
        "required": false,
        "description": "Rows to delete, by id.",
        "defaultValue": null
      },
      {
        "name": "expectedUpdatedAt",
        "type": "DateTime",
        "required": false,
        "description": "Optimistic-concurrency token: the table's `updatedAt` as the editor loaded it. When provided and the row has changed since, the save is refused with CONFLICT rather than replacing whatever the other editor committed. Omit only on create, where there is nothing to conflict with.",
        "defaultValue": null
      },
      {
        "name": "importPart",
        "type": "WorkflowTableImportPartInput",
        "required": false,
        "description": "Set when this save is one part of a CSV import. The part is labelled on its history entry, and may carry at most 200 rows so the entry records every one.",
        "defaultValue": null,
        "fields": [
          {
            "name": "fileName",
            "type": "String!",
            "required": true,
            "description": "The uploaded file's name.",
            "defaultValue": null
          },
          {
            "name": "part",
            "type": "Int!",
            "required": true,
            "description": "1-based.",
            "defaultValue": null
          },
          {
            "name": "parts",
            "type": "Int!",
            "required": true,
            "description": null,
            "defaultValue": null
          }
        ]
      }
    ]
  }
]

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "workflowAutomationsMutation": {
      "saveWorkflowTableRows": {
        "id": "<ID>",
        "name": "…",
        "description": "…",
        "keyKind": "COUNTY_FIPS",
        "keyFieldPath": "…",
        "keyShape": {
          "levels": [
            {
              "parts": [
                {
                  "kind": "COUNTY_FIPS",
                  "fieldPath": "…",
                  "match": "EXACT"
                }
              ]
            }
          ]
        },
        "rowCount": 0,
        "isProvisioned": true,
        "updatedAt": "2026-01-01T00:00:00.000Z",
        "columns": [
          {
            "id": "<ID>",
            "name": "…",
            "kind": "TEXT",
            "displayOrder": 0,
            "tokenKey": "…",
            "options": [
              {
                "value": "…",
                "label": "…"
              }
            ]
          }
        ]
      }
    }
  }
}

Errors

Idempotency

Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →