Skip to content

Fix #5704: Agentflow v2 {{ variables }} not being interpolated#5818

Merged
HenryHengZJ merged 1 commit intoFlowiseAI:mainfrom
danielalanbates:fix/issue-5704
Feb 26, 2026
Merged

Fix #5704: Agentflow v2 {{ variables }} not being interpolated#5818
HenryHengZJ merged 1 commit intoFlowiseAI:mainfrom
danielalanbates:fix/issue-5704

Conversation

@danielalanbates
Copy link
Contributor

Fixes #5704

Summary

This PR addresses: Agentflow v2 {{ variables }} not being interpolated

Changes

packages/components/nodes/agentflow/HumanInput/HumanInput.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Testing

Please review the changes carefully. The fix was verified against the existing test suite.


This PR was created with the assistance of Claude Sonnet 4.6 by Anthropic | effort: low. Happy to make any adjustments!

By submitting this pull request, I confirm that my contribution is made under the terms of the project's license (contributor license agreement).

…n Agentflow v2

When the HumanInput node receives user input, its output only contained
`{ conditions: [...] }`. The resolveVariables function extracts
`nodeOutput?.content` for bare `{{ nodeId }}` references, which was
undefined, causing the template string to be returned unchanged.

Add a top-level `content` field (set to the user's feedback text or
action type) to the HumanInput node output so that `{{ humanInputAgentflow_0 }}`
correctly interpolates to the user's response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @danielalanbates, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug in Agentflow v2 where variables were not being interpolated within the HumanInput node. The change ensures that the output of the HumanInput node correctly includes the user's feedback or input type as its content, thereby enabling proper variable resolution and enhancing the node's functionality.

Highlights

  • Agentflow v2 Variable Interpolation Fix: Resolved an issue where {{ variables }} within Agentflow v2's HumanInput node were not being correctly interpolated. The fix ensures the output object now includes a content property, populated from humanInput.feedback or humanInput.type, which is essential for proper variable resolution.
Changelog
  • packages/components/nodes/agentflow/HumanInput/HumanInput.ts
    • Modified the output object to include a content property, ensuring proper variable interpolation for HumanInput nodes.
Activity
  • PR created with assistance from Claude Sonnet 4.6 by Anthropic.
  • Author confirmed contribution under the project's license.
  • Author is open to making any adjustments.
  • Fix verified against the existing test suite.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix an issue with variable interpolation for HumanInput nodes in Agentflow v2. The approach of adding a content property to the node's output is correct. However, I've identified a potential issue with how the content's value is determined, which could lead to loss of user input if they provide empty feedback. I've left a specific comment with a suggestion to address this.

]
const input = { ...humanInput, messages }
const output = { conditions: outcomes }
const output = { content: humanInput.feedback || humanInput.type, conditions: outcomes }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of the logical OR operator || here might lead to unexpected behavior. If humanInput.feedback is an empty string (''), which is a valid user input, it will be treated as falsy and humanInput.type will be used instead. This means empty feedback from a user would be lost.

To handle this correctly and preserve empty string feedback, it's better to use the nullish coalescing operator ?? which only falls back to the right-hand side operand when the left-hand side is null or undefined.

I noticed the same pattern is used on line 185 for the message content. You might want to apply a similar fix there as well for consistency.

Suggested change
const output = { content: humanInput.feedback || humanInput.type, conditions: outcomes }
const output = { content: humanInput.feedback ?? humanInput.type, conditions: outcomes }

@HenryHengZJ HenryHengZJ merged commit 9a130ed into FlowiseAI:main Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agentflow v2 {{ variables }} not being interpolated

2 participants