previewWorkflowTableLookup
Call this before you say which row, or which value, a named contact, property, deal or appointment gets from a table.
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.
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.
A contact in the viewer's organization. Any other contact is refused.
A property id as the wire carries it (an esId).
A deal on a pipeline the viewer's organization can reach. Any other deal is refused.
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.
{
"data": {
"workflowAutomationsQuery": {
"previewWorkflowTableLookup": {
"key": "…",
"match": "KEY",
"rowId": "<ID>",
"rowKey": "…",
"rowKeyLabel": "…",
"missingSubjects": [
"CONTACT"
],
"values": [
{
"columnId": "<ID>",
"value": "…"
}
]
}
}
}
}Errors
unknown_variableA variable the operation does not declare. A typo is refused rather than silently dropped.
unauthorizedNo bearer header, or the key is invalid or revoked.
insufficient_scopeThe key lacks the scope the operation requires.
forbiddenA referenced record does not exist, was deleted, or is outside your organization. The gateway cannot tell those apart.
Behaviour
A read. It rejects an Idempotency-Key header with 400 bad_request.