# Create a manual trace
with opik.start_as_current_trace(name="user_query_processing"):
    llm = OpenAI(model="gpt-3.5-turbo")
    messages = [
        ChatMessage(role="user", content="Explain quantum computing in simple terms"),
    ]
    
    response = llm.chat(messages)
    print(response.message.content)
```

This approach is useful when you want more control over trace naming and want to group multiple LlamaIndex operations under a single trace.

## Tracking LlamaIndex Workflows

LlamaIndex workflows are multi-step processing pipelines for LLM applications. To track workflow executions in Opik, you can manually decorate your workflow steps and use `opik.start_as_current_span()` to wrap the workflow execution.

### Basic Workflow Tracking

You can use `@opik.track()` to decorate your workflow steps and `opik.start_as_current_span()` to track the workflow execution:

```python
import opik
from llama_index.core.workflow import Workflow, StartEvent, StopEvent, step, Event
from llama_index.core import Settings
from llama_index.core.callbacks import CallbackManager
from llama_index.core import global_handler, set_global_handler