# should_run_onboarding

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/onboarding/should_run_onboarding)

Return whether onboarding should open at interactive startup.

`DEEPAGENTS_CODE_ONBOARDING` overrides the marker in both directions: a
truthy value forces the flow open on every startup, and a falsy value keeps
it closed even on a fresh install. An unset or unrecognized value leaves the
marker in charge, so the override never has to be unset to get first-run
behavior back.

## Signature

```python
should_run_onboarding(
    state_dir: Path | None = None,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `state_dir` | `Path \| None` | No | Optional state directory override for tests. (default: `None`) |

## Returns

`bool`

`True` when the env override is truthy, or when it does not apply and no
completion marker exists.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/onboarding.py#L277)