npm @tinkerlandai/indiana-sdk@0.0.1 提供 createFunnelOrchestrationClient,使用当前 App/环境的后端 Secret Key,并授予 sessions:create 与 funnels:run。先在 Funnel 等待节点声明自定义事件名称及数据字段,然后发布。宿主必须校验业务事件和运行归属;普通浏览器不能发送回执,自定义回执不能声明付款成功。
回执可提前到达;同 eventId、同数据重试幂等,改写数据冲突。每个 Run/等待节点接收一条回执,超时或运行结束后拒绝新回执。条件与后续任务用 nodeId.field 引用已消费结果;未执行或未消费时字段保持缺失。
import { createFunnelOrchestrationClient } from "@tinkerlandai/indiana-sdk/server"; const orchestration = createFunnelOrchestrationClient({ baseUrl: process.env.GROOVE_BASE_URL!, apiKey: process.env.GROOVE_SECRET_KEY!, scope: { projectId: process.env.GROOVE_PROJECT_ID!, environment: "sandbox" },});// Save eventId and this complete input with your verified business event.const receipt = await orchestration.signal({ runId: verifiedRunId, nodeId: "offer_receipt", eventName: "offer_used", eventId: retainedEventId, data: { used: true },});const { results } = await orchestration.readResults(verifiedRunId);// accepted acknowledges receipt; results appear only after node consumption.