# Create Task

> Crea una tarea humana en el sistema de Work Management.

Source: https://docs.sommatic.ai/es/nodes/human.task.create/

- Slug: `human.task.create`
- Familia: Human in the loop
- Versión: 1.0.0
- Estado: Disponible
- Ejecución: async

Crea una tarea humana en el sistema de Work Management.

## Configuración

- `organization_id` (string, obligatorio): ID de la organización dueña de esta tarea
- `title` (string, obligatorio, acepta expresiones): Resumen breve. Admite expresiones como {{ $json.title }}.
- `description` (string, opcional, acepta expresiones): Instrucciones detalladas para la persona asignada. Admite expresiones y texto de varias líneas.
- `type` (object, obligatorio): Aprobación | Completar datos | Revisión | Resolución | Delegación
- `priority` (object, obligatorio): Por defecto: `{"id":2,"name":"medium","title":"Medium","color":"#1976d2"}`.
- `project_mode` (string, 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). Por defecto: `picker`. Valores permitidos: `picker`, `expression`.
- `project_id` (string, opcional): Proyecto al que pertenece esta tarea (define su visibilidad y agrupación). Se muestra cuando: project_mode = `picker`.
- `project_id_expression` (string, opcional, acepta expresiones): Devuelve una cadena con el id del proyecto. Ejemplo: {{ $json.project_id }}. Se muestra cuando: project_mode = `expression`.
- `assignee_mode` (string, opcional): Usuario específico: elige a alguien de tu organización. Personalizado: indica una identidad o una expresión. Por defecto: `specific_user`. Valores permitidos: `specific_user`, `custom`.
- `assignee` (string, opcional): Usuario único al que se asignará la tarea Se muestra cuando: assignee_mode = `specific_user`.
- `assignee_custom` (string, opcional, acepta expresiones): Usa {{ $json.user_id }} o una cadena de identidad literal. Se muestra cuando: assignee_mode = `custom`.
- `due_at_mode` (string, opcional): Por defecto: `picker`. Valores permitidos: `picker`, `expression`.
- `due_at` (string, opcional): Se guarda como cadena en milisegundos Unix. Se muestra cuando: due_at_mode = `picker`.
- `due_at_expression` (string, opcional, acepta expresiones): Devuelve ISO 8601 o milisegundos Unix. Ejemplo: {{ $now.plus({days: 3}).toISO() }} Se muestra cuando: due_at_mode = `expression`.
- `sla_ms` (integer, opcional): Opcional. Tiempo disponible para completar la tarea una vez asignada. Por defecto: `86400000`.
- `reminders` (boolean, opcional): Por defecto: `true`.
- `required_output` (object, 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.
- `outputs` (object, 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).
- `payload` (object, opcional): Resumen, bloques de evidencia y entidades vinculadas que recibe la persona asignada como contexto.
- `has_hag` (boolean, opcional): Requiere un nodo Human Approval Gate posterior. Por defecto: `false`.

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`.

## Puertos de salida

- `created` (por defecto): Tarea creada correctamente
- `error`: Error

## Contrato de entrada

- `organization_id` (string, opcional)
- `title` (string, opcional)
- `description` (string, opcional)
- `type` (object, opcional)
- `priority` (object, opcional)
- `project_mode` (string, opcional)
- `project_id` (string, opcional)
- `project_id_expression` (string, opcional)
- `assignee_mode` (string, opcional)
- `assignee` (string, opcional)
- `assignee_custom` (string, opcional)
- `due_at_mode` (string, opcional)
- `due_at` (string, opcional)
- `due_at_expression` (string, opcional)
- `sla_ms` (integer, opcional)
- `reminders` (boolean, opcional)
- `required_output` (object, opcional)
- `outputs` (object, opcional)
- `payload` (object, opcional)
- `has_hag` (boolean, opcional)

## Contrato de salida

- `task_id` (string, opcional)
- `task_title` (string, opcional)
- `task_type` (object, opcional)
- `has_hag` (boolean, opcional)
- `status` (string, opcional)

## 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.

- `$("Create Task").item.json.task_id` (string) = `"task-xxxxxxxxxxxxxxx"`
- `$("Create Task").item.json.task_title` (string) = `"Review refund for ord_123"`
- `$("Create Task").item.json.task_type` (object) = `{…}`
- `$("Create Task").item.json.has_hag` (boolean) = `true`
- `$("Create Task").item.json.status` (string) = `{…}`
- `$("Create Task").item.json.port` (string) = `"created"` (El editor no la sugiere)
- `$("Create Task").item.json.task_type.id` (number) = `10` (El editor no la sugiere)
- `$("Create Task").item.json.task_type.name` (string) = `"approval"` (El editor no la sugiere)
- `$("Create Task").item.json.task_type.title` (string) = `"Approval"` (El editor no la sugiere)
- `$("Create Task").item.json.task_type.color` (string) = `"#0288d1"` (El editor no la sugiere)
- `$("Create Task").item.json.status.id` (number) = `5` (El editor no la sugiere)
- `$("Create Task").item.json.status.name` (string) = `"claimed"` (El editor no la sugiere)
- `$("Create Task").item.json.status.title` (string) = `"Claimed"` (El editor no la sugiere)
- `$("Create Task").item.json.status.color` (string) = `"#5e35b1"` (El editor no la sugiere)


## Cómo funciona

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.

1. 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).
2. Comprueba `organization_id`, `title`, `type.name` y `priority.name`.
3. Elige los valores de modo doble: el responsable de `assignee` (`assignee_mode` `specific_user`) o `assignee_custom` (`custom`); el proyecto de `project_id` (`picker`) o `project_id_expression` (`expression`); la fecha límite de `due_at` (`picker`) o `due_at_expression` (`expression`).
4. Arma `sla`: una fecha límite (ISO 8601 o milisegundos epoch) se convierte en `{ due_at: "<epoch ms>", sla_ms: <due - now>, is_overdue }`; un `sla_ms` configurado reemplaza al calculado; una fecha que no se puede interpretar se guarda tal cual.
5. Arma la tarea con `status` `queued`, `source` `workflow`, el responsable como `{ assignee_type: "user", user: { identity, profile: { primary_email_address: identity } } }` (o `null`), `payload` `{ summary, evidence, linked_entities }`, `required_output`, `outputs` y `context.reminders`.
6. 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, queda `queued`, acotada por `project_id`.
7. Devuelve `{ task_id, task_title, task_type, has_hag, status }` por `created`.

## En un workflow

### Nodo

```json
{
  "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": "reviewer@example.com",
    "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
  }
}
```

### Envelope

```json
{
  "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"
  }
}
```

## Puertos de salida (comportamiento en el código)

### `created`

El backend devolvió un id de tarea. `status` es el objeto de estado que devolvió el backend.

```json
{
  "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ó.

```json
{
  "port": "error",
  "error": "Missing 'title'"
}
```

## Comportamiento en el código

- `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 exista `name`.
- `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) y `linked_entities` (arreglo). Si `payload` no está configurado, esas claves se leen del payload de entrada. También se leen los alias heredados `task_payload`, `task_required_output` y `task_outputs`.
- `has_hag`: Solo se repite en la salida. El editor exige un `human.approval.gate` justo después del nodo cuando es true.

## 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. |

## Notas y límites

- Estados de la tarea: `queued`, `assigned`, `claimed`, `in_progress`, `completed`, `rejected`, `invalidated`, `expired`. Este nodo crea las tareas como `queued` (`claimed` con 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_id` y el `context.trace_id` de 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 clave `port`) como payload del siguiente nodo.
- El worker no define `ok` (el ejemplo muestra `true`); el motor enruta solo por `port`.


## Contratos (JSON Schema)

### All (`*.definition.js`)

```json
{
  "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
    }
  }
}
```

### config_schema

```json
{
  "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

```json
{
  "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

```json
{
  "type": "object",
  "properties": {
    "task_id": {
      "type": "string"
    },
    "task_title": {
      "type": "string"
    },
    "task_type": {
      "type": "object"
    },
    "has_hag": {
      "type": "boolean"
    },
    "status": {
      "type": "string"
    }
  }
}
```

### ports

```json
[
  {
    "port_id": "created",
    "label": "Created",
    "is_default": true,
    "description": "Task successfully created"
  },
  {
    "port_id": "error",
    "label": "Error"
  }
]
```
