Handoff to Sommatic App
Nodo terminal: entrega el resultado de un workflow terminado a una Sommatic AI App.
Entrega final: crea una tarea para un usuario con un descriptor de apertura de app (slug, ruta, entrada, modo de apertura) y devuelve el descriptor para que el resultado de la ejecución pueda abrir la app.
Cómo funciona
- Resuelve la configuración y la combina sobre el payload de entrada (gana la configuración); los
{{ }}deinput_mappingse resuelven en el servidor. - Arma el descriptor:
app_slugdetarget.app_slug,route_pathdetarget.route(por defecto/),launch_modedetarget.launch_mode(por defectocommand-center) einput_payloaddeinput_mapping(por defecto{}). - Comprueba
app_slug,organization_id,assigneeytask_title. - Envía una tarea con un responsable de tipo usuario, estado
queued,sourceworkflowymetadata.app_handoff_descriptor; el backend la reclama para esa persona.task_typevalereviewytask_prioritymediumpor defecto. - Devuelve
{ app_handoff_descriptor, task_id, task_title }en el nivel superior porout, donde el resultado de la ejecución puede tomar el descriptor; abrir la tarea después vuelve a lanzar la app con los datos cargados.
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-handoff-approval",
"label": "Hand off to approval desk",
"operator_slug": "sommatic.app.handoff",
"operator_version": "1.0.0",
"config": {
"target": {
"app_slug": "sommatic-approval-desk",
"route": "/",
"launch_mode": "command-center"
},
"input_mapping": {
"order_id": "{{ $json.order_id }}",
"amount": "{{ $json.amount }}"
},
"organization_id": "<organization_id>",
"assignee": "approver@example.com",
"task_title": "Approve order {{ $json.order_id }}"
}
}{
"ok": true,
"port": "out",
"app_handoff_descriptor": {
"app_slug": "sommatic-approval-desk",
"route_path": "/",
"input_payload": {
"order_id": "ord_123",
"amount": 1250
},
"launch_mode": "command-center"
},
"task_id": "task-xxxxxxxxxxxxxxx",
"task_title": "Approve order ord_123"
}Configuración
-
targetobject Obligatorio -
-
app_slugstring Obligatorio -
Slug de la Sommatic AI App que recibe la entrega (p. ej. my-review-app).
-
routestring Opcional -
Ruta que se abre dentro de la app (p. ej. /new-sentence). De forma predeterminada, /.
-
launch_modestring Opcional -
Cómo se abre la app cuando hay una sesión activa.
-
-
input_mappingobject Opcional -
Payload que se precarga en la app, resuelto en el servidor a partir de expresiones {{...}}.
-
organization_idstring Obligatorio -
Organización dueña de la tarea creada.
-
assigneestring Obligatorio -
Identidad (correo) a la que se asigna la tarea.
-
task_titlestring Obligatorio -
Título de la tarea HITL persistente que se crea para la entrega.
-
task_typeobject Opcional -
Descriptor del tipo de tarea. De forma predeterminada, review.
-
task_priorityobject Opcional -
Descriptor de la prioridad de la tarea. De forma predeterminada, medium.
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.
-
task_type - El objeto por defecto es
{ id: 1, name: "review", title: "Review" }, mientras que el catálogo del backend listareviewcon id 12. Definetask_typede forma explícita si tu bandeja filtra por id. -
target - También se leen alternativas no declaradas en el nivel superior:
app_slug,route,launch_mode,input_payload,title,typeypriority.
Puertos de salida
out por defecto La tarea se creó. La ejecución debería terminar aquí; no se suspende.
{
"port": "out",
"app_handoff_descriptor": {
"app_slug": "sommatic-approval-desk",
"route_path": "/",
"input_payload": {
"order_id": "ord_123",
"amount": 1250
},
"launch_mode": "command-center"
},
"task_id": "task-xxxxxxxxxxxxxxx",
"task_title": "Approve order ord_123"
}error Falta un campo obligatorio o la llamada al backend falló.
{
"port": "error",
"error": "Missing 'assignee'"
}En expresiones
Lo que un nodo posterior puede leer de la salida de este nodo con $("Handoff to Sommatic App").item.json.<ruta> (escribe la etiqueta de tu nodo en lugar de Handoff to Sommatic App). 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 |
|---|---|---|
$("Handoff to Sommatic App").item.json.app_handoff_descriptor | ||
$("Handoff to Sommatic App").item.json.task_id | ||
$("Handoff to Sommatic App").item.json.task_title | ||
$("Handoff to Sommatic App").item.json.port | — | |
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.app_slug | — | |
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.route_path | — | |
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.input_payload | — | |
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.launch_mode | — |
— 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).
Errores
| Mensaje | Puerto | Causa y solución |
|---|---|---|
Missing 'target.app_slug' | error | No hay target.app_slug (ni un app_slug en el nivel superior). |
Missing 'organization_id' | error | No está en la configuración ni en el payload. |
Missing 'assignee' | error | La entrega siempre necesita una identidad de usuario (correo). |
Missing 'task_title' | error | task_title (o title) está vacío. |
Backend did not return a task id | error | El backend respondió sin result.id. |
Request failed with status code <status> | error | El backend rechazó la tarea. |
services.apiManager.uri is not resolved in dependencies.config — check Link Loom Cloud environment config. | error | El orquestador no tiene configurada la dirección del backend. Es un problema de configuración del servicio, no del nodo. |
Contrato de entrada
-
targetobject Opcional -
input_mappingobject Opcional -
organization_idstring Opcional -
assigneestring Opcional -
task_titlestring Opcional
Contrato de salida
-
app_handoff_descriptorobject Opcional -
task_idstring Opcional -
task_titlestring 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": "sommatic.app.handoff",
"name": "Handoff to Sommatic App",
"category": "hitl",
"version": "1.0.0",
"description": "Terminal node: hands a finished workflow's result to a Sommatic AI App. Creates a durable HITL Task carrying the open descriptor and, if a live Command Center session is subscribed, opens the app instantly. Symmetric counterpart of sommatic.app.execute (app-as-gate); this is app-as-terminal — the workflow ends and does not resume.",
"capabilities": [
"ui",
"human",
"terminal"
],
"config_schema": {
"type": "object",
"required": [
"target",
"organization_id",
"assignee",
"task_title"
],
"properties": {
"target": {
"type": "object",
"title": "Target App",
"required": [
"app_slug"
],
"properties": {
"app_slug": {
"type": "string",
"title": "App Slug",
"description": "Slug of the Sommatic AI App to hand off to (e.g. my-review-app)."
},
"route": {
"type": "string",
"title": "Route Path",
"description": "Route opened inside the app (e.g. /new-sentence). Defaults to /.",
"default": "/"
},
"launch_mode": {
"type": "string",
"title": "Launch Mode",
"description": "How the app is opened when a live session exists.",
"default": "command-center"
}
}
},
"input_mapping": {
"type": "object",
"title": "Input Payload",
"description": "Payload pre-filled into the app, resolved server-side from {{...}} expressions."
},
"organization_id": {
"type": "string",
"title": "Organization",
"description": "Organization that owns the created Task."
},
"assignee": {
"type": "string",
"title": "Assignee",
"ui_widget": "user_picker",
"description": "Identity (email) the Task is assigned to."
},
"task_title": {
"type": "string",
"title": "Task Title",
"description": "Title of the durable HITL Task created for the handoff."
},
"task_type": {
"type": "object",
"title": "Task Type",
"description": "Task type descriptor. Defaults to review."
},
"task_priority": {
"type": "object",
"title": "Task Priority",
"description": "Task priority descriptor. Defaults to medium."
},
"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": {
"type": "object",
"properties": {
"target": {
"type": "object"
},
"input_mapping": {
"type": "object"
},
"organization_id": {
"type": "string"
},
"assignee": {
"type": "string"
},
"task_title": {
"type": "string"
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"app_handoff_descriptor": {
"type": "object"
},
"task_id": {
"type": "string"
},
"task_title": {
"type": "string"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Out",
"is_default": true,
"description": "Handoff delivered (Task created; app opened if live session)."
},
{
"port_id": "error",
"label": "Error"
}
],
"execution_mode": "sync",
"tags": [
"ui",
"terminal",
"handoff"
],
"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": [
"target",
"organization_id",
"assignee",
"task_title"
],
"properties": {
"target": {
"type": "object",
"title": "Target App",
"required": [
"app_slug"
],
"properties": {
"app_slug": {
"type": "string",
"title": "App Slug",
"description": "Slug of the Sommatic AI App to hand off to (e.g. my-review-app)."
},
"route": {
"type": "string",
"title": "Route Path",
"description": "Route opened inside the app (e.g. /new-sentence). Defaults to /.",
"default": "/"
},
"launch_mode": {
"type": "string",
"title": "Launch Mode",
"description": "How the app is opened when a live session exists.",
"default": "command-center"
}
}
},
"input_mapping": {
"type": "object",
"title": "Input Payload",
"description": "Payload pre-filled into the app, resolved server-side from {{...}} expressions."
},
"organization_id": {
"type": "string",
"title": "Organization",
"description": "Organization that owns the created Task."
},
"assignee": {
"type": "string",
"title": "Assignee",
"ui_widget": "user_picker",
"description": "Identity (email) the Task is assigned to."
},
"task_title": {
"type": "string",
"title": "Task Title",
"description": "Title of the durable HITL Task created for the handoff."
},
"task_type": {
"type": "object",
"title": "Task Type",
"description": "Task type descriptor. Defaults to review."
},
"task_priority": {
"type": "object",
"title": "Task Priority",
"description": "Task priority descriptor. Defaults to medium."
},
"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",
"properties": {
"target": {
"type": "object"
},
"input_mapping": {
"type": "object"
},
"organization_id": {
"type": "string"
},
"assignee": {
"type": "string"
},
"task_title": {
"type": "string"
}
}
}{
"type": "object",
"properties": {
"app_handoff_descriptor": {
"type": "object"
},
"task_id": {
"type": "string"
},
"task_title": {
"type": "string"
}
}
}[
{
"port_id": "out",
"label": "Out",
"is_default": true,
"description": "Handoff delivered (Task created; app opened if live session)."
},
{
"port_id": "error",
"label": "Error"
}
]Ejecución
- Ejecución
sync- Con estado
- No
- Reintentos (
retryOnFail) - No
- Capacidades
uihumanterminal- Etiquetas
uiterminalhandoff
Notas y límites
- No se suspende ni espera: lo que esté conectado a
outse ejecuta enseguida. Úsalo como último nodo de la ejecución. - El
context.workflow_instance_idy elcontext.trace_idde la tarea se envían vacíos: el worker los lee de campos que el entorno de ejecución no define, así que la tarea no queda vinculada a la ejecución. - No es idempotente: cada ejecución crea una tarea nueva. La llamada HTTP no tiene reintentos.
- El worker devuelve sus campos en el nivel superior del sobre, sin
data, así que el motor usa el sobre completo (incluida la claveport) como payload del siguiente nodo. - El worker no define
ok(el ejemplo muestratrue); el motor enruta solo porport.
Revisado contra el código del orquestador · 31e874b · 2026-11-26