Error Path "llm" not in state #32

Closed
opened 2026-02-16 02:16:12 -05:00 by yindo · 2 comments
Owner

Originally created by @abhi-soliton on GitHub (Feb 4, 2026).

Hey, I am facing this error in my workflow. This is a random error happening in my workflow.

Version: 2.7.0

When, I run my application with a lot of requests I am facing this value error.

The context.store._state is getting auto cleared and new object _state is getting created. It's getting cleared randomly at different workflow steps at random time.

I tried to create a separate script to reproduce this error, but I couldn't reproduce

Traceback (most recent call last):
  File "/workspace/.venv/lib/python3.12/site-packages/workflows/context/state_store.py", line 296, in get
    value = self._traverse_step(value, segment)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/.venv/lib/python3.12/site-packages/workflows/context/state_store.py", line 367, in _traverse_step
    return getattr(obj, segment)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/.venv/lib/python3.12/site-packages/workflows/events.py", line 66, in __getattr__
    raise AttributeError(
AttributeError: 'DictState' object has no attribute 'llm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/workspace/.venv/lib/python3.12/site-packages/llama_index_instrumentation/dispatcher.py", line 386, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/main_workflow.py", line 875, in reasoning
    llm: LLM = await ctx.store.get("llm")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/.venv/lib/python3.12/site-packages/workflows/context/state_store.py", line 302, in get
    raise ValueError(msg)
ValueError: Path 'llm' not found in state
Originally created by @abhi-soliton on GitHub (Feb 4, 2026). Hey, I am facing this error in my workflow. This is a random error happening in my workflow. Version: 2.7.0 When, I run my application with a lot of requests I am facing this value error. The context.store._state is getting auto cleared and new object _state is getting created. It's getting cleared randomly at different workflow steps at random time. I tried to create a separate script to reproduce this error, but I couldn't reproduce ``` Traceback (most recent call last): File "/workspace/.venv/lib/python3.12/site-packages/workflows/context/state_store.py", line 296, in get value = self._traverse_step(value, segment) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/workflows/context/state_store.py", line 367, in _traverse_step return getattr(obj, segment) ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/workflows/events.py", line 66, in __getattr__ raise AttributeError( AttributeError: 'DictState' object has no attribute 'llm' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/workspace/.venv/lib/python3.12/site-packages/llama_index_instrumentation/dispatcher.py", line 386, in async_wrapper result = await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/main_workflow.py", line 875, in reasoning llm: LLM = await ctx.store.get("llm") ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/workflows/context/state_store.py", line 302, in get raise ValueError(msg) ValueError: Path 'llm' not found in state ```
yindo closed this issue 2026-02-16 02:16:13 -05:00
Author
Owner

@adrianlyjak commented on GitHub (Feb 4, 2026):

@abhi-soliton Thanks for the bug report. I haven't heard of similar issues, and don't have much to go on here to debug. Can you share a little more context about the structure of your workflow and how the llm state get's initialized?

@adrianlyjak commented on GitHub (Feb 4, 2026): @abhi-soliton Thanks for the bug report. I haven't heard of similar issues, and don't have much to go on here to debug. Can you share a little more context about the structure of your workflow and how the llm state get's initialized?
Author
Owner

@abhi-soliton commented on GitHub (Feb 5, 2026):

@adrianlyjak , This seems to be an error from our end.

Due to client errors, in our fast api endpoint, the finally get executed and cleared the context. But the workflow was still running. This leads to this error.

I have rectified this by explicitly canceled the workflow run and then clear context in the finally block.

This resolved the issue. Thanks for acknowledging.

@abhi-soliton commented on GitHub (Feb 5, 2026): @adrianlyjak , This seems to be an error from our end. Due to client errors, in our fast api endpoint, the finally get executed and cleared the context. But the workflow was still running. This leads to this error. I have rectified this by explicitly canceled the workflow run and then clear context in the finally block. This resolved the issue. Thanks for acknowledging.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#32