How to get the file from the start node in the code execution? #13424

Closed
opened 2026-02-21 19:12:06 -05:00 by yindo · 1 comment
Owner

Originally created by @sunnoy on GitHub (Apr 27, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

I want to complete such a workflow, upload a compressed file and then preprocess it through the code execution node, and then send it to the llm for analysis through the document extraction node

Originally created by @sunnoy on GitHub (Apr 27, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Provide a description of requested docs changes I want to complete such a workflow, upload a compressed file and then preprocess it through the code execution node, and then send it to the llm for analysis through the document extraction node
yindo added the 📚 documentation label 2026-02-21 19:12:06 -05:00
yindo closed this issue 2026-02-21 19:12:06 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 27, 2025):

Hello @sunnoy! I'm Dosu, your friendly bot here to help you out while you wait for a human maintainer. I'm ready to assist you with any bugs or questions you have. Let's get started!

I found two similar discussions that might be helpful:

  1. How can I output a file in Workflow - This discussion is still open and might provide insights into handling files within workflows [1].

  2. How to pass sys.files uploaded by the user in the starting node to the LLM in the workflow? - This discussion is also open and addresses passing files from the start node to the LLM [2].

To complete a workflow involving uploading a compressed file, preprocessing it through the code execution node, and then sending it to the LLM for analysis through the document extraction node, follow these steps:

  1. Enable File Upload: Add a single file variable in the "Start" node, such as compressedFile. The file upload feature supports various formats, with a maximum of 10 files and a size limit of 15MB per file.

  2. Preprocess the File: Use a code execution node to decompress the uploaded file. This node should take the compressedFile as input, decompress it, and output the decompressed file(s).

  3. Document Extraction: Add a document extractor node. Select the decompressed file(s) from the code execution node as input variables. The document extractor will parse and convert the contents into text. Ensure the input variables are of type File or Array[File].

  4. LLM Analysis: Add an LLM node and use the output variable from the document extractor node in the system prompt. Alternatively, if using an LLM with file processing capabilities, you can directly input the file variable into the LLM node's system prompt.

  5. Configure End Node: Configure the end node by selecting the output variable of the LLM node.

This setup will allow users to upload compressed files, have them decompressed and processed, and then analyzed by the LLM [3][4][5][6].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 27, 2025): <!-- Greeting --> Hello @sunnoy! I'm [Dosu](https://dosu.dev), your friendly bot here to help you out while you wait for a human maintainer. I'm ready to assist you with any bugs or questions you have. Let's get started! <!-- Answer --> I found two similar discussions that might be helpful: 1. [How can I output a file in `Workflow`](https://github.com/langgenius/dify/discussions/17145) - This discussion is still open and might provide insights into handling files within workflows <sup>[[1]](https://github.com/langgenius/dify/discussions/17145)</sup>. 2. [How to pass sys.files uploaded by the user in the starting node to the LLM in the workflow?](https://github.com/langgenius/dify/discussions/3370) - This discussion is also open and addresses passing files from the start node to the LLM <sup>[[2]](https://github.com/langgenius/dify/discussions/3370)</sup>. To complete a workflow involving uploading a compressed file, preprocessing it through the code execution node, and then sending it to the LLM for analysis through the document extraction node, follow these steps: 1. **Enable File Upload**: Add a single file variable in the "Start" node, such as `compressedFile`. The file upload feature supports various formats, with a maximum of 10 files and a size limit of 15MB per file. 2. **Preprocess the File**: Use a code execution node to decompress the uploaded file. This node should take the `compressedFile` as input, decompress it, and output the decompressed file(s). 3. **Document Extraction**: Add a document extractor node. Select the decompressed file(s) from the code execution node as input variables. The document extractor will parse and convert the contents into text. Ensure the input variables are of type `File` or `Array[File]`. 4. **LLM Analysis**: Add an LLM node and use the output variable from the document extractor node in the system prompt. Alternatively, if using an LLM with file processing capabilities, you can directly input the file variable into the LLM node's system prompt. 5. **Configure End Node**: Configure the end node by selecting the output variable of the LLM node. This setup will allow users to upload compressed files, have them decompressed and processed, and then analyzed by the LLM <sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/doc-extractor.md)</sup><sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/node/doc-extractor.md)</sup><sup>[[5]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/file-upload.md)</sup><sup>[[6]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/additional-features.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/070c3116-5f1f-4251-8a1a-d9d16d87063f?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13424