Create Task
Crea una tarea humana en el sistema de Work Management.
Crea una tarea de Work Management en el backend de Sommatic AI y continúa de inmediato por created; la ejecución no espera a la persona.
Cómo funciona
- Resuelve la configuración y la combina sobre el payload de entrada: cada campo puede venir de la configuración o de la misma clave del payload (gana la configuración).
- Comprueba
organization_id,title,type.nameypriority.name. - Elige los valores de modo doble: el responsable de
assignee(assignee_modespecific_user) oassignee_custom(custom); el proyecto deproject_id(picker) oproject_id_expression(expression); la fecha límite dedue_at(picker) odue_at_expression(expression). - Arma
sla: una fecha límite (ISO 8601 o milisegundos epoch) se convierte en{ due_at: "<epoch ms>", sla_ms: <due - now>, is_overdue }; unsla_msconfigurado reemplaza al calculado; una fecha que no se puede interpretar se guarda tal cual. - Arma la tarea con
statusqueued,sourceworkflow, el responsable como{ assignee_type: "user", user: { identity, profile: { primary_email_address: identity } } }(onull),payload{ summary, evidence, linked_entities },required_output,outputsycontext.reminders. - La envía a la API de tareas de Work Management del backend. Con un responsable de tipo usuario, el backend reclama la tarea para esa persona (estado
claimed); sin él, quedaqueued, acotada porproject_id. - Devuelve
{ task_id, task_title, task_type, has_hag, status }porcreated.
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-review-refund",
"label": "Review refund",
"operator_slug": "human.task.create",
"operator_version": "1.0.0",
"config": {
"organization_id": "<organization_id>",
"title": "Review refund for {{ $json.order_id }}",
"description": "Customer requested a refund of {{ $json.amount }}.",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"assignee_mode": "specific_user",
"assignee": "[email protected]",
"due_at_mode": "expression",
"due_at_expression": "{{ $now.plus({ days: 2 }).toISO() }}",
"reminders": true,
"payload": {
"summary": "Refund request for {{ $json.order_id }}",
"evidence": [],
"linked_entities": []
},
"has_hag": true
}
}{
"ok": true,
"port": "created",
"task_id": "task-xxxxxxxxxxxxxxx",
"task_title": "Review refund for ord_123",
"task_type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"has_hag": true,
"status": {
"id": 5,
"name": "claimed",
"title": "Claimed",
"color": "#5e35b1"
}
}Configuración
-
organization_idstring Obligatorio -
ID de la organización dueña de esta tarea
-
titlestring Obligatorio Acepta expresiones -
Resumen breve. Admite expresiones como {{ $json.title }}.
-
descriptionstring Opcional Acepta expresiones -
Instrucciones detalladas para la persona asignada. Admite expresiones y texto de varias líneas.
-
typeobject Obligatorio -
Aprobación | Completar datos | Revisión | Resolución | Delegación
-
priorityobject Obligatorio -
project_modestring Opcional -
Selector: elige un proyecto. Expresión: obtén el id del proyecto de forma dinámica (p. ej., según el buzón de entrada).
-
project_idstring Opcional -
Proyecto al que pertenece esta tarea (define su visibilidad y agrupación).
-
project_id_expressionstring Opcional Acepta expresiones -
Devuelve una cadena con el id del proyecto. Ejemplo: {{ $json.project_id }}.
-
assignee_modestring Opcional -
Usuario específico: elige a alguien de tu organización. Personalizado: indica una identidad o una expresión.
-
assigneestring Opcional -
Usuario único al que se asignará la tarea
-
assignee_customstring Opcional Acepta expresiones -
Usa {{ $json.user_id }} o una cadena de identidad literal.
-
due_at_modestring Opcional -
due_atstring Opcional -
Se guarda como cadena en milisegundos Unix.
-
due_at_expressionstring Opcional Acepta expresiones -
Devuelve ISO 8601 o milisegundos Unix. Ejemplo: {{ $now.plus({days: 3}).toISO() }}
-
sla_msinteger Opcional -
Opcional. Tiempo disponible para completar la tarea una vez asignada.
-
remindersboolean Opcional -
required_outputobject Opcional -
JSON Schema que describe los datos que la persona asignada debe entregar al completar la tarea, junto con indicaciones de UI para renderizar el formulario.
-
outputsobject Opcional -
Opcional. Respuesta de esquema libre que ya produjo un nodo anterior (p. ej., un clasificador o un resolutor) y que la persona solo verifica, edita o rechaza. Corresponde a Task.outputs. Es distinto de "Payload" (que es el contexto para el operador: summary + evidence + linked_entities).
-
payloadobject Opcional -
Resumen, bloques de evidencia y entidades vinculadas que recibe la persona asignada como contexto.
-
has_hagboolean Opcional -
Requiere un nodo Human Approval Gate posterior.
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.
-
type - Un objeto
{ id, name, title, color }del catálogo del backend:approval(10),data_completion(11),review(12),resolution(13),delegation(14). El worker solo comprueba que existaname. -
priority - Un objeto del catálogo
low(1),medium(2),high(3),critical(4). -
assignee - Una identidad de usuario; también se guarda como correo principal, así que usa la identidad de correo. Solo se crean responsables de tipo usuario: este nodo no admite grupos.
-
payload - Solo se conservan
summary,evidence(arreglo) ylinked_entities(arreglo). Sipayloadno está configurado, esas claves se leen del payload de entrada. También se leen los alias heredadostask_payload,task_required_outputytask_outputs. -
has_hag - Solo se repite en la salida. El editor exige un
human.approval.gatejusto después del nodo cuando es true.
Puertos de salida
created por defecto El backend devolvió un id de tarea. status es el objeto de estado que devolvió el backend.
{
"port": "created",
"task_id": "task-xxxxxxxxxxxxxxx",
"task_title": "Review refund for ord_123",
"task_type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"has_hag": true,
"status": {
"id": 5,
"name": "claimed",
"title": "Claimed",
"color": "#5e35b1"
}
}error Falta un campo obligatorio o la llamada al backend falló.
{
"port": "error",
"error": "Missing 'title'"
}En expresiones
Lo que un nodo posterior puede leer de la salida de este nodo con $("Create Task").item.json.<ruta> (escribe la etiqueta de tu nodo en lugar de Create Task). 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 created, según la salida que muestra Puertos.
| Expresión | Editor | Worker |
|---|---|---|
$("Create Task").item.json.task_id | ||
$("Create Task").item.json.task_title | ||
$("Create Task").item.json.task_type | ||
$("Create Task").item.json.has_hag | ||
$("Create Task").item.json.status | ||
$("Create Task").item.json.port | — | |
$("Create Task").item.json.task_type.id | — | |
$("Create Task").item.json.task_type.name | — | |
$("Create Task").item.json.task_type.title | — | |
$("Create Task").item.json.task_type.color | — | |
$("Create Task").item.json.status.id | — | |
$("Create Task").item.json.status.name | — | |
$("Create Task").item.json.status.title | — | |
$("Create Task").item.json.status.color | — |
— 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 'organization_id' | error | No está en la configuración ni en el payload. No se toma de la identidad de la ejecución. |
Missing 'title' | error | title queda vacío tras resolver las expresiones. |
Missing 'type' or invalid type object | error | type falta o no tiene name. |
Missing 'priority' or invalid priority object | error | priority falta o no tiene name. |
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
-
organization_idstring Opcional -
titlestring Opcional -
descriptionstring Opcional -
typeobject Opcional -
priorityobject Opcional -
project_modestring Opcional -
project_idstring Opcional -
project_id_expressionstring Opcional -
assignee_modestring Opcional -
assigneestring Opcional -
assignee_customstring Opcional -
due_at_modestring Opcional -
due_atstring Opcional -
due_at_expressionstring Opcional -
sla_msinteger Opcional -
remindersboolean Opcional -
required_outputobject Opcional -
outputsobject Opcional -
payloadobject Opcional -
has_hagboolean Opcional
Contrato de salida
-
task_idstring Opcional -
task_titlestring Opcional -
task_typeobject Opcional -
has_hagboolean Opcional -
statusstring 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": "human.task.create",
"name": "Create Task",
"category": "hitl",
"version": "1.0.0",
"description": "Creates a human task in the Work Management system.",
"capabilities": [
"task",
"human",
"workflow"
],
"config_schema": {
"type": "object",
"required": [
"title",
"organization_id",
"type",
"priority"
],
"properties": {
"organization_id": {
"type": "string",
"title": "Organization",
"description": "Organization ID that owns this task",
"default_from": "auth.organization_id"
},
"title": {
"type": "string",
"title": "Task Title",
"format": "expression",
"description": "Short summary. Supports expressions like {{ $json.title }}."
},
"description": {
"type": "string",
"title": "Description",
"format": "expression",
"description": "Detailed instructions for the assignee. Supports expressions and multi-line text."
},
"type": {
"type": "object",
"title": "Task Type",
"ui_widget": "task_type_picker",
"description": "Approval | Data Completion | Review | Resolution | Delegation"
},
"priority": {
"type": "object",
"title": "Priority",
"ui_widget": "task_priority_picker",
"default": {
"id": 2,
"name": "medium",
"title": "Medium",
"color": "#1976d2"
}
},
"project_mode": {
"type": "string",
"title": "Project mode",
"enum": [
"picker",
"expression"
],
"default": "picker",
"description": "Picker: select a project. Expression: derive the project id dynamically (e.g. by ingress mailbox)."
},
"project_id": {
"type": "string",
"title": "Project",
"ui_widget": "project_picker",
"description": "Project this task belongs to (scopes visibility and grouping).",
"displayOptions": {
"show": {
"project_mode": [
"picker"
]
}
}
},
"project_id_expression": {
"type": "string",
"title": "Project id expression",
"format": "expression",
"description": "Return a project id string. Example: {{ $json.project_id }}.",
"displayOptions": {
"show": {
"project_mode": [
"expression"
]
}
}
},
"assignee_mode": {
"type": "string",
"title": "Assignee mode",
"enum": [
"specific_user",
"custom"
],
"default": "specific_user",
"description": "Specific User: pick from your organization. Custom: provide an identity or expression."
},
"assignee": {
"type": "string",
"title": "User",
"ui_widget": "user_picker",
"ui_options": {
"allow_assign_to_me": true
},
"description": "Single user the task will be assigned to",
"displayOptions": {
"show": {
"assignee_mode": [
"specific_user"
]
}
}
},
"assignee_custom": {
"type": "string",
"title": "Custom assignee (identity or expression)",
"format": "expression",
"description": "Use {{ $json.user_id }} or a literal identity string.",
"displayOptions": {
"show": {
"assignee_mode": [
"custom"
]
}
}
},
"due_at_mode": {
"type": "string",
"title": "Due date source",
"enum": [
"picker",
"expression"
],
"default": "picker"
},
"due_at": {
"type": "string",
"title": "Due Date",
"format": "date-time",
"description": "Stored as Unix milliseconds string.",
"displayOptions": {
"show": {
"due_at_mode": [
"picker"
]
}
}
},
"due_at_expression": {
"type": "string",
"title": "Due date expression",
"format": "expression",
"description": "Return ISO 8601 or Unix millis. Example: {{ $now.plus({days: 3}).toISO() }}",
"displayOptions": {
"show": {
"due_at_mode": [
"expression"
]
}
}
},
"sla_ms": {
"type": "integer",
"title": "SLA duration (ms)",
"description": "Optional. Time allowed to complete the task once assigned.",
"default": 86400000
},
"reminders": {
"type": "boolean",
"title": "Enable Reminders",
"default": true
},
"required_output": {
"type": "object",
"title": "Required Output",
"description": "JSON Schema describing the data the assignee must provide on completion, plus UI hints for rendering the form."
},
"outputs": {
"type": "object",
"title": "Pre-computed Outputs",
"description": "Optional. Free-schema answer already produced by an upstream node (e.g. classifier or resolver) that the human merely verifies, edits, or rejects. Maps to Task.outputs. Distinct from \"Payload\" (which is the operator-facing context: summary + evidence + linked_entities)."
},
"payload": {
"type": "object",
"title": "Payload",
"description": "Summary, evidence blocks and linked entities passed to the assignee for context."
},
"has_hag": {
"type": "boolean",
"title": "Has Human Approval",
"description": "Requires a downstream Human Approval Gate node.",
"default": false
},
"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": {
"organization_id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "object"
},
"priority": {
"type": "object"
},
"project_mode": {
"type": "string"
},
"project_id": {
"type": "string"
},
"project_id_expression": {
"type": "string"
},
"assignee_mode": {
"type": "string"
},
"assignee": {
"type": "string"
},
"assignee_custom": {
"type": "string"
},
"due_at_mode": {
"type": "string"
},
"due_at": {
"type": "string"
},
"due_at_expression": {
"type": "string"
},
"sla_ms": {
"type": "integer"
},
"reminders": {
"type": "boolean"
},
"required_output": {
"type": "object"
},
"outputs": {
"type": "object"
},
"payload": {
"type": "object"
},
"has_hag": {
"type": "boolean"
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"task_id": {
"type": "string"
},
"task_title": {
"type": "string"
},
"task_type": {
"type": "object"
},
"has_hag": {
"type": "boolean"
},
"status": {
"type": "string"
}
}
},
"ports": [
{
"port_id": "created",
"label": "Created",
"is_default": true,
"description": "Task successfully created"
},
{
"port_id": "error",
"label": "Error"
}
],
"chain_constraints": {
"next": [
{
"when": {
"has_hag": true
},
"required_slug": "human.approval.gate",
"message": "When \"Has Human Approval\" is checked, this node must be followed by a Human Approval Gate node."
}
]
},
"execution_mode": "async",
"tags": [
"human",
"task",
"management"
],
"is_stateful": true,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"required": [
"title",
"organization_id",
"type",
"priority"
],
"properties": {
"organization_id": {
"type": "string",
"title": "Organization",
"description": "Organization ID that owns this task",
"default_from": "auth.organization_id"
},
"title": {
"type": "string",
"title": "Task Title",
"format": "expression",
"description": "Short summary. Supports expressions like {{ $json.title }}."
},
"description": {
"type": "string",
"title": "Description",
"format": "expression",
"description": "Detailed instructions for the assignee. Supports expressions and multi-line text."
},
"type": {
"type": "object",
"title": "Task Type",
"ui_widget": "task_type_picker",
"description": "Approval | Data Completion | Review | Resolution | Delegation"
},
"priority": {
"type": "object",
"title": "Priority",
"ui_widget": "task_priority_picker",
"default": {
"id": 2,
"name": "medium",
"title": "Medium",
"color": "#1976d2"
}
},
"project_mode": {
"type": "string",
"title": "Project mode",
"enum": [
"picker",
"expression"
],
"default": "picker",
"description": "Picker: select a project. Expression: derive the project id dynamically (e.g. by ingress mailbox)."
},
"project_id": {
"type": "string",
"title": "Project",
"ui_widget": "project_picker",
"description": "Project this task belongs to (scopes visibility and grouping).",
"displayOptions": {
"show": {
"project_mode": [
"picker"
]
}
}
},
"project_id_expression": {
"type": "string",
"title": "Project id expression",
"format": "expression",
"description": "Return a project id string. Example: {{ $json.project_id }}.",
"displayOptions": {
"show": {
"project_mode": [
"expression"
]
}
}
},
"assignee_mode": {
"type": "string",
"title": "Assignee mode",
"enum": [
"specific_user",
"custom"
],
"default": "specific_user",
"description": "Specific User: pick from your organization. Custom: provide an identity or expression."
},
"assignee": {
"type": "string",
"title": "User",
"ui_widget": "user_picker",
"ui_options": {
"allow_assign_to_me": true
},
"description": "Single user the task will be assigned to",
"displayOptions": {
"show": {
"assignee_mode": [
"specific_user"
]
}
}
},
"assignee_custom": {
"type": "string",
"title": "Custom assignee (identity or expression)",
"format": "expression",
"description": "Use {{ $json.user_id }} or a literal identity string.",
"displayOptions": {
"show": {
"assignee_mode": [
"custom"
]
}
}
},
"due_at_mode": {
"type": "string",
"title": "Due date source",
"enum": [
"picker",
"expression"
],
"default": "picker"
},
"due_at": {
"type": "string",
"title": "Due Date",
"format": "date-time",
"description": "Stored as Unix milliseconds string.",
"displayOptions": {
"show": {
"due_at_mode": [
"picker"
]
}
}
},
"due_at_expression": {
"type": "string",
"title": "Due date expression",
"format": "expression",
"description": "Return ISO 8601 or Unix millis. Example: {{ $now.plus({days: 3}).toISO() }}",
"displayOptions": {
"show": {
"due_at_mode": [
"expression"
]
}
}
},
"sla_ms": {
"type": "integer",
"title": "SLA duration (ms)",
"description": "Optional. Time allowed to complete the task once assigned.",
"default": 86400000
},
"reminders": {
"type": "boolean",
"title": "Enable Reminders",
"default": true
},
"required_output": {
"type": "object",
"title": "Required Output",
"description": "JSON Schema describing the data the assignee must provide on completion, plus UI hints for rendering the form."
},
"outputs": {
"type": "object",
"title": "Pre-computed Outputs",
"description": "Optional. Free-schema answer already produced by an upstream node (e.g. classifier or resolver) that the human merely verifies, edits, or rejects. Maps to Task.outputs. Distinct from \"Payload\" (which is the operator-facing context: summary + evidence + linked_entities)."
},
"payload": {
"type": "object",
"title": "Payload",
"description": "Summary, evidence blocks and linked entities passed to the assignee for context."
},
"has_hag": {
"type": "boolean",
"title": "Has Human Approval",
"description": "Requires a downstream Human Approval Gate node.",
"default": false
},
"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": {
"organization_id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "object"
},
"priority": {
"type": "object"
},
"project_mode": {
"type": "string"
},
"project_id": {
"type": "string"
},
"project_id_expression": {
"type": "string"
},
"assignee_mode": {
"type": "string"
},
"assignee": {
"type": "string"
},
"assignee_custom": {
"type": "string"
},
"due_at_mode": {
"type": "string"
},
"due_at": {
"type": "string"
},
"due_at_expression": {
"type": "string"
},
"sla_ms": {
"type": "integer"
},
"reminders": {
"type": "boolean"
},
"required_output": {
"type": "object"
},
"outputs": {
"type": "object"
},
"payload": {
"type": "object"
},
"has_hag": {
"type": "boolean"
}
}
}{
"type": "object",
"properties": {
"task_id": {
"type": "string"
},
"task_title": {
"type": "string"
},
"task_type": {
"type": "object"
},
"has_hag": {
"type": "boolean"
},
"status": {
"type": "string"
}
}
}[
{
"port_id": "created",
"label": "Created",
"is_default": true,
"description": "Task successfully created"
},
{
"port_id": "error",
"label": "Error"
}
]Ejecución
- Ejecución
async- Con estado
- Sí
- Reintentos (
retryOnFail) - No
- Capacidades
taskhumanworkflow- Etiquetas
humantaskmanagement
Notas y límites
- Estados de la tarea:
queued,assigned,claimed,in_progress,completed,rejected,invalidated,expired. Este nodo crea las tareas comoqueued(claimedcon un responsable de tipo usuario); las transiciones posteriores ocurren en la bandeja de tareas. - Sin pausa ni reanudación: completar la tarea después no notifica ni reanuda esta 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