Problem drawing diagram with draw_all_possible_flows #19

Closed
opened 2026-02-16 02:16:08 -05:00 by yindo · 4 comments
Owner

Originally created by @therealcyberlord on GitHub (Oct 11, 2025).

Hi, I am running into the following error when I try to draw a diagram of my workflow:

ImportError: cannot import name 'ServiceDefinition' from 'workflows.utils' .../.venv/lib/python3.12/site-packages/workflows/utils.py). Did you mean: 'ResourceDefinition'?

Here are my library versions:

  • llama-index-core: 0.14.0
  • llama-index-instrumentation: 0.4.0
  • llama-index-llms-openai: 0.5.6
  • llama-index-utils-workflow: 0.4.1
  • llama-index-workflows: 2.8.0

No other issues running the workflow other than the diagram drawing part.

from llama_index.utils.workflow import draw_all_possible_flows
Originally created by @therealcyberlord on GitHub (Oct 11, 2025). Hi, I am running into the following error when I try to draw a diagram of my workflow: ImportError: cannot import name 'ServiceDefinition' from 'workflows.utils' .../.venv/lib/python3.12/site-packages/workflows/utils.py). Did you mean: 'ResourceDefinition'? Here are my library versions: - `llama-index-core`: 0.14.0 - `llama-index-instrumentation`: 0.4.0 - `llama-index-llms-openai`: 0.5.6 - `llama-index-utils-workflow`: 0.4.1 - `llama-index-workflows`: 2.8.0 No other issues running the workflow other than the diagram drawing part. ```python from llama_index.utils.workflow import draw_all_possible_flows
yindo closed this issue 2026-02-16 02:16:08 -05:00
Author
Owner

@logan-markewich commented on GitHub (Oct 11, 2025):

Do you have the full traceback?

@logan-markewich commented on GitHub (Oct 11, 2025): Do you have the full traceback?
Author
Owner

@therealcyberlord commented on GitHub (Oct 11, 2025):

Appreciate the quick response, this is the full traceback:

Traceback (most recent call last):
  File "/Users/<user>/Projects/<project>/main.py", line 8, in <module>
    from llama_index.utils.workflow import draw_all_possible_flows
  File "/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/llama_index/utils/workflow/__init__.py", line 1, in <module>
    from llama_index.utils.workflow.draw import (
  File "/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/llama_index/utils/workflow/draw.py", line 11, in <module>
    from llama_index.core.workflow.utils import (
  File "/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/llama_index/core/workflow/utils.py", line 5, in <module>
    from workflows.utils import (
ImportError: cannot import name 'ServiceDefinition' from 'workflows.utils' (/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/workflows/utils.py). Did you mean: 'ResourceDefinition'?
@therealcyberlord commented on GitHub (Oct 11, 2025): Appreciate the quick response, this is the full traceback: ```plaintext Traceback (most recent call last): File "/Users/<user>/Projects/<project>/main.py", line 8, in <module> from llama_index.utils.workflow import draw_all_possible_flows File "/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/llama_index/utils/workflow/__init__.py", line 1, in <module> from llama_index.utils.workflow.draw import ( File "/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/llama_index/utils/workflow/draw.py", line 11, in <module> from llama_index.core.workflow.utils import ( File "/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/llama_index/core/workflow/utils.py", line 5, in <module> from workflows.utils import ( ImportError: cannot import name 'ServiceDefinition' from 'workflows.utils' (/Users/<user>/Projects/<project>/.venv/lib/python3.12/site-packages/workflows/utils.py). Did you mean: 'ResourceDefinition'?
Author
Owner

@logan-markewich commented on GitHub (Oct 11, 2025):

@therealcyberlord Are you sure you have llama-index-core>=0.14.0 ? These dependencies don't actually make sense (you need llama-index-llms-openai>=0.6.0 for example)

This line of code in the traceback does not exist
https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/workflow/utils.py

And this works fine in google colab
https://colab.research.google.com/drive/1LnAC2NGNCvkPD2VVGHiEiKTPjq69UuZb?usp=sharing

I suggest a fresh venv

@logan-markewich commented on GitHub (Oct 11, 2025): @therealcyberlord Are you sure you have `llama-index-core>=0.14.0` ? These dependencies don't actually make sense (you need `llama-index-llms-openai>=0.6.0` for example) This line of code in the traceback does not exist https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/workflow/utils.py And this works fine in google colab https://colab.research.google.com/drive/1LnAC2NGNCvkPD2VVGHiEiKTPjq69UuZb?usp=sharing I suggest a fresh venv
Author
Owner

@therealcyberlord commented on GitHub (Oct 11, 2025):

@logan-markewich Fresh venv worked, thanks for the help! I was missing the llama-index-core library

@therealcyberlord commented on GitHub (Oct 11, 2025): @logan-markewich Fresh venv worked, thanks for the help! I was missing the llama-index-core library
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#19