# WaitFor

Term type: API method

Delays a resource's startup until a dependency is running and its configured health checks pass.

Also known as: waitFor, readiness dependency

`WaitFor` in C# and `waitFor` in TypeScript express a startup dependency. For a running resource with health checks, Aspire waits for those checks to report healthy. Without health checks, reaching the running state is sufficient.

Use a reference as well when the consuming resource needs connection information. Waiting alone does not supply a connection string or endpoint.

Readiness is only as meaningful as the checks you configure. Startup coordination does not replace retry policies or recovery from failures after startup.

## Practical example

Wait for PostgreSQL before starting an API so its initial database connection is not attempted before the configured readiness checks succeed.

## Learn more

- [Configure health checks for your resources](https://aspire.dev/fundamentals/health-checks/)

- [Resource readiness](https://aspire.dev/architecture/resource-model/#resource-health)

## Related terms

- [Health check](https://aspire.dev/hub/glossary/health-check/)

- [WaitForCompletion](https://aspire.dev/hub/glossary/waitforcompletion/)

- [WaitForStart](https://aspire.dev/hub/glossary/waitforstart/)

- [WithReference](https://aspire.dev/hub/glossary/withreference/)