GoliathDevelopersGet an API key
Reference/Workflowsgenerated from the gateway manifest

previewWorkflowTableLookup

Call this before you say which row, or which value, a named contact, property, deal or appointment gets from a table.

POST/api/v1/callREADreadruns as the key's owner
View as Markdown

Call this before you say which row, or which value, a named contact, property, deal or appointment gets from a table: a county or key guessed from an address is not the answer. Which row of one Workflow Table a run on a record would use, and each column's value by columnId (names from getWorkflowTable): input takes workflowTableId and a contactId, propertyId, dealId or appointmentId, resolved exactly as a workflow run resolves it (fallback levels, ranges, composite keys). match DEFAULT means no key matched and the default row answered; NONE means nothing answered. missingSubjects names records the key needed and the record could not reach. Same gate as the rows.

curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "previewWorkflowTableLookup",
    "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.previewWorkflowTableLookup({
  input: {
    workflowTableId: '<workflowTableId>'
  }
})
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',
  },
  body: JSON.stringify({
    operationId: 'previewWorkflowTableLookup',
    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.

inputPreviewWorkflowTableLookupInput!required

The subject to resolve a Workflow Table against. At least one record is required. The lookup derives what a table's keys need from what is given, exactly as a run does: a property in hand wins for property-keyed tables, and a deal or appointment reaches its linked properties and contacts.

workflowTableIdID!required
contactIdID

A contact in the viewer's organization. Any other contact is refused.

propertyIdID

A property id as the wire carries it (an esId).

pipelineItemIdID

A deal on a pipeline the viewer's organization can reach. Any other deal is refused.

dealIdID
appointmentIdID

An appointment (a task) with a contact or deal of the viewer's organization. Any other is refused.

Response

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

response shape
{
  "data": {
    "workflowAutomationsQuery": {
      "previewWorkflowTableLookup": {
        "key": "…",
        "match": "KEY",
        "rowId": "<ID>",
        "rowKey": "…",
        "rowKeyLabel": "…",
        "missingSubjects": [
          "CONTACT"
        ],
        "values": [
          {
            "columnId": "<ID>",
            "value": "…"
          }
        ]
      }
    }
  }
}

Errors

Behaviour

A read. It rejects an Idempotency-Key header with 400 bad_request.