LlamaIndex Workflows provide an event-driven, async-first framework for building complex AI pipelines. Master the vocabulary for steps, events, Context objects, and query pipelines used in production RAG and agent applications.
0 / 5 completed
1 / 5
A developer uses LlamaIndex Workflows and decorates a method with @step. What does the step decorator indicate in this context?
In LlamaIndex Workflows, the @step decorator marks a method as an event-driven step. Steps declare their input event types in their signature and return output events. The workflow engine routes events to the correct step based on type, enabling explicit, composable control flow.
2 / 5
A LlamaIndex workflow step needs to share data across steps without passing it through every event. Which object provides this shared state?
The Context object in LlamaIndex Workflows acts as a per-run shared store. Steps can call await ctx.set("key", value) and await ctx.get("key") to persist data across the workflow run without embedding everything in event payloads.
3 / 5
In a LlamaIndex query pipeline, what is the primary purpose of QueryPipeline.add_modules()?
QueryPipeline.add_modules() registers named modules — such as prompts, LLMs, retrievers, or query engines — that the pipeline can connect into a DAG. After adding modules, add_link() defines data flow between them, composing a reusable, inspectable query processing graph.
4 / 5
Your LlamaIndex workflow fires a StopEvent. What happens when this event is emitted?
StopEvent is a special terminal event in LlamaIndex Workflows. When any step emits a StopEvent, the workflow engine terminates execution and returns its result payload to the original await workflow.run() caller. It is the standard way to signal completion.
5 / 5
A developer wants to run LlamaIndex workflow steps concurrently. Which Python keyword is required in step method signatures to enable this?
LlamaIndex Workflows are built on Python's asyncio. Steps must be defined as async def and use await for I/O operations. The workflow engine automatically runs steps that can proceed concurrently (those waiting for different events) using the event loop, without manual thread management.