Skip to content

fix(agentflow): fix variable resolution, credential sync, and add E2E example#6245

Open
jocelynlin-wd wants to merge 3 commits intomainfrom
fix/agentflow-variable-resolution-e2e
Open

fix(agentflow): fix variable resolution, credential sync, and add E2E example#6245
jocelynlin-wd wants to merge 3 commits intomainfrom
fix/agentflow-variable-resolution-e2e

Conversation

@jocelynlin-wd
Copy link
Copy Markdown
Contributor

@jocelynlin-wd jocelynlin-wd commented Apr 18, 2026

FLOWISE-558

Summary

  • Fix variable resolution for HTTP and other nodes: Three-layer bug caused upstream node variables to render as literal text in agent prompts:

    • useAvailableVariables.ts: variable picker emitted {{nodeId.data.instance}} instead of {{nodeId}}
    • customMention.ts: mention serializer used the display label (e.g. HTTP 0) instead of the node ID (e.g. httpAgentflow_0)
    • useAvailableVariables.ts: exclude Start node from upstream node outputs — users reference the question via global {{question}}, consistent with agentflow v2 (no Start.ts or server change needed)
  • Fix variable chip display consistency: Mention chips in the editor now show {{nodeId}} (e.g. {{httpAgentflow_0}}) instead of the display label (e.g. {{HTTP 0}}), matching the value serialized to flow data.

  • Fix credential sync for HTTP nodes: When a user selected a credential in the node editor, it was stored only in inputs.FLOWISE_CREDENTIAL_ID but server-side execution reads nodeData.credential. Now both are kept in sync on selection.

  • Add E2E example to examples app: New E2eExample.tsx demonstrating full Flowise integration — load flow from DB, editable title, save, delete, and test run via FABs passed as canvasActions. Simplified BasicExample to minimal canvas-only usage.

  • Test fixes: Updated test expectations for customMention, useAvailableVariables, nodeFactory, TooltipWithParser, and useAsyncOptions to match corrected behavior and suppress act() warnings.

🤖 Generated with Claude Code

example with http node and variable fix

agentflow-sdk-variable-http-node-fix.mov

e2e demo using existing flow from db

Screen.Recording.2026-04-17.at.5.57.41.PM.mov

… example

- Fix variable picker emitting {{nodeId.data.instance}} instead of {{nodeId}}
- Fix customMention serializer using display label instead of node ID
- Fix Start node missing outputData.content for chatInput type
- Sync credential selection to nodeData.credential for server-side execution
- Add E2E example with save/delete/test-run FABs via canvasActions
- Simplify BasicExample to minimal canvas-only usage
- Fix act() warnings in TooltipWithParser and useAsyncOptions tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
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 introduces a comprehensive E2E example for Agentflow, including new components for saving flows to a database, performing test runs, and managing flow metadata. It also refactors variable mention rendering to use IDs instead of labels and updates the node factory to handle credential IDs. Key feedback includes addressing a potential XSS vulnerability when rendering markdown, avoiding the overloading of the credential property to prevent UI hydration issues, and improving error handling for network requests in the E2E demo.

Comment thread packages/agentflow/examples/src/TestRunDialog.tsx
Comment thread packages/agentflow/src/core/utils/nodeFactory.ts
Comment thread packages/agentflow/examples/src/demos/E2eExample.tsx Outdated
jocelynlin-wd and others added 2 commits April 17, 2026 18:07
…2E example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nt field

- VariableInput: show {{nodeId}} in mention chip instead of display label,
  consistent with the value serialized to flow data
- useAvailableVariables: exclude startAgentflow from upstream node outputs;
  users reference the question via {{question}} (global variable), matching
  agentflow v2 behavior — no Start node change or server change needed
- Start.ts: revert outputData.content = input; Start node is no longer
  exposed as a node output variable in the picker

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant