Vectry Event Subscription
Dispara la ejecución del workflow a partir de eventos internos del sistema (Event Bus).
Nodo de entrada para workflows impulsados por eventos. Reorganiza la entrada de la ejecución en { event_id, source, type, payload }; en esta versión no se suscribe al bus de eventos y sus filtros no se aplican.
Este trigger se suscribe al Vectry Causal Event Bus. Escucha eventos de negocio o del sistema concretos (p. ej., "Order Created", "User Signup") e inicia el workflow cuando ocurre un evento que coincide.
Características:
- Filtrado: Suscríbete solo a los eventos que cumplan criterios concretos (dominio, entidad, etiqueta).
- Reproducción: Procesa eventos históricos ("since") o solo los nuevos.
- Coincidencia de patrones: Dispara ante secuencias de eventos complejas (si está configurado).
Casos de uso:
- Enviar un correo de bienvenida cuando ocurre un evento 'UserCreated'.
- Auditar transacciones de alto valor.
Cómo funciona
- Qué lo inicia: en esta versión ningún componente del backend se suscribe al bus de eventos para este nodo. El workflow se ejecuta cuando se inicia de forma explícita (ejecución manual o solicitud de ejecución) con una entrada con forma de evento.
- Lee el ítem de entrada tal cual; la configuración del nodo no se lee ni se resuelve.
- Entrega
event_id(por defectounknown),source(por defectovectry),type(por defectounknown) ypayload: el campopayloadde la entrada si existe; si no, la entrada completa.
En un workflow
El nodo tal como aparece en un archivo de workflow (draft_nodes[]) y el envelope de una ejecución exitosa.
{
"node_id": "node-order-created",
"label": "Order created",
"operator_slug": "event.trigger",
"operator_version": "1.0.0",
"config": {
"filters": [
{
"system_domain": "sales",
"system_entity": "order",
"operation": "created"
}
],
"since": "now"
}
}{
"ok": true,
"data": {
"event_id": "evt_01JDX4Q8M2",
"source": "vectry",
"type": "order.created",
"payload": {
"order_id": "ord_123",
"total": 129.99,
"currency": "USD"
}
},
"port": "out"
}Configuración
-
filtersarray<object> Obligatorio -
Criterios de coincidencia de los eventos.
-
sincestring Opcional -
Marca de tiempo (ISO) o "now".
Su configuración muestra los ajustes de ejecución compartidos, pero este nodo aún no aplica reintentos (retryOnFail, maxTries). Ningún nodo aplica continueOnFail.
Comportamiento en el código
Lo que hace la implementación con estas claves más allá de lo que dice el esquema.
-
filters - Declarado y obligatorio en el esquema, pero no se lee: no se filtra ningún evento.
sincetampoco se lee.
Puertos de salida
out por defecto Siempre, salvo que ocurra una excepción inesperada.
{
"event_id": "evt_01JDX4Q8M2",
"source": "vectry",
"type": "order.created",
"payload": {
"order_id": "ord_123",
"total": 129.99,
"currency": "USD"
}
}error Solo ante una excepción inesperada al leer la entrada; la salida es { error, response }. No se alcanza en el uso normal.
{
"error": "<exception message>",
"response": null
}En expresiones
Lo que un nodo posterior puede leer de la salida de este nodo con $("Vectry Event Subscription").item.json.<ruta> (escribe la etiqueta de tu nodo en lugar de Vectry Event Subscription). Editor marca las rutas que sugiere el editor de workflows en Previous Nodes (el contrato de salida); Worker marca las rutas que el worker devuelve de verdad por out, según la salida que muestra Puertos.
| Expresión | Editor | Worker |
|---|---|---|
$("Vectry Event Subscription").item.json.event_id | ||
$("Vectry Event Subscription").item.json.source | ||
$("Vectry Event Subscription").item.json.type | ||
$("Vectry Event Subscription").item.json.payload | ||
$("Vectry Event Subscription").item.json.payload.order_id | — | |
$("Vectry Event Subscription").item.json.payload.total | — | |
$("Vectry Event Subscription").item.json.payload.currency | — |
— Worker: El worker la devuelve pero el editor no la sugiere: escríbela a mano. Las claves dentro de objetos pueden depender de tus datos o de la configuración (por ejemplo, una clave por etiqueta).
Contrato de salida
-
event_idstring Opcional -
sourcestring Opcional -
typestring Opcional -
payloadobject Opcional
Contratos (JSON Schema)
La definición exactamente como la declara el orquestador. All es el *.definition.js completo; compáralo con las secciones de arriba para ver diferencias entre la documentación y el esquema. Úsala para validar un nodo antes de publicar.
{
"slug": "event.trigger",
"name": "Vectry Event Subscription",
"category": "triggers",
"version": "1.0.0",
"description": "Trigger workflow execution based on internal system events (Event Bus).\n\n This trigger subscribes to the Vectry Causal Event Bus. It listens for specific business or system events (e.g., \"Order Created\", \"User Signup\") and initiates the workflow when a matching event occurs.\n\n **Features:**\n - **Filtering:** Subscribe only to events matching specific criteria (domain, entity, tag).\n - **Replay:** Process historical events (\"since\") or only new ones.\n - **Pattern Matching:** Trigger on complex event sequences (if configured).\n\n **Use Cases:**\n - Sending a Welcome Email when a 'UserCreated' event occurs.\n - Auditing high-value transactions.",
"capabilities": [
"event-subscription",
"internal-bus",
"pubsub",
"vectry"
],
"config_schema": {
"type": "object",
"required": [
"filters"
],
"properties": {
"filters": {
"type": "array",
"title": "Event Filters",
"description": "Match criteria for events.",
"items": {
"type": "object",
"properties": {
"system_domain": {
"type": "string",
"title": "Domain"
},
"system_entity": {
"type": "string",
"title": "Entity"
},
"operation": {
"type": "string",
"title": "Operation"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"since": {
"type": "string",
"title": "Start From",
"default": "now",
"description": "Timestamp (ISO) or \"now\"."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": null,
"output_contract_schema": {
"type": "object",
"description": "The event payload.",
"properties": {
"event_id": {
"type": "string"
},
"source": {
"type": "string"
},
"type": {
"type": "string"
},
"payload": {
"type": "object"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Event Received",
"is_default": true
},
{
"port_id": "error",
"label": "Error"
}
],
"execution_mode": "async",
"tags": [
"vectry",
"events",
"bus",
"reactive"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"required": [
"filters"
],
"properties": {
"filters": {
"type": "array",
"title": "Event Filters",
"description": "Match criteria for events.",
"items": {
"type": "object",
"properties": {
"system_domain": {
"type": "string",
"title": "Domain"
},
"system_entity": {
"type": "string",
"title": "Entity"
},
"operation": {
"type": "string",
"title": "Operation"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"since": {
"type": "string",
"title": "Start From",
"default": "now",
"description": "Timestamp (ISO) or \"now\"."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"description": "The event payload.",
"properties": {
"event_id": {
"type": "string"
},
"source": {
"type": "string"
},
"type": {
"type": "string"
},
"payload": {
"type": "object"
}
}
}[
{
"port_id": "out",
"label": "Event Received",
"is_default": true
},
{
"port_id": "error",
"label": "Error"
}
]Ejecución
- Ejecución
async- Con estado
- No
- Reintentos (
retryOnFail) - No
- Capacidades
event-subscriptioninternal-buspubsubvectry- Etiquetas
vectryeventsbusreactive
Notas y límites
- Usa este nodo como punto de entrada tipado: inicia el workflow con
{ event_id, source, type, payload }y lee los datos del evento más adelante en$json.payload. - Con datos de muestra el motor omite el nodo y entrega la entrada de muestra sin cambios por
out.
Revisado contra el código del orquestador · 31e874b · 2026-11-26