This article extends the previous discussion on LlamaIndex workflow branching and loops. It details workflow subclassing, nesting, and concurrent execution.

Subclassing extends existing workflows while preserving core logic. Concurrent execution runs independent tasks simultaneously to improve performance. The following sections detail these features.
LlamaIndex Workflow Subclassing and Nesting
LlamaIndex supports extensibility through subclassing and nesting.
- Subclasses add functionality to existing workflows. They reduce code duplication. They preserve base-class logic.
- Nested workflows decompose complex processes. They create reusable components. They simplify modular management.

Use Case: Payment Processing System
Consider a payment processing system. The base workflow processes credit card transactions. Some transactions require additional steps, such as fraud checks or invoice generation.
Subclassing extends the base workflow. It adds these steps for special cases. It leaves the core payment logic unchanged.
LlamaIndex Concurrent Workflow Execution
Concurrent execution improves performance. LlamaIndex runs independent workflow steps simultaneously. This method increases speed and resource utilization. It applies to tasks that run in parallel without affecting the final result.

Use Case: Querying Multiple External APIs
Consider an application that queries multiple external APIs. Executing requests concurrently reduces total latency. Sequential execution waits for each response before issuing the next request. LlamaIndex defines the maximum concurrent instances for each step.
Conclusion:
LlamaIndex workflows support subclassing, nesting, and concurrent execution. Subclassing provides custom logic. Nesting organizes complex processes. Concurrent execution reduces processing time. These features improve workflow maintainability and efficiency.
Apply workflow capabilities to improve application design.
See our agentic workflows service for production use of workflows like these.
Start with our LlamaIndex workflow overview, then compare the Swarms framework.