Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Script Node in Custom Workflow Cannot Access Properties of Custom File Uploaded URL—Input Argument Returns NULL #9681

Closed
5 tasks done
nne998 opened this issue Oct 23, 2024 · 3 comments
Milestone

Comments

@nne998
Copy link

nne998 commented Oct 23, 2024

Self Checks

  • This is only for bug report, 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.10

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create a custom workflow.
  2. Add a custom file (image) input variable in the "start" node.
  3. Add a script node and set the image's URL property as an input argument. Print the input argument for debugging.

✔️ Expected Behavior

Got the url

❌ Actual Behavior

Got null

@nne998
Copy link
Author

nne998 commented Oct 23, 2024

example.zip

@nne998 nne998 changed the title Script Node in Custom Workflow Cannot Access Properties of Custom File Uploaded URL—Input Argument Returns NULL [BUG] Script Node in Custom Workflow Cannot Access Properties of Custom File Uploaded URL—Input Argument Returns NULL Oct 23, 2024
@dosubot dosubot bot added the 🐞 bug Something isn't working label Oct 23, 2024
@crazywoola crazywoola added this to the 0.10.1 milestone Oct 23, 2024
Copy link

dosubot bot commented Oct 23, 2024

The issue you're experiencing, where a script node in a custom workflow returns null for a custom file uploaded URL, might be due to the variable not being correctly retrieved from the variable_pool. This can happen if the variable selector used in the script node does not match any existing variable in the variable_pool.

To troubleshoot this, ensure that the variable selector in your script node is correctly configured to match the variable name used in the "start" node. If the variable is not found, the script node will return null, as indicated by the following code snippet:

variable = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)
if variable is None:
    return NodeRunResult(
        status=WorkflowNodeExecutionStatus.FAILED,
        inputs=variables,
        error=f"Variable `{variable_selector.value_selector}` not found",
    )

This snippet shows that if the variable is not found, the node execution will fail, and the input argument will be null [1]. Double-check the variable names and ensure they are consistent across your workflow nodes.

To continue talking to Dosu, mention @dosu.

@crazywoola
Copy link
Member

See #9567 for details, this is not a bug, this is still under our UI/UX review.

@crazywoola crazywoola removed the 🐞 bug Something isn't working label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants