# Async vs sync workflow

Stratix has two operational modes: synchronous (immediate response) and asynchronous (queued, results stream in). Knowing which mode applies prevents most "why is this taking so long?" surprises.

## Sync operations

These return immediately:

* Browsing the catalog
* Fetching a model, benchmark, or saved evaluation
* Reading a trace
* Creating a judge or scorer (definition only)
* Generating an API key

## Async operations

These queue:

* Running an evaluation
* Running a trace evaluation
* Running GEPA optimization
* Ingesting a large trace batch

For async operations:

* The API returns a **handle** (an evaluation ID, optimization ID, etc.)
* The work runs in the background
* You poll for status, subscribe via SSE, or call `wait_for_completion(...)` in the SDK

## SDK polling helpers

The SDK has helpers like:

```python
result = client.evaluations.wait_for_completion(eval_id, timeout=300)
```

Async-equivalent:

```python
result = await client.evaluations.wait_for_completion(eval_id, timeout=300)
```

## Queue depth and ECU

Async work queues per-tenant. Most queues drain in seconds; large GEPA optimizations or large evaluation batches may take minutes.

## Failure semantics

Async runs that fail report a failure status with an error code. The SDK exception classes (`APIError`, `NotFoundError`, etc.) cover both immediate and async errors.

## Where to next

* [Python SDK reference](/6.-build-wire-your-code/sdk-python.md)
* [Evaluations](/8.-evaluate-score-the-outputs/evaluations-1.md)
* [Trace evaluations](/8.-evaluate-score-the-outputs/trace-evaluations.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.layerlens.ai/6.-build-wire-your-code/async-vs-sync-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
