3412 Commits
Author SHA1 Message Date
Henry Heng 378d3ec3bd Chore/Remove Redundant Check for Image Processing (#5980)
get rid of redundant check for model during image processing
[email protected] [email protected] [email protected]
2026-03-16 22:35:57 +08:00
Henry Heng 0f3b3d62d6 update pnpm lock file for embed [email protected] (#5983) 2026-03-16 22:24:19 +08:00
Henry Heng 57e08207de Release/3.1.0 (#5981)
[email protected] release
2026-03-16 20:37:41 +08:00
Henry Hengandyau-wd 0c6924bb08 Feat/Reasoning Support, Migrate LangChain to v1, Upgrade AI SDKs and Models (#5893)
* update langchain and all related scoped packages to v1, deprecate agents and llms, rename and upgrade chat models

* add reasoning capability to Agent and LLM

* add token cost to usageMetadata

* update azure and chat openai

* restore executable permission for husky pre-commit hook

* refactor(agentflow): implement extractResponseContent utility for consistent response handling

- Introduced extractResponseContent function to streamline response content extraction across various components.
- Updated multiple files to utilize the new utility, enhancing code readability and maintainability.
- Adjusted model configurations and added new parameters for Gemini models to improve functionality.

* added a mock implementation for the logger in the URL security utilities test file to isolate tests and improve reliability.

* chore: update package.json and pnpm-lock.yaml to add uuid dependency and mock multer-azure-blob-storage in Jest config

- Added uuid dependency with version 10.0.0 and request>uuid with version 3.4.0 in package.json.
- Updated pnpm-lock.yaml to reflect the new uuid dependency and its deprecation notice.
- Modified Jest configuration to mock multer-azure-blob-storage to avoid module resolution issues with uuid/v4.

* gpt 5.4 models

* - Changed the stream conversion method in convertTextToSpeechStream to utilize Readable.fromWeb, enhancing compatibility with web streams.
- Added '/api/v1/chatmessage/abort' to the WHITELIST_URLS array to allow for aborting chat messages in the API.

* - Refactors how agentflow nodes (Agent, ConditionAgent, LLM) handle images in chat messages so that base64 is only used during model invocation
- Storage and chat history keep file references only
- Added comprehensive test cases to ensure correct handling of base64 image data and file references

* fix unit test

* implement filename sanitization to prevent path traversal vulnerabilities

* fix(validator): normalize backslashes in file names for cross-platform compatibility

* updated utils to process messages with images, converting stored-file references to base64 for model invocation, and implement interfaces

* add sanitization to unwanted keys when processing images

* add uuid to components package.json

* move allow image uploads params on chat models

* add encodingformat to openai embeddings

* Refactor output parsing for reasoning models

* Update ConditionAgent to version 2.0, refactor system prompt handling, and enhance message preparation logic

* add claude settings local json to gitignore

* remove claude settings local json

---------

Co-authored-by: yau-wd <[email protected]>
2026-03-16 19:21:29 +08:00
Jocelyn Lin 9e92d60e6c feat(agentflow): strip server-only metadata from node data (#5966)
* feat(agentflow): strip server-only metadata from node data

* feat(agentflow): enhance export flow data handling by stripping sensitive and runtime-only fields

* address gemini review comment
2026-03-13 16:42:48 -07:00
Jocelyn LinandClaude Opus 4.6 65bfd31830 feat(agentflow): MessagesInput, StructuredOutputBuilder + ExpandTextDialog (FLOWISE-263, FLOWISE-267) (#5965)
* feat(agentflow): MessagesInput, StructuredOutputBuilder + ExpandTextDialog (FLOWISE-263, FLOWISE-267)

Wire MessagesInput and StructuredOutputBuilder atoms into EditNodeDialog
for agentMessages/llmMessages and agentStructuredOutput/llmStructuredOutput
array params. Extract shared ExpandTextDialog atom used by both
MessagesInput and NodeInputHandler for expanding multiline text fields.

- MessagesInput: role dropdown + multiline content with variable/expand icons
- StructuredOutputBuilder: key/type/description fields with conditional
  enum values and JSON schema fields
- ExpandTextDialog: reusable expand dialog for long text editing
- EditNodeDialog: name-based routing for specialized array components
- maxItems forward-compat guard on Add buttons
- Remove dead default exports for barrel-only modules

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* address gemini review feedback

* Enhance StructuredOutputBuilder with required asterisk for Description, add info tooltips for Enum Values and JSON Schema, and implement ExpandTextDialog for JSON Schema editing. Update tests to cover new features and interactions.

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-03-13 15:29:29 -07:00
Renzo 06f4156d0a feat: add include tabs content option for Google Docs get actions (#5883)
* feat: add include tabs content option for Google Docs get actions

* refactor: use URLSearchParams for query string construction in Google Docs tools
2026-03-14 06:16:22 +08:00
j-sanaa 9d075343ce Fix/agentflow multiOptions rendering (#5964)
* added support fo multi options

* add support for store amad embeddings api

* Changed naming of all apiClients to be consistent

* Add correct index to ArrayInput

* Log error when parsing multiOptions value fails

Add error logging for failed parsing of multiOptions value.

* Fix error handling
2026-03-13 09:27:02 -07:00
j-sanaaandgemini-code-assist[bot] 0973446cfa Feat/agentflow async input handlers (#5956)
* initial flow

* Removed unused imports

* fix endpoint for chatModels from 'assistants/components/chatmodels' to '/node-load-method/agentAgentflow'

* Remove unused param

* Added functionality for icons

* Fixed api return type of chatmodel

* Fix lnit error

* Improve test coverage

* Update packages/agentflow/src/features/node-editor/AsyncInput.tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Routing requests to agentAgentFlow or toolAgentFlow correctly

* Fix tools input error

* Fix test coverage

* encode parameters

* Add asyncOptions/asyncMultiOptions visibility re-evaluation tests

* fix build error

* Revert changes to serrings.json

* delete newly added file

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-12 11:28:20 -07:00
4ed8a5715c feat(agentflow): ConditionBuilder + dynamic output ports (FLOWISE-261) (#5957)
* feat(agentflow): add ConditionBuilder component and dynamic output ports (FLOWISE-261)

Implement condition node editing UI with dynamic output port syncing:
- ConditionBuilder atom for rendering condition arrays with Else indicator
- buildDynamicOutputAnchors utility (parameterized for reuse by FLOWISE-262)
- useDynamicOutputPorts hook with orphaned edge cleanup on condition deletion
- EditNodeDialog integration for conditionAgentflow nodes

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* address gemini review comments, also relocate Condition Builder and hooks

* address gemini comment and also fix a number of issues on conditions update
- Add ConditionBuilder atom with stable keys and Else indicator
- Add buildDynamicOutputAnchors utility with v2-compatible format (numeric label + description)
- Add useDynamicOutputPorts hook for orphaned edge cleanup on condition deletion
- Integrate into EditNodeDialog with merged updateNodeData to avoid stale-closure overwrites
- Generate condition output anchors at node creation time in nodeFactory
- Add registerOnFlowChange to AgentflowContext for context-level change notification

* Update packages/agentflow/src/atoms/ConditionBuilder.tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-12 09:57:24 -07:00
github-actions[bot]andgithub-actions[bot] e00876ad36 chore: bump @flowiseai/agentflow to 0.0.0-dev.3 (#5952)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-11 11:02:57 -07:00
christopherholland-workdayandchristopherholland-workday 8799c7a309 Sanitize flowData in getSinglePublicChatflow (#5938)
* Sanitize flowData in getSinglePublicChatflow

* Fixes to password reset functionality

* Revert "Fixes to password reset functionality"

This reverts commit 725ecd24d8.

* Sanitize flowData in getSinglePublicChatflow

---------

Co-authored-by: christopherholland-workday <[email protected]>
2026-03-11 09:15:46 -07:00
Jocelyn LinandClaude Opus 4.6 08e6a791c2 fix(ci): avoid workspace: protocol error in publish-agentflow workflow (#5946)
* fix(ci): avoid workspace: protocol error in publish-agentflow workflow

Use working-directory instead of pnpm exec for npm version, and
pnpm pack instead of pnpm exec npm pack, to avoid npm encountering
pnpm's workspace: protocol. Sort deps alphabetically in package.json
to prevent future noise from npm tooling.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix(ci): use npx semver + npm pkg set to avoid workspace: protocol error

npm version and pnpm version both fail in this monorepo because they
resolve the full dependency tree and choke on pnpm's workspace: protocol.
Replace with npx semver (compute version) + npm pkg set (write version).

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-03-11 09:15:24 -07:00
6c78e1c36f Fixes to password reset functionality (#5913)
* Fix Reset Password Auth Bypass

* Fix auth bypass in password reset

* Fix unauthorized password reset

* Update packages/server/src/enterprise/services/account.service.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Fixes to password reset functionality

* Fix Reset Password Auth Bypass

* Fix auth bypass in password reset

* Fix unauthorized password reset

* Update packages/server/src/enterprise/services/account.service.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Fixes to password reset functionality

* Fixes to password reset functionality

* Fixes to password reset functionality

---------

Co-authored-by: christopherholland-workday <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: yau-wd <[email protected]>
2026-03-11 23:13:33 +08:00
j-sanaa 20eac8f1ec feat(agentflow) Create Async Data Fetching Infrastructure in agentflow (#5937)
* initial flow

* Fixed  export types and added example application to test end to end flow

* Fix build errors

* fix gemini comments

* Test bug fix

* Fixed comments

* Removed API inspector example

* Refactor imports in index.ts for clarity

* Refactor exports and update type definitions

* Remove empty line in index.ts

Removed an empty line for cleaner code formatting.
2026-03-10 17:17:04 -07:00
christopherholland-workdayandchristopherholland-workday c7f18f51bb Use secureFetch and secureAxiosRequest for more URLs (#5886)
* Use secureFetch and secureAxiosRequest for URL's controlled by user input

* Use secureFetch and secureAxiosRequest for more URLs

* Use secureFetch and secureAxiosRequest for more URLs

---------

Co-authored-by: christopherholland-workday <[email protected]>
2026-03-10 22:27:58 +08:00
840d2ae14d Prevent IDOR Takeover of DocumentStores (#5914)
* Prevent IDOR Takeover of DocumentStores

* Update packages/server/src/controllers/documentstore/index.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* upsert fixes

* Prevent IDOR Takeover of DocumentStores

---------

Co-authored-by: christopherholland-workday <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: yau-wd <[email protected]>
2026-03-10 13:04:34 +08:00
Jocelyn Lin 9d6a416777 feat(agentflow): add requestInterceptor prop for API customization (#5936)
* feat(agentflow): add requestInterceptor prop for API customization

- Introduced a new `requestInterceptor` prop in the Agentflow component to allow users to customize outgoing API requests.
- Updated relevant components and types to support the new interceptor functionality.
- Enhanced the API client to handle the interceptor and log errors if thrown during request processing.
- Added tests to ensure the interceptor works as expected and does not recreate the client unnecessarily.

* refactor(agentflow): reorganize type exports and clean up API types

- Rearranged the export order of types in index.ts for better readability.
- Removed unused ApiContextValue interface from api.ts to streamline API types.
- Ensured ApiResponse and ValidationError are correctly positioned in the type exports.

* address gemini review comments
2026-03-09 15:40:19 -07:00
Jocelyn LinandClaude Opus 4.6 605f9ee1d8 refactor(agentflow): use design tokens for validation colors (#5934)
* refactor(agentflow): use design tokens for validation colors

Replace hardcoded '#FFB938' validation color with tokens.colors.border.validation
across AgentFlowNode and ValidationFeedback components for consistency
with the design token system.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* refactor(agentflow): move validationColor to module level

Hoist the validationColor constant outside the component body
since it's a static value that doesn't need to be redeclared
on every render.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-03-09 11:16:34 -07:00
Salman Chishti 3ad8a5a829 Upgrade GitHub Actions to latest versions (#5912)
Signed-off-by: Salman Muin Kayser Chishti <[email protected]>
2026-03-09 23:53:19 +08:00
Salman Chishti 18705402b6 Upgrade GitHub Actions for Node 24 compatibility (#5911)
Signed-off-by: Salman Muin Kayser Chishti <[email protected]>
2026-03-09 23:53:06 +08:00
Henry Heng 9a772b6154 Bugfix/TTS Invalid WorkspaceId (#5917)
fix TTS Invalid WorkspaceId
2026-03-09 14:28:00 +08:00
GinnaandGinna Baker a8189346ec task(agentflow): Bump agentflow version 0.0.0-dev.2 (#5920)
Bump agentflow version 0.0.0-dev.2

Co-authored-by: Ginna Baker <[email protected]>
2026-03-06 16:42:36 -07:00
j-sanaa a2451e2609 feat(agentflow) - create array input component and add test cases (#5887)
* feat(agentflow): Add array input component with field visibility

- Add ArrayInput component for managing lists of structured data

- Implement field visibility engine with show/hide conditions

- Add minItems constraint support for array inputs

- Add comprehensive test coverage for ArrayInput and EditNodeDialog

- Update NodeInputHandler to support array type inputs

- Update types to include array-related input parameters

* Move show/hide field logic into EditNodeDialog

* FIx build issue

* Fix gemini comments

* Fix comments

* Lint error fix
2026-03-06 14:20:21 -08:00
Ginna 73b0b1550c feat(agentflow): axios client includes cookies in requests (#5919) 2026-03-06 12:46:44 -07:00
Jocelyn Lin 11a393600a feat(agentflow): enhance validation and feedback mechanisms (#5915)
* feat(agentflow): enhance validation and feedback mechanisms

- Added constraint validation functions to ensure flow integrity, including checks for single start nodes, nested iterations, and human input restrictions within iterations.
- Implemented a new ValidationFeedback component to display validation results and issues directly in the UI.
- Updated the Agentflow component to integrate validation feedback and display snackbar notifications for constraint violations.
- Enhanced flow validation logic to detect hanging edges and validate node inputs, improving overall flow integrity checks.
- Introduced new test cases for validation functions to ensure robustness and reliability.

* address gemini review feedback
2026-03-06 10:37:40 -08:00
Jocelyn Lin 09f2a15310 feat(workflow): add GitHub Actions workflow for publishing agentflow sdk (#5908)
* feat(workflow): add GitHub Actions workflow for publishing @flowiseai/agentflow

- Introduced a new workflow to handle version bumps and publishing of the @flowiseai/agentflow package.
- Supports various version bump types (prerelease, patch, minor, major, custom) and allows for custom version input.
- Includes a dry-run step to validate the version and simulate the publish process before actual deployment.
- Configured to use pnpm for dependency management and publishing tasks.

* chore(workflow): update permissions and add version bump commit step

- Changed permissions for the GitHub Actions workflow to allow write access for contents.
- Added a step to commit and push the version bump for the @flowiseai/agentflow package after publishing.

* chore(workflow): enhance version bump process with PR creation

- Added permission for pull-requests in the GitHub Actions workflow.
- Modified the version bump step to create a new branch and open a pull request after committing the version bump for the @flowiseai/agentflow package.

* address review comments
2026-03-05 10:27:36 -08:00
christopherholland-workdayandchristopherholland-workday cf36fb71fb Stop LLM Generated Code from Having Any Additional Imports (#5879)
* Remove ability for any additional imports to be added to LLM generated python code

* Stop LLM Generated Code from Having Any Additional Imports

---------

Co-authored-by: christopherholland-workday <[email protected]>
2026-03-05 09:05:59 -08:00
yau-wd 84758d794d Fix server Jest test structure and standardize test scripts (#5909)
* fix(server): restructure Jest tests and standardize test scripts

* chore(main.yml): run build before test
2026-03-05 18:18:18 +08:00
tianwei-liu d8da27c0fb refactor: Extract loadNodesFromDir() from NodesPool for reuse (#5904)
Move node-loading and filtering logic into a public loadNodesFromDir(dir)
method so extensions can load nodes from additional directories
2026-03-04 16:05:45 -08:00
Jocelyn Lin 529459294a fix(workflow): enhance file change detection logic in proprietary-path-guard (#5907)
fix(workflow): enhance file change detection logic in proprietary-path-guard.yml

- Update the logic to fall back to default branch comparison when the before SHA is unreachable, ensuring robust detection of changed files during CI workflows.
2026-03-04 15:22:41 -08:00
Ginna 0167e3ac84 bugfix(agentflow): packaage.json sideEffects includes nested css (#5899)
* CSS side effect is any nested css

* Update packages/agentflow/package.json sideEffects to check /dist for css
2026-03-04 11:37:20 -07:00
Jocelyn LinandClaude Opus 4.6 3ef1495fdc feat(agentflow): add field visibility engine with show/hide conditions (#5890)
* feat(agentflow): add field visibility engine with show/hide conditions

Add InputParam show/hide condition support that controls field visibility
based on current input values. Includes regex, array, boolean, and nested
path matching with parity to upstream genericHelper.js.

- Add fieldVisibility utility (evaluateFieldVisibility, stripHiddenFieldValues)
- Add show/hide fields to InputParam type
- Integrate visibility into EditNodeDialog (re-evaluate on change, preserve
  hidden values in state)
- Update useOpenNodeEditor to fall back to node.data.inputs when API schema
  is unavailable
- Move connectionValidation from utils/ to validation/
- Skip hidden params in validateNode required-input checks
- Add CustomNodeExample demo with live visibility state panel
- Update ARCHITECTURE.md and TESTS.md

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* address gemini review feedbacks

* address review feedback

* fix(agentflow): build ReDoS test patterns dynamically to avoid CodeQL flag

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix(agentflow): harden ReDoS detection and fix falsy required-input check

- Replace regex-based nested quantifier detection with a character-by-character
  parser that catches bypass patterns like (a|aa)+ and (a+ )+
- Fix required-input validation to use nullish check (== null || === '')
  instead of falsy check (!value), allowing 0 and false as valid inputs

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-03-04 10:35:12 -08:00
chiragjaggaandHenry 07ef4bbec8 Add support for azure blob storage and storage refactor (#5604)
* storageUtils functions azure storage

* interface, base and local storage provider

* s3 storage provider

* gcs, azure storage provider

* refactor final changes

* fix gcs path bug

* gemini and lint fixes

* documentation changes

* update pnpm lock

* update azure winston to ESM imports

---------

Co-authored-by: Henry <[email protected]>
2026-03-04 21:58:08 +08:00
Jocelyn Linandgemini-code-assist[bot] 4d857f88c5 chore(agentflow): update ESLint configuration to include root and markdown plugin (#5881)
* chore(agentflow): update ESLint configuration to include root and markdown plugin

* Update packages/agentflow/.eslintrc.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-02 17:48:07 -08:00
christopherholland-workday 219b040065 fix: Control default deny list via an env var (#5862)
* Control default deny list via an env var

* fix: Control default deny list via an env var

---------
2026-03-02 14:44:34 -08:00
Jocelyn Lin d6ee01532d test(agentflow): update tests to remove console warnings (#5878)
* test(agentflow): update ConnectionLine and GenerateFlowDialog tests to use SvgWrapper for rendering

- Modified tests for ConnectionLine to wrap components in SvgWrapper for proper rendering of SVG elements.
- Updated GenerateFlowDialog tests to include async wait for chat models to be loaded before assertions.
- Enhanced test coverage and reliability by ensuring correct rendering contexts for components.

* address gemini review comments
2026-03-02 11:06:52 -08:00
Jocelyn Lin 86e9fae0ba refactor(agentflow): enhance ESLint configuration and improve test coverage (#5866)
* refactor(agentflow): enhance ESLint configuration and improve test coverage

- Updated ESLint configuration to include TypeScript resolver for improved import handling.
- Added restrictions on importing from features to enforce architectural boundaries.
- Enhanced test coverage for various components, including ConnectionLine and NodeOutputHandles.
- Updated architecture documentation to reflect recent changes in file structure and component organization.

* fix build error (missing import)
2026-03-02 09:58:14 -08:00
Jocelyn Lin f0affbd4cb exclude pnpm lock file from prettier formatting (#5864)
Add .prettierignore file to exclude pnpm-lock.yaml from formatting; update pnpm-lock.yaml to use generated format
2026-03-02 15:18:06 +08:00
Jocelyn Lin 0549692082 refactor(agentflow): remove unused components, fix connector anchor bug (#5863)
refactor(agentflow): remove unused components, fix connector anchor bug, and enhance test coverage

- Deleted unused Input and ConfirmDialog components to streamline the codebase.
- Updated jest.config.js to improve coverage thresholds and exclude deprecated hooks.
- Enhanced test coverage for useAgentflow and AgentflowContext with new E2E tests.
- Adjusted architecture documentation to reflect the removal of components and updated file structure.
2026-02-27 15:12:51 -08:00
j-sanaa 86ac9f6220 Fix(agentflow): fix duplicate and drag bug and make behavior similar to v2 (#5850)
* Fix duplicate and drag bug

* Fix position of duplicate ndoe to same as v2

* enhance duplicateNode functionality with unique ID generation and position adjustments similar to v2

* enhance deleteNode functionality to clean up connected inputs and remove descendants

* Revert changes to deleteNode

* Modify tests to have a nested structure rather than a flat one
2026-02-27 09:38:39 -08:00
tianwei-liu c24fbe5386 fix(agentflow): correct streaming field default of chat model configs in LLM node (#5856) 2026-02-27 09:25:34 -08:00
christopherholland-workdayandchristopherholland-workday af2d2f62d6 Fix polynomial regular expressions used on user controlled data (#5857)
* Fix polynomial regular expressions used on user controlled data

* Fix polynomial regular expressions used on user controlled data

* Fix polynomial regular expressions used on user controlled data

---------

Co-authored-by: christopherholland-workday <[email protected]>
2026-02-27 08:37:19 -08:00
11261d20d2 fix(analytics): Capture token usage and model name for Langfuse, LangSmith, and other providers (fixes #5763) (#5764)
* fix(analytics): capture token usage and model for Langfuse, LangSmith, and other providers

What changed
------------
- handler.ts: Extended onLLMEnd() to accept string | structured output. When
  structured output is passed, we now extract content, usageMetadata (input/
  output/total tokens), and responseMetadata (model name) and forward them
  to all analytics providers. Added usage/model to Langfuse generation.end(),
  LangSmith llm_output, and token attributes for Lunary, LangWatch, Arize,
  Phoenix, and Opik. Call langfuse.flushAsync() after generation.end() so
  updates are sent before the request completes.
- LLM.ts: Pass full output object from prepareOutputObject() to onLLMEnd
  instead of finalResponse string, so usage and model are available.
- Agent.ts: Same as LLM.ts — pass output object to onLLMEnd.
- ConditionAgent.ts: Build analyticsOutput with content, usageMetadata, and
  responseMetadata from the LLM response and pass to onLLMEnd.
- handler.test.ts: Added unit tests for the extraction logic (string vs
  object, token field normalization, model name sources, missing fields).
  OpenAIAssistant.ts call sites unchanged (Assistants API; no usage data).

Why
---
Fixes #5763. Analytics (Langfuse, LangSmith, etc.) were only receiving
plain text from onLLMEnd; usage_metadata and response_metadata from
AIMessage were dropped, so token counts and model names were missing in
dashboards and cost tracking.

Testing
-------
- pnpm build succeeds with no TypeScript errors.
- Manual: Flowise started, Agentflow with ChatOpenAI run; LangSmith and
  Langfuse both show token usage and model on the LLM generation.
- Backward compatible: call sites that pass a string (e.g. OpenAIAssistant)
  still work; onLLMEnd treats string as content-only.

Co-authored-by: Cursor <[email protected]>

* refactor(analytics): address PR review feedback for token usage handling

- LangSmith: Only include token_usage properties that have defined values
  to avoid passing undefined to the API
- Extract common OpenTelemetry span logic into _endOtelSpan helper method
  used by arize, phoenix, and opik providers

Co-authored-by: Cursor <[email protected]>

* fix(analytics): LangSmith cost tracking and flow name in traces

- LangSmith: set usage_metadata and ls_model_name/ls_provider on run extra.metadata
  so LangSmith can compute costs from token counts (compatible with langsmith 0.1.6
  which has no end(metadata) param). Infer ls_provider from model name.
- buildAgentflow: use chatflow.name as analytics trace/run name instead of
  hardcoded 'Agentflow' so LangSmith and Langfuse show the Flowise flow name.

Co-authored-by: Cursor <[email protected]>

* update handlers to include model and provider for analytics

* fix: normalize provider names in analytics handler to include 'amazon_bedrock'

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Henry <[email protected]>
2026-02-27 19:26:35 +08:00
EveandHenry Heng 56b04e2836 fix(agentflow): prevent ConditionAgent silent failure when no scenario matches (#5760)
* fix(agentflow): prevent ConditionAgent from silently dropping when no scenario matches

the ConditionAgent was doing strict exact string matching against
scenario descriptions, but LLMs often return abbreviated or slightly
different versions of the scenario text. when nothing matched, all
branches got marked as unfulfilled and the flow silently terminated
with no response.

added fallback matching (startsWith, includes) so partial matches
still route correctly, plus a last-resort else branch so the flow
never just dies silently. also added a safety net in the execution
engine to catch the case where all conditions are unfulfilled.

fixes #5620

* refactor: normalize output once and drop unnecessary any casts

- normalize calledOutputName once before all matching steps instead of
  calling toLowerCase().trim() repeatedly
- remove explicit any types where inference handles it

* test(agentflow): cover ConditionAgent scenario matching fallbacks

* Update matchScenario.test.ts

* Update matchScenario.ts

---------

Co-authored-by: Henry Heng <[email protected]>
2026-02-27 19:01:29 +08:00
Aadil-HasunandHenry Heng e131fca476 fix(components): add missing regex handler to Condition node (#5651)
* fix(components): add missing regex handler to Condition node
The Condition agentflow node's Regex operation was not functional because
compareOperationFunctions was missing the regex handler.
Changes:
- Added regex handler with unescapeRegexPattern helper function
- Handles Flowise's escaping of regex metacharacters
- Gracefully returns false for invalid regex patterns
- Added 22 unit tests
Fixes #5650

* refactor: address code review feedback
- Move unescapeRegexPattern to module level for performance
- Restrict unescaping to only [, ], * (verified by UI testing)
- Use nodeClass from beforeEach in all tests for consistency
- Add else condition assertions for non-matching tests
- Add test for escaped asterisk

* Delete packages/components/nodes/agentflow/Condition/Condition.test.ts

* Update Condition.ts

---------

Co-authored-by: Henry Heng <[email protected]>
2026-02-27 07:53:51 +08:00
6a63dbbf86 Add protections for loop-bound injections (#5849)
* Add protections for loop-bound injections

* Update packages/server/src/services/evaluations/index.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update packages/server/src/services/evaluations/index.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Add protections for loop-bound injections

* Add protections for loop-bound injections

---------

Co-authored-by: christopherholland-workday <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-26 15:03:08 -08:00
Stanislav Chernov 942c75ed50 fix: Improve error message for 401 / invalid API key (avoid "local ... (#5808)
fix: improve 401 error message clarity for invalid API keys
The previous error message mentioned "local model configuration"
which could confuse users who don't use local models. The new message
clearly directs users to check their API key and model access.
Fixes FlowiseAI/Flowise#5776
2026-02-27 07:00:25 +08:00
Daniel Bates 9a130ed47e Fix #5704: Agentflow v2 {{ variables }} not being interpolated (#5818)
Fix #5704: interpolate {{ variables }} for HumanInput node in 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.
2026-02-27 06:40:41 +08:00
6010a97d29 Potential fix for code scanning alert no. 84: Unvalidated dynamic method call (#5746)
* Potential fix for code scanning alert no. 84: Unvalidated dynamic method call

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 84: Unvalidated dynamic method call#5746

* Potential fix for code scanning alert no. 100: Unvalidated dynamic method call

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 84: Unvalidated dynamic method call#5746

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: christopherholland-workday <[email protected]>
2026-02-26 14:21:57 -08:00