# What is the order of timestamps for job execution?

**URL:** https://forum.buildkite.community/t/what-is-the-order-of-timestamps-for-job-execution/3525
**Category:** Pipelines
**Created:** [February 1, 2024, 10:50pm UTC](https://forum.buildkite.community/t/what-is-the-order-of-timestamps-for-job-execution/3525 "2024-02-01T22:50:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![eleanor-forum](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@eleanor-forum](https://forum.buildkite.community/u/eleanor-forum)
#### Post date: [February 1, 2024, 10:50pm UTC](https://forum.buildkite.community/t/what-is-the-order-of-timestamps-for-job-execution/3525/1 "2024-02-01T22:50:54Z")

</div>

I’ve been looking at the time-related metrics for various jobs and am confused as to their ordering.

Looking at the GraphQL API documentation for [JobTypeCommand](https://buildkite.com/docs/apis/graphql/schemas/object/jobtypecommand), I assumed that the timestamps would be ordered from earliest to latest like so:

- `createdAt`
- `scheduledAt`
- `runnableAt`
- `startedAt`
- one of: `canceledAt`, `expiredAt`, `finishedAt`

However, I’ve noticed that frequently `createdAt` and `scheduledAt` are the same, and frequently `scheduledAt` precedes `createdAt` by more than 30 seconds. Additionally, when jobs are re-run `createdAt` appears to be updated, but `scheduledAt` remains the same as the original job.

Am I misunderstanding what these timestamps represent? If so, what order should these timestamps be in? Alternatively, could there be something wrong with the way we’re creating jobs?

---

<div class="post-metadata">

### Author: ![stephanie.atte](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/stephanie.atte/32/1357_2.png) [@stephanie.atte](https://forum.buildkite.community/u/stephanie.atte)
#### Post date: [February 1, 2024, 11:04pm UTC](https://forum.buildkite.community/t/what-is-the-order-of-timestamps-for-job-execution/3525/2 "2024-02-01T23:04:41Z")

</div>

Hey @eleanor-forum

Thanks for reaching out!

No you aren’t misunderstanding this, we do have a reference to this in our [documentation](https://buildkite.com/docs/apis/rest-api/builds#timestamp-attributes) under the` scheduled_at` timestamp for the jobs

For most of my jobs, the` created_at` and `scheduled_at` are the same value, just like you said. But there are some scenarios where I noticed the `scheduled_at` was earlier than the `created_at`.

- `scheduled_at` : Timestamp indicates when the job was scheduled to run
- `created_at`: The time when the job was created or added to the build

For example when a job fails and Its retried, the retry has a later timestamp for ` created_at`. The concept is that with retries, the `scheduled_at` maintains the timestamp for when the original job was scheduled, but the `created_at` will be the time when you actually retried the job.

Hope this helps  
Cheers!

---

<div class="post-metadata">

### Author: ![eleanor-forum](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@eleanor-forum](https://forum.buildkite.community/u/eleanor-forum)
#### Post date: [February 2, 2024, 5:00pm UTC](https://forum.buildkite.community/t/what-is-the-order-of-timestamps-for-job-execution/3525/3 "2024-02-02T17:00:40Z")

</div>

Thanks! That really helps clear things up (I never noticed that little blurb at the bottom of that page).

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/system/32/1321_2.png) [@system](https://forum.buildkite.community/u/system)
#### Post date: [March 4, 2024, 3:01am UTC](https://forum.buildkite.community/t/what-is-the-order-of-timestamps-for-job-execution/3525/4 "2024-03-04T03:01:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
