Registry / llm-agents / llama-index-utils-workflow

llama-index-utils-workflow

JSON →
library0.11.0pypypi✓ verified 84d ago

Utility library for defining and running workflows in LlamaIndex. Provides the `Workflow` class, `step` decorator, and event-based orchestration. Current version is 0.10.1, actively maintained as part of LlamaIndex ecosystem. Release cadence follows LlamaIndex releases.

pip install llama-index-utils-workflow
INSTALL
IMPORT
SIG · LLAMA-INDEX-UTILS-
L
llama-index-utils-workflow
llm-agentspythonv0.11.0
Install
22.3s avg
Import
5435ms
Disk
308MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.11.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 4.486s · 303MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 22.3s · import 4.210s · 299MB
308MB installed
● package 308MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Workflow
from llama_index.core.workflow import Workflow
from llama_index.utils.workflow import Workflow
Workflow class is exported from llama-index-core, not from this utils package.
step
from llama_index.core.workflow import step
from llama_index.utils.workflow import step
The step decorator is part of core workflow, not this utils package.
Context
from llama_index.core.workflow import Context
from llama_index.utils.workflow import Context
Context is imported from core workflow module.
StartEvent, StopEvent
from llama_index.core.workflow import StartEvent, StopEvent
from llama_index.utils.workflow import StartEvent
Event classes are in core, not utils.

Define a simple workflow using the Workflow class and step decorator. Note: The 'llama-index-utils-workflow' package itself provides additional utilities (e.g., drawing, events), but the core workflow classes are in llama-index-core.

import os from llama_index.core.workflow import Workflow, step, Context, StartEvent, StopEvent class MyWorkflow(Workflow): @step async def my_step(self, ctx: Context, ev: StartEvent) -> StopEvent: return StopEvent(result="done") w = MyWorkflow(timeout=10, verbose=False) result = await w.run() print(result)
Debug
Known issues
breakingThe `Workflow` class and `step` decorator were moved from `llama_index.utils.workflow` to `llama_index.core.workflow` in llama-index>=0.10.0. Old imports from the utils package will fail.
fix
Change imports to `from llama_index.core.workflow import Workflow, step`.
affects: >=0.10.0
deprecatedThe `llama_index.utils.workflow` module is deprecated and may be removed in a future release. All workflow functionality is now in llama-index-core.
fix
Use `from llama_index.core.workflow import Workflow, step, Context, StartEvent, StopEvent` instead.
affects: >=0.10.0
gotchaWorkflow step methods must be async and return an event. Mixing sync/async or returning None can cause silent failures.
fix
Ensure all step methods are `async def` and return an event (e.g., `StopEvent` or custom event). Use `await` when calling other async functions inside steps.
affects: all
gotchaThe `timeout` parameter in `Workflow.__init__` is in seconds. A common mistake is setting it too low for complex workflows, causing early termination.
fix
Increase timeout (e.g., `timeout=120`) or set to `None` for no timeout (not recommended in production).
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Workflow' from 'llama_index.utils.workflow'
The Workflow class was moved to llama_index.core.workflow in version 0.10.0.
fix
Use `from llama_index.core.workflow import Workflow` instead.
AttributeError: 'NoneType' object has no attribute 'event'
A step method returned None instead of an event object.
fix
Ensure each step returns an event (e.g., `return StopEvent(result=...)`) or `return None` only if explicitly handling the absence of event.
RuntimeError: Workflow timed out after 10 seconds
Default timeout is 10 seconds, which may be too short for long-running steps or external API calls.
fix
Set a higher timeout when instantiating the workflow: `MyWorkflow(timeout=120)`.
TypeError: step() got multiple values for argument 'self'
Step method defined as a regular function instead of an instance method (missing `self` parameter) or incorrectly decorated.
fix
Define step methods as instance methods with `self` as first argument and use `@step` decorator inside the Workflow class.
Upgrade
Version history
0.11.0latest on PyPI · released Jun 17, 2026
Audit
Dependencies
llama-index-corerequiredCore LlamaIndex library required for base classes and event system
Agent activity
33 hits · last 30 days
node
30
Amazon
1
OpenAI (training)
1
Resources
llama-index-utils-workflow — pip install llama-index-utils-workflow · libregistry