* Builds VariableItems representing the current node's own output. * Added when a nested sub-field declares `acceptNodeOutputAsVariable: true`, * matching the v2 suggestionOption behaviour where `{{output}}` and * `{{output. }}` appear for structured-output fields.
(data: NodeData)
| 18 | * `{{output.<key>}}` appear for structured-output fields. |
| 19 | */ |
| 20 | function buildNodeOutputVariables(data: NodeData): VariableItem[] { |
| 21 | const vars: VariableItem[] = [ |
| 22 | { label: 'output', description: 'Output from the current node', category: 'Node Outputs', value: '{{output}}' } |
| 23 | ] |
| 24 | const structured = ( |
| 25 | (data.inputs?.agentStructuredOutput ?? data.inputs?.llmStructuredOutput ?? []) as Array<{ key: string; description?: string }> |
| 26 | ).filter((item) => item?.key) |
| 27 | for (const item of structured) { |
| 28 | vars.push({ |
| 29 | label: `output.${item.key}`, |
| 30 | description: item.description ?? `Structured output field: ${item.key}`, |
| 31 | category: 'Node Outputs', |
| 32 | value: `{{output.${item.key}}}` |
| 33 | }) |
| 34 | } |
| 35 | return vars |
| 36 | } |
| 37 | |
| 38 | export interface ArrayInputProps { |
| 39 | inputParam: InputParam |