[PR #24648] feat: enhance workflow error handling and internationalization #30728

Closed
opened 2026-02-21 20:48:06 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/24648

State: closed
Merged: Yes


Summary

This PR enhances user experience by replacing technical 'Start node not found' errors with user-friendly toast notifications and improves onboarding documentation links with proper internationalization support.

Key Improvements

🔧 Enhanced Error Handling

  • Replace technical console errors with user-friendly toast notifications
  • Add operation-specific error messages (connecting nodes, adding nodes, modifying workflow, updating workflow)
  • Maintain complete backward compatibility while providing graceful error handling

🌐 Complete Internationalization Support

  • Add translation keys for error messages in English, Chinese, and Japanese
  • Replace hardcoded 'Learn more' button with internationalized documentation links
  • Support language-specific documentation URLs with correct paths

📖 Documentation Link Improvements

  • Fix documentation URL path to use correct 'guides/workflow/node/start'
  • Add real functionality to replace console.log placeholder
  • Provide language-appropriate documentation links for users

Technical Details

Error Handling Flow:

User Action → safeCheckParallelLimit → Detect 'Start node not found' 
→ handleStartNodeMissingError → Show Localized Toast → Block Operation Gracefully

Translation System:

operationKey → t(`workflow.error.operations.${operationKey}`) 
→ Localized Operation Description → t('workflow.error.startNodeRequired', {operation})

Documentation Links:

  • English: https://docs.dify.ai/en/guides/workflow/node/start
  • Chinese: https://docs.dify.ai/zh-hans/guides/workflow/node/start
  • Japanese: https://docs.dify.ai/ja-jp/guides/workflow/node/start

Files Modified

  • app/components/workflow/hooks/use-nodes-interactions.ts - Enhanced error handling
  • app/components/workflow-app/components/workflow-onboarding-modal/index.tsx - Improved documentation links
  • i18n/en-US/workflow.ts - Added English translations
  • i18n/zh-Hans/workflow.ts - Added Chinese translations
  • i18n/ja-JP/workflow.ts - Added Japanese translations

User Experience Impact

Before:

  • Technical error in console: 'Start node not found'
  • Hardcoded English 'Learn more' button with no functionality
  • Users unable to understand what went wrong or how to fix it

After:

  • User-friendly toast: '请先添加开始节点,然后再连接节点' (Chinese example)
  • Functional documentation links in user's language
  • Clear guidance on what action is needed

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/24648 **State:** closed **Merged:** Yes --- ## Summary This PR enhances user experience by replacing technical 'Start node not found' errors with user-friendly toast notifications and improves onboarding documentation links with proper internationalization support. ### Key Improvements **🔧 Enhanced Error Handling** - Replace technical console errors with user-friendly toast notifications - Add operation-specific error messages (connecting nodes, adding nodes, modifying workflow, updating workflow) - Maintain complete backward compatibility while providing graceful error handling **🌐 Complete Internationalization Support** - Add translation keys for error messages in English, Chinese, and Japanese - Replace hardcoded 'Learn more' button with internationalized documentation links - Support language-specific documentation URLs with correct paths **📖 Documentation Link Improvements** - Fix documentation URL path to use correct 'guides/workflow/node/start' - Add real functionality to replace console.log placeholder - Provide language-appropriate documentation links for users ### Technical Details **Error Handling Flow:** ``` User Action → safeCheckParallelLimit → Detect 'Start node not found' → handleStartNodeMissingError → Show Localized Toast → Block Operation Gracefully ``` **Translation System:** ``` operationKey → t(`workflow.error.operations.${operationKey}`) → Localized Operation Description → t('workflow.error.startNodeRequired', {operation}) ``` **Documentation Links:** - English: `https://docs.dify.ai/en/guides/workflow/node/start` - Chinese: `https://docs.dify.ai/zh-hans/guides/workflow/node/start` - Japanese: `https://docs.dify.ai/ja-jp/guides/workflow/node/start` ### Files Modified - `app/components/workflow/hooks/use-nodes-interactions.ts` - Enhanced error handling - `app/components/workflow-app/components/workflow-onboarding-modal/index.tsx` - Improved documentation links - `i18n/en-US/workflow.ts` - Added English translations - `i18n/zh-Hans/workflow.ts` - Added Chinese translations - `i18n/ja-JP/workflow.ts` - Added Japanese translations ### User Experience Impact **Before:** - Technical error in console: 'Start node not found' - Hardcoded English 'Learn more' button with no functionality - Users unable to understand what went wrong or how to fix it **After:** - User-friendly toast: '请先添加开始节点,然后再连接节点' (Chinese example) - Functional documentation links in user's language - Clear guidance on what action is needed ## Checklist - [x] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:48:06 -05:00
yindo closed this issue 2026-02-21 20:48:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30728