> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/6.-build-wire-your-code/async-vs-sync-workflow.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
