Name | llama-index-workflows JSON |
Version |
2.1.0
JSON |
| download |
home_page | None |
Summary | An event-driven, async-first, step-based way to control the execution flow of AI applications like Agents. |
upload_time | 2025-09-10 21:31:05 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# LlamaIndex Workflows
[](https://github.com/run-llama/workflows/actions/workflows/test.yml)
[](https://coveralls.io/github/run-llama/workflows?branch=main)
[](https://github.com/run-llama/llama-index-workflows/graphs/contributors)
[](https://pypi.org/project/llama-index-workflows/)
[](https://discord.gg/dGcwcsnxhU)
[](https://x.com/llama_index)
[](https://www.reddit.com/r/LlamaIndex/)
LlamaIndex Workflows are a framework for orchestrating and chaining together complex systems of steps and events.
## What can you build with Workflows?
Workflows shine when you need to orchestrate complex, multi-step processes that involve AI models, APIs, and decision-making. Here are some examples of what you can build:
- **AI Agents** - Create intelligent systems that can reason, make decisions, and take actions across multiple steps
- **Document Processing Pipelines** - Build systems that ingest, analyze, summarize, and route documents through various processing stages
- **Multi-Model AI Applications** - Coordinate between different AI models (LLMs, vision models, etc.) to solve complex tasks
- **Research Assistants** - Develop workflows that can search, analyze, synthesize information, and provide comprehensive answers
- **Content Generation Systems** - Create pipelines that generate, review, edit, and publish content with human-in-the-loop approval
- **Customer Support Automation** - Build intelligent routing systems that can understand, categorize, and respond to customer inquiries
The async-first, event-driven architecture makes it easy to build workflows that can route between different capabilities, implement parallel processing patterns, loop over complex sequences, and maintain state across multiple steps - all the features you need to make your AI applications production-ready.
## Key Features
- **async-first** - workflows are built around python's async functionality - steps are async functions that process incoming events from an asyncio queue and emit new events to other queues. This also means that workflows work best in your async apps like FastAPI, Jupyter Notebooks, etc.
- **event-driven** - workflows consist of steps and events. Organizing your code around events and steps makes it easier to reason about and test.
- **state management** - each run of a workflow is self-contained, meaning you can launch a workflow, save information within it, serialize the state of a workflow and resume it later.
- **observability** - workflows are automatically instrumented for observability, meaning you can use tools like `Arize Phoenix` and `OpenTelemetry` right out of the box.
## Quick Start
Install the package:
```bash
pip install llama-index-workflows
```
And create your first workflow:
```python
import asyncio
from pydantic import BaseModel, Field
from workflows import Context, Workflow, step
from workflows.events import Event, StartEvent, StopEvent
class MyEvent(Event):
msg: list[str]
class RunState(BaseModel):
num_runs: int = Field(default=0)
class MyWorkflow(Workflow):
@step
async def start(self, ctx: Context[RunState], ev: StartEvent) -> MyEvent:
async with ctx.store.edit_state() as state:
state.num_runs += 1
return MyEvent(msg=[ev.input_msg] * state.num_runs)
@step
async def process(self, ctx: Context[RunState], ev: MyEvent) -> StopEvent:
data_length = len("".join(ev.msg))
new_msg = f"Processed {len(ev.msg)} times, data length: {data_length}"
return StopEvent(result=new_msg)
async def main():
workflow = MyWorkflow()
# [optional] provide a context object to the workflow
ctx = Context(workflow)
result = await workflow.run(input_msg="Hello, world!", ctx=ctx)
print("Workflow result:", result)
# re-running with the same context will retain the state
result = await workflow.run(input_msg="Hello, world!", ctx=ctx)
print("Workflow result:", result)
if __name__ == "__main__":
asyncio.run(main())
```
In the example above
- Steps that accept a `StartEvent` will be run first.
- Steps that return a `StopEvent` will end the workflow.
- Intermediate events are user defined and can be used to pass information between steps.
- The `Context` object is also used to share information between steps.
Visit the [complete documentation](https://docs.llamaindex.ai/en/stable/understanding/workflows/) for more examples using `llama-index`!
## More examples
- [Basic Feature Run-Through](./examples/feature_walkthrough.ipynb)
- [Building a Function Calling Agent with `llama-index`](./examples/agent.ipynb)
- [Human-in-the-loop Iterative Document Extraction](./examples/document_processing.ipynb)
- Observability
- [OpenTelemetry + Instrumentation Primer](./examples/observability/workflows_observability_pt1.ipynb)
- [OpenTelemetry + LlamaIndex](./examples/observability/workflows_observability_pt2.ipynb)
- [Arize Phoenix + LlamaIndex](./examples/observability/workflows_observablitiy_arize_phoenix.ipynb)
- [Langfuse + LlamaIndex](./examples/observability/workflows_observablitiy_langfuse.ipynb)
## Related Packages
- [Typescript Workflows](https://github.com/run-llama/workflows-ts)
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-workflows",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d5/a5/cb6ea8f83aceb81c07793096fa483f5332ebc2a5a96ddc27a747526bb4f3/llama_index_workflows-2.1.0.tar.gz",
"platform": null,
"description": "# LlamaIndex Workflows\n\n[](https://github.com/run-llama/workflows/actions/workflows/test.yml)\n[](https://coveralls.io/github/run-llama/workflows?branch=main)\n[](https://github.com/run-llama/llama-index-workflows/graphs/contributors)\n\n\n[](https://pypi.org/project/llama-index-workflows/)\n[](https://discord.gg/dGcwcsnxhU)\n[](https://x.com/llama_index)\n[](https://www.reddit.com/r/LlamaIndex/)\n\nLlamaIndex Workflows are a framework for orchestrating and chaining together complex systems of steps and events.\n\n## What can you build with Workflows?\n\nWorkflows shine when you need to orchestrate complex, multi-step processes that involve AI models, APIs, and decision-making. Here are some examples of what you can build:\n\n- **AI Agents** - Create intelligent systems that can reason, make decisions, and take actions across multiple steps\n- **Document Processing Pipelines** - Build systems that ingest, analyze, summarize, and route documents through various processing stages\n- **Multi-Model AI Applications** - Coordinate between different AI models (LLMs, vision models, etc.) to solve complex tasks\n- **Research Assistants** - Develop workflows that can search, analyze, synthesize information, and provide comprehensive answers\n- **Content Generation Systems** - Create pipelines that generate, review, edit, and publish content with human-in-the-loop approval\n- **Customer Support Automation** - Build intelligent routing systems that can understand, categorize, and respond to customer inquiries\n\nThe async-first, event-driven architecture makes it easy to build workflows that can route between different capabilities, implement parallel processing patterns, loop over complex sequences, and maintain state across multiple steps - all the features you need to make your AI applications production-ready.\n\n## Key Features\n\n- **async-first** - workflows are built around python's async functionality - steps are async functions that process incoming events from an asyncio queue and emit new events to other queues. This also means that workflows work best in your async apps like FastAPI, Jupyter Notebooks, etc.\n- **event-driven** - workflows consist of steps and events. Organizing your code around events and steps makes it easier to reason about and test.\n- **state management** - each run of a workflow is self-contained, meaning you can launch a workflow, save information within it, serialize the state of a workflow and resume it later.\n- **observability** - workflows are automatically instrumented for observability, meaning you can use tools like `Arize Phoenix` and `OpenTelemetry` right out of the box.\n\n## Quick Start\n\nInstall the package:\n\n```bash\npip install llama-index-workflows\n```\n\nAnd create your first workflow:\n\n```python\nimport asyncio\nfrom pydantic import BaseModel, Field\nfrom workflows import Context, Workflow, step\nfrom workflows.events import Event, StartEvent, StopEvent\n\nclass MyEvent(Event):\n msg: list[str]\n\nclass RunState(BaseModel):\n num_runs: int = Field(default=0)\n\nclass MyWorkflow(Workflow):\n @step\n async def start(self, ctx: Context[RunState], ev: StartEvent) -> MyEvent:\n async with ctx.store.edit_state() as state:\n state.num_runs += 1\n\n return MyEvent(msg=[ev.input_msg] * state.num_runs)\n\n @step\n async def process(self, ctx: Context[RunState], ev: MyEvent) -> StopEvent:\n data_length = len(\"\".join(ev.msg))\n new_msg = f\"Processed {len(ev.msg)} times, data length: {data_length}\"\n return StopEvent(result=new_msg)\n\nasync def main():\n workflow = MyWorkflow()\n\n # [optional] provide a context object to the workflow\n ctx = Context(workflow)\n result = await workflow.run(input_msg=\"Hello, world!\", ctx=ctx)\n print(\"Workflow result:\", result)\n\n # re-running with the same context will retain the state\n result = await workflow.run(input_msg=\"Hello, world!\", ctx=ctx)\n print(\"Workflow result:\", result)\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\nIn the example above\n- Steps that accept a `StartEvent` will be run first.\n- Steps that return a `StopEvent` will end the workflow.\n- Intermediate events are user defined and can be used to pass information between steps.\n- The `Context` object is also used to share information between steps.\n\nVisit the [complete documentation](https://docs.llamaindex.ai/en/stable/understanding/workflows/) for more examples using `llama-index`!\n\n## More examples\n\n- [Basic Feature Run-Through](./examples/feature_walkthrough.ipynb)\n- [Building a Function Calling Agent with `llama-index`](./examples/agent.ipynb)\n- [Human-in-the-loop Iterative Document Extraction](./examples/document_processing.ipynb)\n- Observability\n - [OpenTelemetry + Instrumentation Primer](./examples/observability/workflows_observability_pt1.ipynb)\n - [OpenTelemetry + LlamaIndex](./examples/observability/workflows_observability_pt2.ipynb)\n - [Arize Phoenix + LlamaIndex](./examples/observability/workflows_observablitiy_arize_phoenix.ipynb)\n - [Langfuse + LlamaIndex](./examples/observability/workflows_observablitiy_langfuse.ipynb)\n\n## Related Packages\n\n- [Typescript Workflows](https://github.com/run-llama/workflows-ts)\n",
"bugtrack_url": null,
"license": null,
"summary": "An event-driven, async-first, step-based way to control the execution flow of AI applications like Agents.",
"version": "2.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "638f7490700ffbfd6e12efef659e49d2a9eec5c9955a64a51f2aab96ed22905c",
"md5": "e12fc970b1ce52fe97a704bf6ae13f04",
"sha256": "4b6751516768d1eb2d785d7be8ad19cc51d3b0beba1ddea687d6a72473a79c10"
},
"downloads": -1,
"filename": "llama_index_workflows-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e12fc970b1ce52fe97a704bf6ae13f04",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 44906,
"upload_time": "2025-09-10T21:31:04",
"upload_time_iso_8601": "2025-09-10T21:31:04.537555Z",
"url": "https://files.pythonhosted.org/packages/63/8f/7490700ffbfd6e12efef659e49d2a9eec5c9955a64a51f2aab96ed22905c/llama_index_workflows-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d5a5cb6ea8f83aceb81c07793096fa483f5332ebc2a5a96ddc27a747526bb4f3",
"md5": "0447f325120ebe8a4f92c904d922f19f",
"sha256": "a6dd771b249ddb1225653aa9ede636fd134d805e7368cf7df7d4e350ab04d8e0"
},
"downloads": -1,
"filename": "llama_index_workflows-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "0447f325120ebe8a4f92c904d922f19f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1269221,
"upload_time": "2025-09-10T21:31:05",
"upload_time_iso_8601": "2025-09-10T21:31:05.774467Z",
"url": "https://files.pythonhosted.org/packages/d5/a5/cb6ea8f83aceb81c07793096fa483f5332ebc2a5a96ddc27a747526bb4f3/llama_index_workflows-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 21:31:05",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-workflows"
}