dify - ✅(Solved) Fix [Refactor/Chore] Adapt API integration for Graphon 0.2.2 [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35376Fetched 2026-04-18 05:57:58
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
1
Author
Participants
Assignees
Timeline (top)
referenced ×2assigned ×1cross-referenced ×1renamed ×1

Upgrade the backend API integration layer to Graphon 0.2.2 and adapt Dify-owned workflow code to the new Graphon contracts.

This includes migrating node construction to the current Graphon node_id plus typed node_data APIs, aligning backend call sites with renamed Graphon parameters and module paths, and replacing previous dynamic compatibility hooks with explicit Dify-owned adapters at workflow and model boundaries.

Root Cause

Upgrade the backend API integration layer to Graphon 0.2.2 and adapt Dify-owned workflow code to the new Graphon contracts.

This includes migrating node construction to the current Graphon node_id plus typed node_data APIs, aligning backend call sites with renamed Graphon parameters and module paths, and replacing previous dynamic compatibility hooks with explicit Dify-owned adapters at workflow and model boundaries.

Fix Action

Fixed

PR fix notes

PR #35377: chore(api): adapt Graphon 0.2.2 upgrade

Description (problem / solution / changelog)

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes #35376

Adapt the backend API layer to Graphon 0.2.2 while preserving Dify workflow behavior.

Key backend changes in this PR:

  • migrate workflow node construction to the current Graphon node_id plus typed node_data APIs
  • replace dynamic compatibility hooks with explicit Dify-owned adapters at workflow and model boundaries
  • preserve the historical Excel per-sheet fallback behavior through a workflow-local document extractor node
  • rebuild historical serialized file payloads through explicit model-boundary helpers
  • align backend tests with Graphon 0.2.2 constructor, payload, and adapter contracts

Screenshots

BeforeAfter
N/AN/A

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 make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

From Codex

Changed files

  • api/core/agent/base_agent_runner.py (modified, +1/-1)
  • api/core/app/app_config/easy_ui_based_app/model_config/converter.py (modified, +1/-1)
  • api/core/app/apps/agent_chat/app_runner.py (modified, +1/-1)
  • api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py (modified, +1/-1)
  • api/core/app/workflow/layers/persistence.py (modified, +1/-1)
  • api/core/datasource/datasource_manager.py (modified, +2/-2)
  • api/core/entities/provider_configuration.py (modified, +1/-1)
  • api/core/helper/code_executor/template_transformer.py (modified, +1/-1)
  • api/core/helper/moderation.py (modified, +1/-1)
  • api/core/model_manager.py (modified, +6/-6)
  • api/core/plugin/impl/model_runtime.py (modified, +3/-3)
  • api/core/prompt/agent_history_prompt_transform.py (modified, +1/-1)
  • api/core/rag/embedding/cached_embedding.py (modified, +1/-1)
  • api/core/rag/index_processor/processor/paragraph_index_processor.py (modified, +2/-2)
  • api/core/rag/retrieval/dataset_retrieval.py (modified, +3/-3)
  • api/core/rag/splitter/fixed_text_splitter.py (modified, +1/-1)
  • api/core/repositories/human_input_repository.py (modified, +1/-1)
  • api/core/tools/tool_file_manager.py (modified, +1/-1)
  • api/core/tools/utils/model_invocation_utils.py (modified, +1/-1)
  • api/core/workflow/human_input_adapter.py (renamed, +73/-15)
  • api/core/workflow/node_factory.py (modified, +28/-9)
  • api/core/workflow/node_runtime.py (modified, +2/-2)
  • api/core/workflow/nodes/agent/agent_node.py (modified, +4/-5)
  • api/core/workflow/nodes/datasource/datasource_node.py (modified, +5/-5)
  • api/core/workflow/nodes/document_extractor/__init__.py (added, +18/-0)
  • api/core/workflow/nodes/document_extractor/node.py (added, +195/-0)
  • api/core/workflow/nodes/knowledge_index/knowledge_index_node.py (modified, +9/-4)
  • api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py (modified, +5/-5)
  • api/factories/file_factory/builders.py (modified, +10/-10)
  • api/models/human_input.py (modified, +1/-1)
  • api/models/utils/file_input_compat.py (modified, +121/-7)
  • api/models/workflow.py (modified, +8/-5)
  • api/pyproject.toml (modified, +1/-1)
  • api/services/app_service.py (modified, +1/-1)
  • api/services/dataset_service.py (modified, +1/-1)
  • api/services/human_input_delivery_test_service.py (modified, +1/-1)
  • api/services/rag_pipeline/rag_pipeline.py (modified, +1/-1)
  • api/services/variable_truncator.py (modified, +1/-1)
  • api/services/workflow_draft_variable_service.py (modified, +4/-4)
  • api/services/workflow_service.py (modified, +8/-7)
  • api/tasks/mail_human_input_delivery_task.py (modified, +1/-1)
  • api/tests/integration_tests/core/workflow/nodes/datasource/test_datasource_node_integration.py (modified, +11/-13)
  • api/tests/integration_tests/workflow/nodes/test_code.py (modified, +3/-2)
  • api/tests/integration_tests/workflow/nodes/test_http.py (modified, +5/-5)
  • api/tests/integration_tests/workflow/nodes/test_llm.py (modified, +3/-2)
  • api/tests/integration_tests/workflow/nodes/test_parameter_extractor.py (modified, +3/-2)
  • api/tests/integration_tests/workflow/nodes/test_template_transform.py (modified, +3/-2)
  • api/tests/integration_tests/workflow/nodes/test_tool.py (modified, +3/-2)
  • api/tests/test_containers_integration_tests/core/repositories/test_human_input_form_repository_impl.py (modified, +1/-1)
  • api/tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py (modified, +6/-6)
  • api/tests/test_containers_integration_tests/factories/test_storage_key_loader.py (modified, +2/-2)
  • api/tests/test_containers_integration_tests/repositories/test_sqlalchemy_execution_extra_content_repository.py (modified, +1/-1)
  • api/tests/test_containers_integration_tests/services/test_human_input_delivery_test.py (modified, +1/-1)
  • api/tests/test_containers_integration_tests/services/test_human_input_delivery_test_service.py (modified, +1/-1)
  • api/tests/test_containers_integration_tests/tasks/test_mail_human_input_delivery_task.py (modified, +1/-1)
  • api/tests/unit_tests/controllers/console/app/test_workflow.py (modified, +1/-1)
  • api/tests/unit_tests/controllers/console/app/workflow_draft_variables_test.py (modified, +4/-4)
  • api/tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py (modified, +2/-2)
  • api/tests/unit_tests/core/app/apps/test_pause_resume.py (modified, +24/-18)
  • api/tests/unit_tests/core/app/workflow/test_file_runtime.py (modified, +2/-2)
  • api/tests/unit_tests/core/app/workflow/test_node_factory.py (modified, +2/-2)
  • api/tests/unit_tests/core/datasource/test_datasource_manager.py (modified, +2/-2)
  • api/tests/unit_tests/core/entities/test_entities_model_entities.py (modified, +1/-1)
  • api/tests/unit_tests/core/file/test_models.py (modified, +17/-23)
  • api/tests/unit_tests/core/model_runtime/test_model_provider_factory.py (modified, +6/-6)
  • api/tests/unit_tests/core/plugin/test_model_runtime_adapter.py (modified, +1/-1)
  • api/tests/unit_tests/core/plugin/utils/test_chunk_merger.py (modified, +3/-3)
  • api/tests/unit_tests/core/prompt/test_advanced_prompt_transform.py (modified, +10/-10)
  • api/tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py (modified, +1/-1)
  • api/tests/unit_tests/core/prompt/test_prompt_transform.py (modified, +1/-1)
  • api/tests/unit_tests/core/repositories/test_human_input_form_repository_impl.py (modified, +1/-1)
  • api/tests/unit_tests/core/repositories/test_human_input_repository.py (modified, +1/-1)
  • api/tests/unit_tests/core/test_file.py (modified, +2/-2)
  • api/tests/unit_tests/core/variables/test_segment.py (modified, +29/-7)
  • api/tests/unit_tests/core/variables/test_segment_type_validation.py (modified, +1/-1)
  • api/tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py (modified, +17/-16)
  • api/tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py (modified, +5/-4)
  • api/tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py (modified, +8/-8)
  • api/tests/unit_tests/core/workflow/nodes/answer/test_answer.py (modified, +7/-11)
  • api/tests/unit_tests/core/workflow/nodes/datasource/test_datasource_node.py (modified, +11/-13)
  • api/tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py (modified, +5/-5)
  • api/tests/unit_tests/core/workflow/nodes/human_input/test_email_delivery_config.py (modified, +1/-1)
  • api/tests/unit_tests/core/workflow/nodes/human_input/test_entities.py (modified, +37/-17)
  • api/tests/unit_tests/core/workflow/nodes/human_input/test_human_input_form_filled_event.py (modified, +27/-8)
  • api/tests/unit_tests/core/workflow/nodes/iteration/test_iteration_child_engine_errors.py (modified, +9/-11)
  • api/tests/unit_tests/core/workflow/nodes/knowledge_index/test_knowledge_index_node.py (modified, +55/-36)
  • api/tests/unit_tests/core/workflow/nodes/knowledge_retrieval/test_knowledge_retrieval_node.py (modified, +26/-26)
  • api/tests/unit_tests/core/workflow/nodes/list_operator/node_spec.py (modified, +61/-91)
  • api/tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py (modified, +5/-3)
  • api/tests/unit_tests/core/workflow/nodes/llm/test_node.py (modified, +18/-29)
  • api/tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py (modified, +54/-47)
  • api/tests/unit_tests/core/workflow/nodes/template_transform/test_template_transform_node.py (modified, +9/-10)
  • api/tests/unit_tests/core/workflow/nodes/test_base_node.py (modified, +29/-36)
  • api/tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py (modified, +14/-12)
  • api/tests/unit_tests/core/workflow/nodes/test_if_else.py (modified, +31/-45)
  • api/tests/unit_tests/core/workflow/nodes/test_list_operator.py (modified, +16/-16)
  • api/tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py (modified, +17/-23)
  • api/tests/unit_tests/core/workflow/nodes/tool/test_tool_node.py (modified, +12/-8)
  • api/tests/unit_tests/core/workflow/nodes/trigger_plugin/test_trigger_event_node.py (modified, +13/-18)
  • api/tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py (modified, +2/-11)
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Description

Upgrade the backend API integration layer to Graphon 0.2.2 and adapt Dify-owned workflow code to the new Graphon contracts.

This includes migrating node construction to the current Graphon node_id plus typed node_data APIs, aligning backend call sites with renamed Graphon parameters and module paths, and replacing previous dynamic compatibility hooks with explicit Dify-owned adapters at workflow and model boundaries.

Motivation

Graphon was extracted from this repository and has accumulated breaking changes since the split. The API layer still depended on a mix of legacy constructor signatures, historical file payload shapes, and older human-input payload conventions.

Without a dedicated adaptation pass, upgrading to Graphon 0.2.2 would break workflow node construction, file payload deserialization, human-input handling, and several workflow-specific node behaviors. This refactor keeps the business behavior stable while moving the backend implementation onto the current Graphon interfaces.

Additional Context

Scope of the adaptation work:

  • update the API package dependency and lockfile for Graphon 0.2.2
  • migrate workflow node creation to typed node data and explicit node_id construction
  • preserve Dify-specific Excel document extraction behavior through a workflow-local document extractor node
  • add explicit file payload rebuilding helpers for historical serialized graph and workflow payloads
  • rename and narrow the human-input adapter layer and align human-input service paths to use it consistently
  • update affected backend unit and integration tests for the new Graphon contracts

Validation performed during implementation included targeted Ruff checks and targeted pytest batches covering node factory behavior, workflow service human-input flows, document extractor regressions, file payload rebuilding, and Graphon migration regressions.

extent analysis

TL;DR

Upgrade the backend API integration layer to Graphon 0.2.2 and adapt Dify-owned workflow code to the new Graphon contracts to maintain business behavior stability.

Guidance

  • Update the API package dependency and lockfile for Graphon 0.2.2 to ensure compatibility with the latest Graphon interfaces.
  • Migrate workflow node creation to use typed node data and explicit node_id construction, replacing legacy constructor signatures.
  • Preserve Dify-specific Excel document extraction behavior by implementing a workflow-local document extractor node.
  • Verify the changes by running targeted Ruff checks and pytest batches covering node factory behavior, workflow service human-input flows, and Graphon migration regressions.

Example

No code snippet is provided as the issue does not contain specific code examples.

Notes

The adaptation work requires careful consideration of the changes introduced in Graphon 0.2.2, including renamed parameters and module paths, to ensure a smooth transition.

Recommendation

Apply the workaround by upgrading to Graphon 0.2.2 and adapting the Dify-owned workflow code to the new Graphon contracts, as this will maintain business behavior stability and ensure compatibility with the latest Graphon interfaces.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING