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"
}
]
}
| Property | Type | Description |
|---|---|---|
gateway | string | The 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"
}
]
}
| Property | Type | Description |
|---|---|---|
gateway | string | The name of the registered enrichment function. |
targets | Target[] | Fields to write the returned values to. |
Targets
Each target maps a returned value to a field on the object:
| Property | Type | Description |
|---|---|---|
name | string | The field name to write to (must be a value type on the object). |
actionType | OVERWRITE | How 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 modelsDocumentAI— 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.