Skip to content

Migrate Custom Assistants to Agents#6163

Draft
HenryHengZJ wants to merge 27 commits intofeature/SmartAgentsfrom
feature/Migrate-Custom-Assistants-to-Agents
Draft

Migrate Custom Assistants to Agents#6163
HenryHengZJ wants to merge 27 commits intofeature/SmartAgentsfrom
feature/Migrate-Custom-Assistants-to-Agents

Conversation

@HenryHengZJ
Copy link
Copy Markdown
Contributor

@HenryHengZJ HenryHengZJ commented Apr 6, 2026

FLOWISE-457

Summary

  • Rebrand "Custom Assistant" to "Agents" with new /agents route as the default landing page
  • Migrate from dual-table (assistant + chatflow) to single chatflow table architecture with type='AGENT'
  • Replace Custom Assistant's ToolAgent-based chatflow with agentflow Agent node (startAgentflow + agentAgentflow). This allows built in executions
  • Add dedicated agents RBAC permission group with DB migration via SQL REPLACE for production scale
  • Add Agent type to marketplace templates with view-only preview and "Use Template" flow
agents_flowise.mp4

Key Changes

Architecture Simplification

  • Agents now load exclusively from the chatflow table — no assistant table dependency
  • Old format (toolAgent nodes) parsed on load, silently converted to new agentflow format on save
  • Server getAllChatflows('AGENT') returns both legacy ASSISTANT and new AGENT type records

UI — Agent Configure Page

  • Full form-based configure page with Select Model, Instructions, Built-in Tools, Tools, Knowledge (Document Stores & Vector Embeddings), Memory, Structured Output
  • All field options (built-in tools, memory types, structured output types) fetched dynamically from server node definitions — no hardcoded constants
  • Inline agent name editing with immediate DB persistence
  • Load Agent from JSON file (new agents only), Export Agent with type validation
  • Template preview mode (view-only) with "Use Template" button

Permissions

  • New agents permission group (view, create, update, duplicate, delete, export, import, config, domains)
  • DB migration maps existing assistants:*agents:* using SQL REPLACE (O(1) bulk, scales to millions)
  • Permission display order matches navbar: Agents → Agentflows → Executions → Chatflows
  • Chatflows API routes updated with agents:* permission checks

Marketplace

  • New Agent template type with dedicated filter chip
  • Agent templates open in view-only preview at /marketplace/agents/:id
  • "Use Template" navigates to /agents/new with fields populated
  • Community agent templates directory (marketplaces/agents/)

Evaluations

  • Flow selection now uses chatflows API instead of assistants API
  • Server-side evaluation checks updated for chatflow-based agent IDs

Export/Import

  • Exported JSON now includes type field (CHATFLOW, AGENTFLOW, AGENT, MULTIAGENT)
  • Import validates type — prevents loading wrong flow type into wrong canvas
  • Credentials redacted from exported JSON (both credential and FLOWISE_CREDENTIAL_ID keys)

Execution Details

  • Agent executions link to /agents/:id instead of /v2/agentcanvas/:id

Test plan

  • Create new agent at /agents/new → configure → save → verify chatflow created with type AGENT
  • Open existing old custom assistant → fields load correctly from old toolAgent format → save converts to new format
  • Verify model credential, tool credentials, document stores, vector embeddings all display correctly
  • Export agent → JSON contains "type": "AGENT" and no credentials
  • Load agent JSON into chatflow canvas → rejected with error
  • Save agent as template → appears in marketplace as "Agent" type
  • Click agent template → view-only preview → "Use Template" → populates /agents/new
  • Create evaluation with agent flows → runs correctly
  • Verify permissions: new role shows agents group first, existing roles have agents:* after migration
  • Verify migrations working correctly for PostgresQL, MariaDB, MySQL

Follow up

  • Preview chat shows agent reasoning messages. This is not possible for now due to some zIndex issue on the chatembed side with the titlebar and modal pop up

- Replace dual-table (assistant + chatflow) with single chatflow table for Agents.
- Add /agents route as default landing page
- Full configure page with dynamic field options from server node definitions
- Dedicated agents RBAC permission group
- Agent marketplace template type with view-only preview, type-validated export/import, and evaluation updates.
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 rebrands "Custom Assistants" to "Agents" across the application, introducing a new "Agent" chatflow type and updating the UI, server logic, and database migrations accordingly. Key changes include the addition of an AgentListMenu component, new routes for agents, and updated RBAC permissions. Feedback focuses on fixing incorrect prop usage in CustomAssistantLayout.jsx, adding error handling for marketplace JSON parsing, implementing rollback logic in database migrations, and ensuring consistent permission naming.

Comment thread packages/ui/src/views/assistants/custom/CustomAssistantLayout.jsx Outdated
Comment thread packages/server/src/services/marketplaces/index.ts
Comment thread packages/ui/src/views/assistants/custom/CustomAssistantLayout.jsx Outdated
HenryHengZJ and others added 2 commits April 6, 2026 23:28
…ents permission additions

- Wrap all marketplace template JSON parsing in try-catch to prevent a single malformed file from crashing the entire marketplace
- Remove incompatible AgentListMenu from legacy CustomAssistantLayout
@HenryHengZJ
Copy link
Copy Markdown
Contributor Author

/gemini review

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 rebrands "Custom Assistant" to "Agent" across the application, involving updates to UI components, routes, and menu items. Server-side logic and database migrations have been implemented to support the new AGENT chatflow type while maintaining backward compatibility for legacy ASSISTANT records. Additionally, "Chatflow Latency" is renamed to "Flow Latency" in evaluators, and validation has been added for flow file imports. Feedback was provided to avoid hardcoded hex colors in the new Agents view, recommending the use of theme-based colors for better consistency across different display modes.

Comment thread packages/ui/src/views/agents/index.jsx Outdated
@HenryHengZJ HenryHengZJ changed the base branch from main to feature/SmartAgents April 11, 2026 12:53
HenryHengZJ and others added 16 commits April 11, 2026 13:53
* add compact table transformer for NotionAPILoader
.

* fix: improve table transformation logic in NotionAPILoader

* fix: improve table transformation logic in NotionAPILoader

* fix: improve table transformation logic in NotionAPILoader
include action metadata from API responses
silent fallback to vm2 for sandbox execution
* feat(components): add Baidu Qianfan embeddings node

* fix(components): preserve explicit numeric values in Baidu embeddings

* Improve Qianfan embedding defaults and guidance
…y state (#6210)

- Implemented auto-add functionality for Start node in Agentflow when creating a new canvas.
- Updated default values for number and options types to return empty strings instead of zero or first option name.
- Adjusted MessagesInput and ArrayInput tests to reflect changes in default values.
release@3.1.2

Co-authored-by: yau-wd <yau.ong@workday.com>
* fix(server): clickjacking

* fix(XSS.ts): handle CSV and null values in getAllowedIframeOrigins
…Edge, and duplicateNode actions (#6211)

* fix(agentflow): add onFlowChange notifications for deleteNode, deleteEdge, and duplicateNode actions

- Updated context state management to include viewport information during flow changes.
- Improved test coverage for flow change notifications to ensure correct behavior on node and edge modifications.

* address gemini comment
… node (#6212)

- Enhanced Start node to include a client property for the form input option, allowing differentiation between 'agentflowv2' and 'agentflowsdk'.
- Added tests to verify that the 'formInput' option is correctly filtered based on the client type.
* feat: turn chatflow into MCP server

- Added '@modelcontextprotocol/sdk' version 1.12.0
- Added 'zod' version 3.25.32
- Added migrations for MCP server config
- Added MCP endpoints (Streamable HTTP and SSE)
- Added MCP server configuration tab
- Added unit tests for MCP endpoints and services

* feat: Implement MCP endpoint service with SSE support

- Added a new MCP endpoint service to handle requests for chatflows, including support for SSE (Server-Sent Events) and stateless transport.
- Introduced functions for handling MCP requests, SSE connections, and message routing.
- Implemented error handling for service errors and session management for SSE.
- Created unit tests for the MCP server service, covering configuration CRUD operations and token management.
- Updated the MCP server configuration logic to ensure proper validation and error handling.
- Refactored the UI component to utilize a new API hook for fetching MCP server configuration.

* chore: handle error when get mcp server config

* - Introduced a new chat type 'MCP' in the ChatType enum, including UI filters and backend processing.
- Updated the zod dependency version specification to support both ^3.25.76 and ^4.
- Fix setHasExistingConfig

* fix: update chatflowCallback to enable chatflow building with active state for MCP

* refactor: remove deprecated SSE transport endpoints and related logic

- Removed handleGet and handleSseMessage methods from MCP endpoint controller.
- Updated MCP endpoint routes to eliminate SSE-related routes.
- Refactored service layer to remove SSE session management and related methods.
- Updated tests to remove references to deprecated SSE functionality.
- Adjusted UI component to remove SSE endpoint URL handling.

* chore: update MCP endpoint routes and references to align with new API structure

* chore: remove abortChatMessage when mcp request closed

* optimize mcpserver dialog for dark mode

* feat: implement form input schema generation for agentflow chatflows

---------

Co-authored-by: Henry <hzj94@hotmail.com>
jocelynlin-wd and others added 6 commits April 15, 2026 12:54
…xt to validate (#6224)

* feat(agentflow): optional cavasActions to allow additional buttons next to validate

- Updated Agentflow component to support canvasActions prop for rendering additional action buttons in the canvas overlay.
- Enhanced type definitions to include canvasActions in AgentflowProps.
- Added tests to verify the rendering of canvasActions in the Agentflow component.
- Added a new example  demonstrating custom FABs alongside the validation button.

* update jsdoc to match actual implementation
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* enhance ChatflowConfigurationDialog with new configuration sections and improved UI

* fix: remove background color override for MuiSvgIcon in dark mode
# Conflicts:
#	packages/server/src/database/migrations/mariadb/index.ts
#	packages/server/src/database/migrations/mysql/index.ts
#	packages/server/src/database/migrations/postgres/index.ts
#	packages/server/src/database/migrations/sqlite/index.ts
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.

6 participants