[PR #27078] feat: add passthrough parameter support for workflow tools #31659

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

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

State: closed
Merged: No


feat: add passthrough parameter support for workflow tools

Summary

This PR adds support for a generic passthrough parameter that can be passed from web UI inputs through the entire workflow execution chain to plugins. This enables seamless integration between external systems and Dify plugins, allowing data flow like: System A → Web → Dify → Plugin → System A.

Problem

Currently, there's no generic way to pass arbitrary data from the web UI through Dify workflows to plugins. This limits the ability to create seamless integrations where external systems need to pass context or authentication tokens to plugins.

Solution

Add a generic passthrough parameter that can be passed from web UI inputs through the entire workflow execution chain to plugins.

Use Case Example

  • Web application passes user authentication token
  • Dify workflow processes the request
  • Plugin receives the original token and calls external system
  • External system validates the token and returns data

Changes Made

  • Add PASSTHROUGH to SystemVariableKey enum
  • Add passthrough field to SystemVariable model
  • Extract passthrough from user_inputs in workflow service
  • Pass passthrough parameter through tool invocation chain
  • Add comprehensive unit and integration tests
  • Add documentation for passthrough feature

Testing

  • All existing tests pass
  • Added comprehensive unit tests for new functionality
  • Added integration tests for end-to-end passthrough flow
  • Manual testing completed

Documentation

  • Added feature documentation in English and Chinese
  • Updated relevant code comments

Breaking Changes

None - this is a purely additive feature that doesn't affect existing functionality.

Related Issue

Fixes #[ISSUE_NUMBER]

Screenshots

Before After
No way to pass arbitrary data from web UI to plugins Generic passthrough parameter enables seamless data flow

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/27078 **State:** closed **Merged:** No --- # feat: add passthrough parameter support for workflow tools ## Summary This PR adds support for a generic `passthrough` parameter that can be passed from web UI inputs through the entire workflow execution chain to plugins. This enables seamless integration between external systems and Dify plugins, allowing data flow like: **System A → Web → Dify → Plugin → System A**. ### Problem Currently, there's no generic way to pass arbitrary data from the web UI through Dify workflows to plugins. This limits the ability to create seamless integrations where external systems need to pass context or authentication tokens to plugins. ### Solution Add a generic `passthrough` parameter that can be passed from web UI inputs through the entire workflow execution chain to plugins. ### Use Case Example - Web application passes user authentication token - Dify workflow processes the request - Plugin receives the original token and calls external system - External system validates the token and returns data ## Changes Made - ✅ Add `PASSTHROUGH` to `SystemVariableKey` enum - ✅ Add `passthrough` field to `SystemVariable` model - ✅ Extract `passthrough` from `user_inputs` in workflow service - ✅ Pass `passthrough` parameter through tool invocation chain - ✅ Add comprehensive unit and integration tests - ✅ Add documentation for passthrough feature ## Testing - ✅ All existing tests pass - ✅ Added comprehensive unit tests for new functionality - ✅ Added integration tests for end-to-end passthrough flow - ✅ Manual testing completed ## Documentation - ✅ Added feature documentation in English and Chinese - ✅ Updated relevant code comments ## Breaking Changes None - this is a purely additive feature that doesn't affect existing functionality. ## Related Issue Fixes #[ISSUE_NUMBER] <!-- Replace with actual issue number after creating the issue --> ## Screenshots | Before | After | |--------|-------| | No way to pass arbitrary data from web UI to plugins | Generic `passthrough` parameter enables seamless data flow | ## 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:49:53 -05:00
yindo closed this issue 2026-02-21 20:49:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31659