Skip to main content

Gateway Scripts

Gateway scripts call external services registered with the platform. There are two kinds: consumer gateways (fire-and-forget) and function gateways (enrichment — they return data that is written back to the object).

Consumer Gateway

A consumer gateway calls an external service and does not return a result. Typical use cases: sending emails, triggering webhooks, posting notifications.

{
"name": "invite",
"type": "consumerGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "UserInvitation",
"parameters": [
{
"name": "email",
"dataType": "EMAIL",
"formula": "emailAddress"
},
{
"name": "subject",
"dataType": "TEXT",
"value": "Invitation to join"
},
{
"name": "message",
"dataType": "TEXT",
"templateFile": "templates/personInvitationMailText"
}
]
}
PropertyTypeDescription
gatewaystringThe name of the registered gateway to call.

Available consumer gateways depend on the platform configuration. Common ones include:

  • UserInvitation — sends an invitation email via SendGrid

Function Gateway

A function gateway calls an external service that returns structured data. The returned values are written back to the object's fields.

{
"name": "complete",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "OpenAI",
"parameters": [
{
"name": "generalInformation",
"templateFile": "templates/dossierAndDocuments"
},
{
"name": "jobTitle",
"value": "The job title if you can find it in the document"
},
{
"name": "activeDate",
"value": "The start date of the contract"
}
],
"targets": [
{
"name": "jobTitle",
"actionType": "OVERWRITE"
},
{
"name": "activeDate",
"actionType": "OVERWRITE"
}
]
}
PropertyTypeDescription
gatewaystringThe name of the registered enrichment function.
targetsTarget[]Fields to write the returned values to.

Targets

Each target maps a returned value to a field on the object:

PropertyTypeDescription
namestringThe field name to write to (must be a value type on the object).
actionTypeOVERWRITEHow to apply the returned value. Currently OVERWRITE replaces the existing value.

Available function gateways depend on the platform configuration. Common ones include:

  • OpenAI — extracts structured data from documents using GPT models
  • DocumentAI — processes documents using Google Cloud Document AI

Parameters and preconditions

Both gateway types support the same parameter and precondition system as other scripts. See Scripts Overview for the full reference.