本页内容
Sommatic 文档
打开控制台

Input Access

以条目形式呈现的同一输入:当前条目与条目列表。

以 Markdown 查看
在以下应用中打开

每个示例都在已部署的表达式引擎上、基于页面末尾的示例上下文运行过。

$input.item

$input.item

以条目形式表示的当前节点输入:json 与 $json 是同一个对象,binary 即 $binary(始终为 {})。适用于按其他工具的条目风格编写的表达式。

示例

{{ $input.item.json.body.order_id }}
结果 string
"ord_1042"
{{ Object.keys($input.item) }}
结果 list
["json","binary"]

说明

  • 在 code.js 节点中,$input 含义不同:它就是输入对象本身,没有 { json } 包装。参见代码节点。

在 JSONata 中 $$input.item.json.body.order_id

$input.all()

$input.all()

以 { json, binary } 列表的形式返回输入条目。一个节点每次执行只处理一个条目,因此该列表始终恰好有一个元素:$input.all()[0].json 就是 $json。要处理数据中某个列表的元素,请直接使用该列表($json.body.items)。

示例

{{ $input.all().length }}
结果 number
1
{{ $input.all()[0].json.body.email }}
结果 string

在 JSONata 中 JSONata 中无法调用函数;请改为读取 $$input.item.json。

$input.first()

$input.first()

返回第一个输入条目 { json, binary }:由于只有一个条目,它就是当前条目。等同于 $input.all()[0] 和 $input.item。

示例

{{ $input.first().json.body.customer.name }}
结果 string
"Ana Pérez"

在 JSONata 中 JSONata 中无法调用函数;请改为读取 $$input.item.json。

$input.last()

$input.last()

返回最后一个输入条目 { json, binary }:由于只有一个条目,它就是当前条目。

示例

{{ $input.last().json.body.order_id }}
结果 string
"ord_1042"

在 JSONata 中 JSONata 中无法调用函数;请改为读取 $$input.item.json。

$input.params

保留. 引擎不会填充它:目前始终为 {}。

$input.params

用于暴露产生该输入的节点的配置参数。引擎不会传递这些参数:它始终是空对象。要复用之前某个节点配置中的值,请让该节点在输出中返回它,或者再填写一遍。

示例

{{ $input.params }}
结果 object
{}

在 JSONata 中 $$input.params

$input.context

保留. 引擎不会填充它:目前始终为 {}。

$input.context

用于从产生该输入的节点携带上下文数据。引擎不会填充它:它始终是空对象。需要在节点之间传递的数据应放在节点的输出中,并用 $json 或 $('…') 读取。

示例

{{ $input.context }}
结果 object
{}

在 JSONata 中 $$input.context

示例上下文

示例基于以下数据运行:当前节点的输入($json)、已运行的节点($(…))、本次运行的 ID 以及当前节点。时钟固定为 2026-11-26T14:30:00.000Z,服务器时区为 UTC,因此各页面中 $now 与 $today 的值都相同。

当前节点的输入 JSON
{
  "$json": {
    "body": {
      "order_id": "ord_1042",
      "email": "[email protected]",
      "customer": {
        "name": "Ana Pérez",
        "segment": "gold"
      },
      "priority": "",
      "items": [
        {
          "sku": "A-100",
          "qty": 2,
          "price": 10.5
        },
        {
          "sku": "B-200",
          "qty": 0,
          "price": 4
        },
        {
          "sku": "C-300",
          "qty": 1,
          "price": 25
        }
      ],
      "tags": [
        "new",
        "web",
        "new"
      ],
      "created_at": "2026-11-25T09:15:00Z"
    },
    "headers": {
      "content-type": "application/json"
    },
    "query": {},
    "method": "POST"
  }
}
已运行的节点(标签 → 输出) JSON
{
  "Webhook Receiver": "= $json",
  "Normalize input": {
    "correlation_id": "c-7f3a",
    "channel": "web"
  },
  "Classify": {
    "label": "billing",
    "confidence": 0.92
  }
}
运行与当前节点 JSON
{
  "$execution": {
    "id": "fir-xxxx",
    "flow_instance_id": "fi-xxxx",
    "flow_definition_id": "fd-xxxx",
    "flow_version_id": "fv-xxxx",
    "flow_slug": "order-intake"
  },
  "$node": {
    "id": "node-notify",
    "label": "Notify customer"
  }
}

示例运行所基于的编排器提交 31e874b

安装智能体工具

为你的编程智能体接入 Sommatic AI 官方文档:技能包、文档 MCP 服务器与 Markdown 页面,无需再抓取网页。

仅安装技能包,不会自动更新;需要时重新运行即可。

npx skills add https://docs.sommatic.ai
智能体如何读取本文档