# Create Task

> 在 Work Management 系统中创建一项人工任务。

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

- 标识: `human.task.create`
- 类别: 人工介入
- 版本: 1.0.0
- 状态: 可用
- 执行方式: async

在 Work Management 系统中创建一项人工任务。

## 配置

- `organization_id` (string, 必填): 拥有该任务的组织 ID
- `title` (string, 必填, 支持表达式): 简短摘要。支持 {{ $json.title }} 等表达式。
- `description` (string, 可选, 支持表达式): 给处理人的详细说明。支持表达式和多行文本。
- `type` (object, 必填): Approval | Data Completion | Review | Resolution | Delegation
- `priority` (object, 必填): 默认值: `{"id":2,"name":"medium","title":"Medium","color":"#1976d2"}`.
- `project_mode` (string, 可选): Picker：选择一个项目。Expression：动态推导项目 ID（例如按接收邮箱推导）。 默认值: `picker`. 可选值: `picker`, `expression`.
- `project_id` (string, 可选): 该任务所属的项目（决定可见范围和分组）。 显示条件: project_mode = `picker`.
- `project_id_expression` (string, 可选, 支持表达式): 返回项目 ID 字符串。示例：{{ $json.project_id }}。 显示条件: project_mode = `expression`.
- `assignee_mode` (string, 可选): Specific User：从组织中选择。Custom：提供身份标识或表达式。 默认值: `specific_user`. 可选值: `specific_user`, `custom`.
- `assignee` (string, 可选): 接收该任务的单个用户 显示条件: assignee_mode = `specific_user`.
- `assignee_custom` (string, 可选, 支持表达式): 使用 {{ $json.user_id }} 或字面身份字符串。 显示条件: assignee_mode = `custom`.
- `due_at_mode` (string, 可选): 默认值: `picker`. 可选值: `picker`, `expression`.
- `due_at` (string, 可选): 以 Unix 毫秒字符串存储。 显示条件: due_at_mode = `picker`.
- `due_at_expression` (string, 可选, 支持表达式): 返回 ISO 8601 或 Unix 毫秒。示例：{{ $now.plus({days: 3}).toISO() }} 显示条件: due_at_mode = `expression`.
- `sla_ms` (integer, 可选): 可选。任务分配后允许完成的时长。 默认值: `86400000`.
- `reminders` (boolean, 可选): 默认值: `true`.
- `required_output` (object, 可选): 描述处理人完成时必须提供的数据的 JSON Schema，以及用于渲染表单的 UI 提示。
- `outputs` (object, 可选): 可选。由上游节点（例如分类器或解析器）预先生成、由人工仅做核验、编辑或驳回的自由结构答案。映射到 Task.outputs。不同于“Payload”（后者是面向操作员的上下文：summary + evidence + linked_entities）。
- `payload` (object, 可选): 传给处理人作为上下文的摘要、证据块和关联实体。
- `has_hag` (boolean, 可选): 需要下游的 Human Approval Gate 节点。 默认值: `false`.

配置中会显示通用执行设置，但该节点目前不执行重试（`retryOnFail`、`maxTries`）。所有节点均未实现 `continueOnFail`。

## 输出端口

- `created` (默认): 任务创建成功
- `error`: Error

## 输入契约

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

## 输出契约

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

## 在表达式中

后续节点可通过 `$("Create Task").item.json.<路径>` 读取此节点输出中的内容（请把 `Create Task` 换成你的节点标签）。**Editor** 标记工作流编辑器在 Previous Nodes 中提示的路径（输出契约）；**Worker** 标记 worker 实际通过 `created` 返回的路径，依据“端口”一节所示的输出。

- `$("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"` (编辑器不提示)
- `$("Create Task").item.json.task_type.id` (number) = `10` (编辑器不提示)
- `$("Create Task").item.json.task_type.name` (string) = `"approval"` (编辑器不提示)
- `$("Create Task").item.json.task_type.title` (string) = `"Approval"` (编辑器不提示)
- `$("Create Task").item.json.task_type.color` (string) = `"#0288d1"` (编辑器不提示)
- `$("Create Task").item.json.status.id` (number) = `5` (编辑器不提示)
- `$("Create Task").item.json.status.name` (string) = `"claimed"` (编辑器不提示)
- `$("Create Task").item.json.status.title` (string) = `"Claimed"` (编辑器不提示)
- `$("Create Task").item.json.status.color` (string) = `"#5e35b1"` (编辑器不提示)


## 工作原理

在 Sommatic AI 后端的 Work Management 中创建任务，并立即从 `created` 继续；运行不会等待人员处理。

1. 解析配置并合并到输入 payload 之上：每个字段都可来自配置或 payload 中的同名键（配置优先）。
2. 检查 `organization_id`、`title`、`type.name` 和 `priority.name`。
3. 选取双模式值：负责人取 `assignee`（`assignee_mode` 为 `specific_user`）或 `assignee_custom`（`custom`）；项目取 `project_id`（`picker`）或 `project_id_expression`（`expression`）；截止时间取 `due_at`（`picker`）或 `due_at_expression`（`expression`）。
4. 构建 `sla`：截止时间（ISO 8601 或纪元毫秒）转换为 `{ due_at: "<纪元毫秒>", sla_ms: <截止 - 当前>, is_overdue }`；配置了 `sla_ms` 时替换计算值；无法解析的截止时间按原样保存。
5. 构建任务：`status` 为 `queued`，`source` 为 `workflow`，负责人为 `{ assignee_type: "user", user: { identity, profile: { primary_email_address: identity } } }`（或 `null`），以及 `payload` `{ summary, evidence, linked_entities }`、`required_output`、`outputs` 和 `context.reminders`。
6. 提交到后端 Work Management 任务 API。有用户负责人时，后端会为该用户认领任务（状态 `claimed`）；没有时保持 `queued`，按 `project_id` 划定范围。
7. 通过 `created` 返回 `{ task_id, task_title, task_type, has_hag, status }`。

## 在工作流中

### 节点

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

## 输出端口 (代码中的行为)

### `created`

后端返回了任务 id。`status` 为后端返回的状态对象。

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

缺少必填字段或后端调用失败。

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

## 代码中的行为

- `type`: 来自后端目录的对象 `{ id, name, title, color }`：`approval`（10）、`data_completion`（11）、`review`（12）、`resolution`（13）、`delegation`（14）。worker 只检查 `name` 是否存在。
- `priority`: 来自目录的对象：`low`（1）、`medium`（2）、`high`（3）、`critical`（4）。
- `assignee`: 用户身份；它也会被存为该用户的主邮箱，因此请使用邮箱身份。只会生成用户类型的负责人：本节点不支持用户组。
- `payload`: 只保留 `summary`、`evidence`（数组）和 `linked_entities`（数组）。未配置 `payload` 时，这些键从输入 payload 读取。也会读取旧别名 `task_payload`、`task_required_output` 和 `task_outputs`。
- `has_hag`: 仅在输出中回显。为 true 时，编辑器要求紧接一个 `human.approval.gate` 节点。

## 错误

| 消息 | 端口 | 原因与处理 |
| --- | --- | --- |
| `Missing 'organization_id'` | `error` | 配置和 payload 中都没有。它不会取自运行身份。 |
| `Missing 'title'` | `error` | 解析表达式后 `title` 为空。 |
| `Missing 'type' or invalid type object` | `error` | `type` 缺失或没有 `name`。 |
| `Missing 'priority' or invalid priority object` | `error` | `priority` 缺失或没有 `name`。 |
| `Backend did not return a task id` | `error` | 后端响应中没有 `result.id`。 |
| `Request failed with status code <status>` | `error` | 后端拒绝了该任务。 |
| `services.apiManager.uri is not resolved in dependencies.config — check Link Loom Cloud environment config.` | `error` | 编排器未配置后端地址。这是服务配置问题，与节点无关。 |

## 说明与限制

- 任务状态：`queued`、`assigned`、`claimed`、`in_progress`、`completed`、`rejected`、`invalidated`、`expired`。本节点创建的任务为 `queued`（有用户负责人时为 `claimed`）；后续状态变化在任务收件箱中进行。
- 不暂停也不恢复：之后完成任务不会通知或恢复本次运行。
- 任务的 `context.workflow_instance_id` 和 `context.trace_id` 以空值发送：worker 从运行时未设置的字段读取它们，因此任务不会关联到本次运行。
- 非幂等：每次执行都会创建新任务。HTTP 调用不会重试。
- worker 将字段直接放在信封顶层、不使用 `data`，因此引擎把整个信封（包括 `port` 键）作为下一个节点的 payload。
- worker 不设置 `ok`（示例中显示为 `true`）；引擎只按 `port` 路由。


## 契约（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"
  }
]
```
