dify icon indicating copy to clipboard operation
dify copied to clipboard

Workflow node concurrent execution failed

Open 0xff-dev opened this issue 1 year ago • 2 comments

Self Checks

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

Dify version

0.15.3

Cloud or Self Hosted

Cloud

Steps to reproduce

dify.txt

Import the above yaml file and input "abc" for testing. Code3 does not wait for Code4 to finish executing to get the result, resulting in the failure of Code3 execution.

✔️ Expected Behavior

Wait for code4 to finish executing, and then continue executing code3 after getting the execution result.

❌ Actual Behavior

Image

Error message

Traceback (most recent call last): File "/var/sandbox/sandbox-python/tmp/b668d330_7d69_4e84_bed0_6d734f61d3e9.py", line 48, in <module> File "<string>", line 17, in <module> File "<string>", line 6, in main TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' error: exit status 255 

0xff-dev avatar Feb 18 '25 10:02 0xff-dev

Hello, @0xff-dev! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together!

The issue you're experiencing with the concurrent execution of workflow nodes in Dify seems to be related to the sequencing of node execution. Specifically, Code3 is not waiting for Code4 to complete before it starts, which is causing a TypeError due to an attempt to concatenate a NoneType with a str.

To address this, you should ensure that the dependencies between Code3 and Code4 are correctly defined in your workflow. Dify uses a GraphEngine to manage node execution, and dependencies are typically handled through GraphEdge objects that define the order of execution based on conditions and dependencies [1].

Here are some steps you can take to resolve the issue:

  1. Check Dependencies: Verify that the workflow graph correctly specifies that Code3 depends on the completion of Code4. This can be done by ensuring that there is a directed edge from Code4 to Code3 in the workflow configuration.

  2. Condition Management: Ensure that any conditions associated with the edges between nodes are correctly set up so that Code3 only executes after Code4 has completed successfully [1].

  3. Error Handling: Review the error handling configuration for these nodes. If Code4 can fail or return None, make sure that Code3 can handle such cases gracefully, possibly by using default values or implementing a fail-branch strategy [2].

  4. Debugging: Use the workflow logs to trace the execution path and identify where the sequence is breaking. This can help in understanding if the issue is with the node configuration or the logic within the nodes themselves.

By ensuring that the dependencies and conditions are correctly configured, you should be able to achieve the expected behavior where Code3 waits for Code4 to finish before executing.

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] avatar Feb 18 '25 10:02 dosubot[bot]

I have a similar problem I can see the node being executed in the next node, but in the tracing bar of the log, this node is not displayed, very strange bug

auxpd avatar Mar 06 '25 09:03 auxpd

Hi, @0xff-dev. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported a bug where Code3 executes before Code4 finishes, causing a TypeError.
  • I suggested checking workflow dependencies and provided debugging steps.
  • Auxpd mentioned a similar issue with node execution not appearing in the log's tracing bar.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of Dify by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Apr 06 '25 16:04 dosubot[bot]