---
title: "Comment by Hayrullah Kar on \"Long-Running AI Jobs: Webhooks You Can Trust\" | Hashnode"
description: "I liked that the reconciler goes through the same apply function as the webhook, so there is only one place where a job can finish. There's one gap before the p"
url: "https://hashnode.com/posts/long-running-ai-jobs-webhooks-you-can-trust/6afb1ce146bd74a0a530d2ef/comment/6afbf9e59dae916a762bb97c"
---

[Discussion](https://hashnode.com/posts/long-running-ai-jobs-webhooks-you-can-trust/6afb1ce146bd74a0a530d2ef)

Comment [Long-Running AI Jobs: Webhooks You Can Trust](https://hashnode.com/posts/long-running-ai-jobs-webhooks-you-can-trust/6afb1ce146bd74a0a530d2ef)

[Hayrullah Kar](https://hashnode.com/@magesheet)

[Nov 17](https://hashnode.com/posts/long-running-ai-jobs-webhooks-you-can-trust/6afb1ce146bd74a0a530d2ef/comment/6afbf9e59dae916a762bb97c)

I liked that the reconciler goes through the same apply function as the webhook, so there is only one place where a job can finish. There's one gap before the provider is even involved. The API writes the job row first and then calls replicate.create. If the process dies, or the create call fails, between those two steps, the row stays running with no predictionId. No webhook will ever come, and reconcile() ends up calling replicate.get with nothing to look up. I'd give the row a 'submitting' state, store the prediction id in the same step that moves it out of that state, and have the reconciler handle old 'submitting' rows on their own: fail them with an alert, or create again. A create that timed out may still have started a prediction, so checking the provider's recent predictions before creating again avoids running the model twice.
