To migrate a Dify application to LangStudio, you can use the automation script in this topic to migrate the basic structure. Then, you must manually configure and debug the application.
How it works
The migration process has two core stages: automated conversion and manual configuration.
-
Automated conversion: The automation script reads the Dify DSL file and converts it to the LangStudio application flow format. This step completes the initial migration of the node layout and basic connections.
-
Manual configuration: The two platforms have different environmental dependencies, such as Large Language Model (LLM) connections, knowledge bases, and MCP tools. Some node implementations also differ. You must manually recreate these dependencies in LangStudio based on the original Dify application. You also need to fine-tune and test some nodes to ensure the application is fully functional and runs correctly.
Step 1: Automated conversion
Import the file converted by the script into LangStudio. This creates an initial LangStudio application flow structure.
-
Export the application's DSL file from Dify. The file is usually in
.ymlformat. This topic uses a Dify application flow built from the QuestionClassifier+Knowledge+Chatbot template as an example. You can download the corresponding DSL file here: QuestionClassifier+Knowledge+Chatbot.yml. -
Download the migration script dify_to_langstudio.py and run the following command to convert the DSL file into a LangStudio application flow.
python dify_to_langstudio.py /path/to/dify_dsl.yml /path/to/output_dirWhere:
-
/path/to/dify_dsl.yml: The path to the DSL file. -
/path/to/output_dir: The specified output directory. After a successful execution, you can find thelangstudio_flow.zipfile in this directory.
-
-
Log on to LangStudio, go to the new application flow page, and select Import from OSS. Select the application flow path, upload and select the
langstudio_flow.zipfile that you generated, and enter a name to create the flow.
-
The initial version of the generated application flow is shown below.

Step 2: Manual configuration
After the automated conversion, you need to check and configure each node in the application flow.
Start
This corresponds to the LangStudio Start node.
For system variables in Dify, the migration method is as follows:
-
sys.files: LangStudio currently supports only single file types. To use a file list (Array[File]), you must create multiple single-file type variables.
-
sys.query: This is directly converted to the input field `question`.
-
sys.dialogue_count/sys.conversation_id
sys.user_id/sys.app_id/sys.workflow_id/sys.workflow_run_id: You can implement these using session variables in the global configuration of the LangStudio application flow.
Question classification
This corresponds to the LangStudio Intent Recognition node.
-
Model: This corresponds to Model Settings. You need to create the same LLM connection in LangStudio as in Dify. For more information, see Connection Configuration. Then, you can select it on the LLM node.
-
Classification: This corresponds to Multi-intent Configuration. You must confirm that the classification is consistent with the original Dify application.
-
Instruction: This corresponds to the Additional Prompt of the Intent Recognition node.
Knowledge retrieval
This corresponds to the LangStudio Knowledge Base Retrieval node.
-
You must recreate a knowledge base using the tools provided by LangStudio and then configure it in the node. For more information, see Knowledge base management.
-
Query variable: This is equivalent to the Retrieval Keyword of the knowledge base retrieval node.
LLM
This corresponds to the LangStudio Large Language Model node.
-
Model: You must create the same LLM connection in LangStudio as in Dify. For more information, see Connection configuration. Then, you can select it on the node.
-
Prompt: To use output variables from previous nodes in the prompt of a LangStudio Large Language Model node, you must first define them as input variables.
-
Retry on Failure: Dify supports a retry policy on failure, but LangStudio does not.
-
Vision: This is equivalent to the Vision Switch of the Large Language Model node.
-
Memory: This is equivalent to the Memory Window switch of the LLM node. You must first enable Session History.
-
Structured output: This is equivalent to the output variable definition of the Large Language Model node.
-
Output variable: A Dify LLM node returns the generated content and model usage information. LangStudio only returns the body of the model's response.
Direct reply
This corresponds to the LangStudio Direct Output node.
End
This corresponds to the LangStudio End node.
Dify's Chatflow does not support an end node. However, a LangStudio application flow must have an End node. You must connect the logical end nodes to the End node to explicitly declare the end of execution.
Code execution
This corresponds to the LangStudio Python node.
You can copy the Python code from Dify to LangStudio and add the @tool decoration and an output class definition.
-
Dify parses set input variables into input parameters for the Python code. LangStudio does the opposite. You must first define the inputs and outputs in the code. When the runtime starts, LangStudio automatically parses the code to generate the input and output parameters.
-
LangStudio does not support NodeJS.
Agent
This corresponds to the LangStudio Agent node.
-
Agent policy: Dify supports multiple policies. LangStudio only supports the `functioncall` and `react` policies.
-
Model: After creating an LLM connection in LangStudio that matches the one in Dify (see Connection Configuration), you can select it on an LLM node.
-
Tool List: Dify lets you select various built-in Tools and MCPs. LangStudio only supports MCP, and you must first create an MCP connection in LangStudio.
-
Instruction/Query: This is equivalent to the Prompt of the LangStudio Agent node.
-
Memory: This is equivalent to the memory switch of the Agent node.
Iteration
This corresponds to the LangStudio Loop node.
You can configure an additional `index` variable in the Loop node to traverse a List object. This simulates the logic of the Iteration node.
Document extractor
This corresponds to the LangStudio Document Parsing node.
-
You must select the Document for the Document Parsing node.
-
Model: You must create an OpenSearch connection in LangStudio to parse documents.
Conditional branch
This corresponds to the LangStudio Conditional Branch node.
You must configure the conditions in LangStudio based on the conditions in Dify.
More node details
-
Loop, Exit Loop, Variable Assignment, Variable Aggregation, and Direct Reply: These nodes are directly converted.
-
Template Transform, Parameter Extraction, HTTP Request, and List Operation: These nodes are not yet supported.
-
Other third-party tools: Not supported. To use MCP in LangStudio, see Build a ChatBI data analytics Agent application using LangStudio and Hologres.
More feature details
Speech and text conversion
-
Speech-to-text: This is implemented in LangStudio by adding a speech recognition node.
-
Text-to-speech: You can set this in the global configuration.
File upload switch
In Dify, the Start node has a default variable `sys.files` that accepts a list of uploaded files. LangStudio requires you to predefine fields of the `File` type. To upload multiple documents, you must define multiple `File` type fields.
Step 3: Joint debugging and testing
After you configure all nodes, you must perform comprehensive joint debugging and testing to ensure that the application runs stably.
-
End-to-end joint debugging: Connect all nodes and check the logs to troubleshoot issues, such as undefined variables or data that is not passed as expected.
-
Coverage testing: Simulate real user sessions, exceptions, and retry scenarios to ensure the application is robust.
Click the run button in the upper-right corner to debug the application. If a configuration error occurs, an error message appears. You can correct the error based on the message.
Production application suggestions
-
Prioritize simple applications: If this is your first migration, we recommend choosing a simple application to practice with. This helps you become familiar with the entire process.
-
Test thoroughly: Automated conversion is only the first step. Dify and LangStudio implement some features differently, such as file uploads and error retry mechanisms. Before you deploy the application to production, you must perform complete end-to-end testing. Pay close attention to variable passing, node logic, and data formats to ensure that they work as expected.
FAQ
-
Q: Why can't the migration script automate 100% of the work?
A: Dify and LangStudio have different environmental dependencies, such as API keys and database connections. They also differ in some core features, such as knowledge base implementation and Python code standards. The script converts the platform-independent application structure. You must manually rebuild environment-related configurations in the new target environment to ensure security and correctness.
-
Q: What should I do if a Dify node is not supported in LangStudio?
A: You can refer to the feature comparison information in this topic. For unsupported nodes, such as HTTP Request, you can often use LangStudio's Python node to write a small amount of code to simulate its function. You can also find other node combinations to achieve the same business logic.
-
Q: The Python code I copied from Dify causes an error in LangStudio. How do I fix it?
A: LangStudio's Python node has specific code standards. For example, functions must use the
@tooldecorator, and you must explicitly define the output data structure. For more information, see the instructions in the Code execution section to adapt your code.