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 FUNCTION_GATEWAY.


Echo​

Script type: FUNCTION_GATEWAY
Stability: beta
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": "FUNCTION_GATEWAY",
"scope": "OBJECT",
"trigger": ["MANUAL"],
"gateway": "Echo",
"parameters": [
{ "name": "greeting", "value": "hello" }
],
"targets": [
{ "name": "greeting", "actionType": "OVERWRITE" }
]
}

Ai​

Script type: FUNCTION_GATEWAY
Stability: stable
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": "FUNCTION_GATEWAY",
"scope": "OBJECT",
"trigger": ["MANUAL"],
"gateway": "Ai",
"parameters": [
{ "name": "generalInformation", "templateFile": "templates/contractText.hbs" },
{ "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: FUNCTION_GATEWAY
Stability: stable
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": "FUNCTION_GATEWAY",
"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" }
]
}

To make the result the object's class instead of a field value, name the candidate type keys after the classes (their singular REST names, e.g. intakeIncorporationDeed) and write documentType to the target _class:

"targets": [
{ "sourceName": "documentType", "name": "_class", "actionType": "OVERWRITE" }
]

The object's BASIC class then changes to the chosen class. _class is not a field; it is the only target name that is not.


MarkdownConversion​

Script type: FUNCTION_GATEWAY
Stability: beta
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": "FUNCTION_GATEWAY",
"scope": "OBJECT",
"trigger": ["CREATE"],
"gateway": "MarkdownConversion",
"parameters": [
{ "name": "file", "formula": "uploadedFile" }
],
"targets": [
{ "name": "markdownContent", "actionType": "OVERWRITE" },
{ "name": "pageCount", "actionType": "OVERWRITE" }
]
}

Invoice​

Script type: FUNCTION_GATEWAY
Stability: stable
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": "FUNCTION_GATEWAY",
"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: FUNCTION_GATEWAY
Stability: beta
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": "FUNCTION_GATEWAY",
"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: FUNCTION_GATEWAY
Stability: beta
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": "FUNCTION_GATEWAY",
"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: FUNCTION_GATEWAY
Stability: beta
Gateway name: CompanyRegister

Enriches a data object with company information from a national business register. Repeated lookups for the same registrationNumber within 24 hours are served from an internal cache rather than calling the register again — the object is always processed, so a corrected registration number is always re-verified. An invalid or unknown registration number does not fail the script — it completes with only validationMessage set, leaving any previously verified data on the object untouched, so a corrected number can always be re-verified without manual cleanup. Supports the same countries as CompanySearch.

Input parameters:

NameTypeRequiredDescription
registrationNumberTEXTYes*Company registration number. Tolerates a leading country-code prefix and separators (dots, spaces, dashes), which are stripped before the lookup.
countryCodeTEXTYes*ISO country code (see CompanySearch for supported countries)
keyTEXTYes*Composite key COUNTRY:registrationNumber (e.g. NL:12345678) — alternative to the two fields above

* 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
validationMessageTEXT

validationMessage is set instead of the other fields when the registration number could not be verified (see above); it's empty/absent on a normal successful lookup.

{
"name": "enrich-company",
"type": "FUNCTION_GATEWAY",
"scope": "OBJECT",
"trigger": ["MANUAL"],
"gateway": "CompanyRegister",
"parameters": [
{ "name": "registrationNumber", "formula": "kvkNumber" },
{ "name": "countryCode", "value": "NL" }
],
"targets": [
{ "name": "legalName", "actionType": "OVERWRITE" },
{ "name": "visitAddress", "actionType": "OVERWRITE" },
{ "name": "verificationDate", "actionType": "OVERWRITE" },
{ "name": "validationMessage", "actionType": "OVERWRITE" }
]
}

DataEnrichment​

Script type: FUNCTION_GATEWAY
Stability: beta
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": "FUNCTION_GATEWAY",
"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" }
]
}