Open the console

When Onboarding Steps Finish Out of Order

A later onboarding step can complete before an earlier one when steps come from different sources at different speeds. Decide what that means before it happens.

When Onboarding Steps Finish Out of Order

Why step order isn't guaranteed

An onboarding checklist assumes steps complete roughly in the order you show them. In practice, completion events arrive from different places at different speeds: a client-side click fires instantly, a server-side check waits on a webhook, a background job finishes whenever it finishes. The order the user sees on screen and the order the backend records can diverge, and once a later step is marked done before an earlier one, your checklist has to decide what that means.

This is not a rare edge case. Any checklist with a mix of instant steps (click a button) and delayed steps (confirm an email, connect an OAuth app, wait for a sync job) will eventually see a "later" step complete first. If your data model assumes strict ordering, the first out-of-order event either throws an error, silently corrupts progress, or gets dropped — and you find out from a confused support ticket, not a test.

Decide what "out of order" should mean before it happens

There are three honest answers, and the wrong one to pick by default is "block it":

  • Allow it, record it as-is. Steps are independent facts, not a sequence. Step 4 completing before step 2 is just two true statements about the account. This is the simplest model and the right default unless a step's completion genuinely depends on another step's output.
  • Allow it, but surface the gap. Step 4 is marked done, but the UI still shows step 2 as the next action — the checklist doesn't require strict order to render, it just lists what's left. This keeps the data honest while keeping the UI simple.
  • Block it, with a real dependency. Step 4 actually cannot be verified without data step 2 produces (for example, step 4 is "invite a teammate" and step 2 is "create a workspace" — there is no workspace to invite anyone into yet). Here, out-of-order isn't a race condition, it's an invalid request, and the API should reject it with a clear reason rather than silently accepting a completion that doesn't make sense.

Most checklists are made of independent facts with a cosmetic order, not real dependencies. Treat them that way unless you can name the specific data one step needs from another.

Modeling it without assuming sequence

If steps are independent facts, store each completion as its own timestamped record rather than as a position in a sequence. A step's state is "completed at time T" or "not completed," full stop — nothing in the schema should encode "steps complete in order 1, 2, 3."

// a step completion event, not a sequence position
{
  "account_id": "acc_123",
  "step_key": "connect_billing",
  "completed_at": "2026-11-24T09:12:03Z",
  "source": "webhook"
}

On the read side, your checklist UI computes "what's left" by diffing the full set of step keys against the set of completed ones — it never asks "is this the next step in order," because order was never guaranteed. If you do have a real dependency (the third case above), enforce it explicitly at write time: reject a completion for step_key=invite_teammate if step_key=create_workspace has no completed record yet, and return a reason the client can show.

Where this breaks silently

The failure mode worth testing for isn't a crash — it's a checklist that looks complete when it isn't, or incomplete when it is. Two situations cause this:

  • A client caches the step list on load and renders progress from that cache, then a background job completes a step five minutes later. The user refreshes and the step now shows done — but the UI they were looking at a moment ago said it wasn't, and no event told them it changed.
  • A retried request resends an already-processed completion for a step, and if your write path isn't idempotent, you either double-count or throw on the duplicate. Order and retries are separate problems, but they show up in the same part of the code, so test them together: send two completions for two different steps, out of order, with one duplicated, and check that the final state is exactly what you'd expect from the set of distinct events.

What to check in your own checklist

Open your step-completion endpoint and ask: does anything in the write path assume the previous step is already done, other than the cases where that's a real product rule? If the answer is "no, but I've never tried sending them out of order," that's the gap. Write one test that completes your checklist's steps in reverse and confirms the final state matches completing them forward — if it doesn't, you've found exactly where the ordering assumption lives.

If your product doesn't yet track step-completion events with their own timestamps — just a boolean per step, overwritten on each update — that's worth fixing before worrying about order at all. A boolean has no concept of "before" or "after"; a timestamped event does, which is also what you'd need to debug a support ticket about a step that "disappeared."

Try it

You can see how an embedded checklist renders step state without assuming order by trying the live preview, or read the integration docs for how step events are reported. For a related failure mode — steps that complete via an async job rather than a request-response call — see how auto-completing steps are structured.

Try it on your app