Skip to content

[Docs] add Graph task for While logic #587

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

Merged
merged 3 commits into from
Jul 20, 2025

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Jul 19, 2025

The interesting thing is that the current Graph task supports the while logic out of the box. Surprise, but nice. 🚀

Here I update the doc, and a small change in the graph task api.

  • In the doc control-flow, add Graph task for the While logic
  • Update the decorator to allow the graph task to return a value too.
  • In the Graph task execution, use a temporary workaround to fix the pickle error for the recursive call.

doc preview: https://aiida-workgraph--587.org.readthedocs.build/en/587/howto/autogen/control-flow.html#id7

@superstar54 superstar54 force-pushed the graph_task_support_while branch from 6971e27 to 119b4d8 Compare July 19, 2025 18:30
@superstar54 superstar54 force-pushed the graph_task_support_while branch from 119b4d8 to 3f53974 Compare July 19, 2025 18:55
Copy link
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, LGTM! I am a bit concerned regarding the impact on the graph visualization. Also, what is the plan to remove the pickling workaround?

@superstar54
Copy link
Member Author

I am a bit concerned regarding the impact on the graph visualization.

Graph task is always shown as a black-box before running, as soon as the task runs, one can inspect it. In the case of this recursive call, the GUI will show a deeply nested workflow. (The number of nested levels is determined by the number of recursive call).

Also, what is the plan to remove the pickling workaround?

I don't know how to replace the workaround for the moment, 🤣

@superstar54 superstar54 merged commit 213185c into aiidateam:main Jul 20, 2025
8 checks passed
@superstar54 superstar54 deleted the graph_task_support_while branch July 20, 2025 13:47
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

Successfully merging this pull request may close these issues.

2 participants