Skip to main content

Function Gateways

Function gateways enrich an object by returning structured data that is written back to the object's fields. Use script type functionGateway.


Echo

Script type: functionGateway
Gateway name: Echo

Reflects input parameters directly back as output. Useful for testing gateway wiring or passing computed formula values to target fields without making an external call.

Input: Any parameters — each input parameter is echoed back to the target field with the same name.

Output: One field per declared target, containing the value of the matching input parameter.

{
"name": "test-echo",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "Echo",
"parameters": [
{ "name": "greeting", "value": "hello" }
],
"targets": [
{ "name": "greeting", "actionType": "OVERWRITE" }
]
}

Ai

Script type: functionGateway
Gateway name: Ai

Extracts structured field values from free-form text using Gemini (Vertex AI). Each declared target becomes a typed field in the Gemini response schema. The model omits fields it cannot determine with confidence.

Input parameters:

NameTypeRequiredDescription
generalInformationTEXTYesSource text to extract data from
useProBOOLEANNoUse the Pro model instead of Flash (default: false)
<targetName>TEXTPer targetExtraction instruction for that target field (e.g. "The invoice total amount")

Output: One field per declared target, typed according to the target's dataType. Three meta-fields are also available if declared as targets:

NameTypeDescription
inputTokensINTEGERPrompt token count
outputTokensINTEGERResponse token count
estimatedCostCURRENCYEstimated API cost
{
"name": "extract-contract",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "Ai",
"parameters": [
{ "name": "generalInformation", "templateFile": "templates/contractText" },
{ "name": "jobTitle", "value": "The job title, if mentioned" },
{ "name": "startDate", "value": "The contract start date" }
],
"targets": [
{ "name": "jobTitle", "actionType": "OVERWRITE" },
{ "name": "startDate", "actionType": "OVERWRITE" }
]
}

See AI Integrations for model configuration.


DocumentTriage

Script type: functionGateway
Gateway name: DocumentTriage

Classifies an uploaded document into one of a set of candidate types and generates a concise title. Uses Gemini Flash on the first 10,000 characters of the document's Markdown content. The type unknown is always available as a fallback when the model cannot classify with confidence.

Input parameters:

NameTypeRequiredDescription
markdownContentLONGTEXTYesMarkdown content of the document (produced by MarkdownConversion)
<typeKey>TEXTAt least oneA candidate type key (e.g. incorporation.deed) with a short Dutch description as value

Output:

NameTypeDescription
documentTypeTEXTOne of the provided type keys, or unknown
titleTEXTConcise Dutch document title generated by the model
{
"name": "triage-document",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "DocumentTriage",
"parameters": [
{ "name": "markdownContent", "formula": "markdownContent" },
{ "name": "incorporation.deed", "value": "Notariële akte van oprichting" },
{ "name": "annual.report", "value": "Jaarverslag of jaarrekening" }
],
"targets": [
{ "name": "documentType", "actionType": "OVERWRITE" },
{ "name": "title", "actionType": "OVERWRITE" }
]
}

MarkdownConversion

Script type: functionGateway
Gateway name: MarkdownConversion

Converts an uploaded PDF to Markdown using Google Document AI's Layout Processor. The result is typically passed to DocumentTriage or Ai for further processing.

Input parameters:

NameTypeRequiredDescription
fileFILEYesThe uploaded PDF binary

Output:

NameTypeDescription
markdownContentLONGTEXTMarkdown representation of the document
statusTEXTREADY on success, ERROR on failure
pageCountINTEGERNumber of pages processed
{
"name": "convert-pdf",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "CREATE",
"gateway": "MarkdownConversion",
"parameters": [
{ "name": "file", "formula": "uploadedFile" }
],
"targets": [
{ "name": "markdownContent", "actionType": "OVERWRITE" },
{ "name": "pageCount", "actionType": "OVERWRITE" }
]
}

Invoice

Script type: functionGateway
Gateway name: Invoice

Extracts structured invoice data from an uploaded PDF using Google Document AI's Invoice Processor. Currency amounts are returned as typed CURRENCY values in the document's detected currency.

Input parameters:

NameTypeRequiredDescription
fileFILEYesThe uploaded invoice PDF

Output: Structured invoice fields as returned by Document AI's Invoice Processor. Currency fields (e.g. amount, amountDue, taxAmount) are typed as CURRENCY.

{
"name": "process-invoice",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "CREATE",
"gateway": "Invoice",
"parameters": [
{ "name": "file", "formula": "invoiceFile" }
],
"targets": [
{ "name": "amount", "actionType": "OVERWRITE" },
{ "name": "amountDue", "actionType": "OVERWRITE" },
{ "name": "taxAmount", "actionType": "OVERWRITE" }
]
}

AddressSearch

Script type: functionGateway
Gateway name: AddressSearch

Looks up a Dutch address by postal code and house number via the webservices.nl API. Results are cached for 30 days per unique input combination.

Input parameters:

NameTypeRequiredDescription
postalCodeTEXTYesDutch postal code (e.g. 1234AB, spaces allowed)
houseNumberINTEGERYesHouse number
houseNumberAdditionTEXTNoHouse number addition (e.g. A, bis)

Output:

NameTypeDescription
postalCodeTEXTNormalised postal code (e.g. 1234AB)
streetNameTEXTStreet name
houseNumberTEXTHouse number
houseNumberAdditionTEXTAddition, if present
addressTEXTFull formatted address line
cityTEXTCity name
municipalityTEXTMunicipality name
provinceTEXTProvince name
{
"name": "lookup-address",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "AddressSearch",
"parameters": [
{ "name": "postalCode", "formula": "postalCode" },
{ "name": "houseNumber", "formula": "houseNumber" }
],
"targets": [
{ "name": "streetName", "actionType": "OVERWRITE" },
{ "name": "city", "actionType": "OVERWRITE" }
]
}

CompanyExtract

Script type: functionGateway
Gateway name: CompanyExtract

Fetches an official company extract PDF via webservices.nl and stores it as a binary file. Currently available for NL only. Cached for 7 days per registration number.

Input parameters:

NameTypeRequiredDescription
countryCodeTEXTYesISO country code. Currently only NL is supported.
registrationNumberTEXTYes8-digit KvK registration number

Output:

NameTypeDescription
uriTEXTBinary URI of the stored PDF (/binaries/{uuid}), usable directly as a FILE field value
referenceDateDATEReference date on the extract (yyyy-MM-dd)
{
"name": "fetch-company-extract",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "CompanyExtract",
"parameters": [
{ "name": "countryCode", "value": "NL" },
{ "name": "registrationNumber", "formula": "kvkNumber" }
],
"targets": [
{ "name": "extractFile", "actionType": "OVERWRITE" },
{ "name": "extractDate", "actionType": "OVERWRITE" }
]
}

CompanyRegister

Script type: functionGateway
Gateway name: CompanyRegister

Enriches a data object with company information from a national business register. Skips the lookup if verificationDate is less than 24 hours ago to prevent redundant API calls. Supports the same countries as CompanySearch.

Input parameters:

NameTypeRequiredDescription
registrationNumberTEXTYes*Company registration number
countryCodeTEXTYes*ISO country code (see CompanySearch for supported countries)
keyTEXTYes*Composite key COUNTRY:registrationNumber (e.g. NL:12345678) — alternative to the two fields above
verificationDateDATETIMENoIf set and within 24 hours, the lookup is skipped

* Either key or both registrationNumber + countryCode must be provided.

Output:

NameType
registrationNumberTEXT
legalNameTEXT
registrationDateDATE
startDateDATE
endDateDATE
noMailingBOOLEAN
totalEmployeesINTEGER
rsinTEXT
legalFormTEXT
legalFormExtendedTEXT
primaryActivityCodeTEXT
primaryActivityDescriptionTEXT
visitAddressTEXT
visitPostalCodeTEXT
visitCityTEXT
mailingAddressTEXT
mailingPostalCodeTEXT
mailingCityTEXT
verificationDateDATETIME
{
"name": "enrich-company",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "CompanyRegister",
"parameters": [
{ "name": "registrationNumber", "formula": "kvkNumber" },
{ "name": "countryCode", "value": "NL" },
{ "name": "verificationDate", "formula": "verificationDate" }
],
"targets": [
{ "name": "legalName", "actionType": "OVERWRITE" },
{ "name": "visitAddress", "actionType": "OVERWRITE" },
{ "name": "verificationDate", "actionType": "OVERWRITE" }
]
}

DataEnrichment

Script type: functionGateway
Gateway name: DataEnrichment

POSTs the current data object's field values to a configurable HTTPS endpoint and merges the JSON response back into the data object. Only HTTPS endpoints are accepted.

Input parameters:

NameTypeRequiredDescription
_apiEndpointHYPERLINKYesThe HTTPS endpoint to POST to
_header_<name>TEXTNoAdditional request headers (e.g. _header_Authorization)
<fieldName>anyNoAny non-_ parameter is included in the request body

Output: The JSON object returned by the endpoint, merged directly into the declared targets.

{
"name": "enrich-external",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "DataEnrichment",
"parameters": [
{ "name": "_apiEndpoint", "value": "https://api.example.com/enrich" },
{ "name": "_header_Authorization", "formula": "concat(\"Bearer \", apiToken)" },
{ "name": "companyId", "formula": "externalId" }
],
"targets": [
{ "name": "enrichedStatus", "actionType": "OVERWRITE" }
]
}