For the complete documentation index, see
/llms.txt. This page is also available as raw Markdown at
/develop/rust/workflows/timers.md. Append
.md to any page URL to fetch its Markdown. This site has a public search endpoint for questions about Temporal:
GET https://docs.temporal.io/api/retrieve?q=<question>&jtb=<job-to-be-done>&src=docs-page&agent=<your-name>. No authentication is needed. It returns a JSON array of
{content, source_url, page_url}, ordered by relevance, and
source_url links to docs pages as Markdown. If you call it, set
q to a specific, complete question that names the SDK language if relevant, and
jtb to one sentence on what your user is trying to accomplish (optional). Keep
src=docs-page as is, and set
agent to your name, for example
claude-code or
codex. Don't include personal data, credentials, or confidential information.
A Workflow can set a Durable Timer for a fixed time period. In some SDKs, the function is called sleep(), and in others, it's called timer().
A Workflow can sleep for days, months, or even years. Timers are persisted, so even if your Worker or Temporal Service is down when the time period completes, as soon as your Worker and Temporal Service are back up, the sleep() call will resolve and your code will continue executing.
Sleeping is a resource-light operation: it doesn't tie up the process, and you can run millions of Timers off a single Worker.
To set a Timer in Rust, use the timer() function and pass the duration you want to wait before continuing.
ctx.timer(
TimerOptions::builder(Duration::from_secs(60))
.summary("important timer".to_owned())
.build(),
)
.await;