Open deca-irae opened 3 weeks ago
Same issue also happens when running tool block step only that uses environment variables as input. Running the entire workflow though works just fine.
Hey @deca-irae! I'm here to help you with any issues you encounter. Let's tackle this bug together!
The issue you're experiencing with code blocks and tool blocks not being able to read environment variables when running steps individually might be related to how environment variables are loaded and accessed in Dify's self-hosted Docker environment.
In Dify, environment variables are typically configured in a .env
file, which is used to set up the environment for the entire workflow. When you run the entire workflow, these variables are likely being loaded correctly. However, when running individual steps, the environment setup might not be fully initialized, leading to the variables not being accessible.
To address this, you might want to ensure that the environment variables are explicitly loaded or passed to the individual steps when executing them separately. This could involve modifying the execution context or script to include the necessary environment setup for standalone step execution.
Unfortunately, there isn't specific documentation on handling environment variables for individual step execution in Dify, so this might require some experimentation or adjustments in your setup. If this is a persistent issue, it might be worth checking for updates or additional documentation from the Dify team that could address this behavior.
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.10.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Create an environment variable then set it as the value of an input variable within the code block. Then run the code block step ONLY.
✔️ Expected Behavior
Code block being able to read the environment variable
❌ Actual Behavior
Code block cannot read the environment variable