# How to check if a background job was already created?

**URL:** <https://discuss.hangfire.io/t/how-to-check-if-a-background-job-was-already-created/1916>\
**Category:** question\
**Created:** [April 3, 2016, 2:32pm UTC](https://discuss.hangfire.io/t/how-to-check-if-a-background-job-was-already-created/1916 "2016-04-03T14:32:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddybubble](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@buddybubble](https://discuss.hangfire.io/u/buddybubble)\
**Post date:** [April 3, 2016, 2:32pm UTC](https://discuss.hangfire.io/t/how-to-check-if-a-background-job-was-already-created/1916/1 "2016-04-03T14:32:47Z")

</div>

In our environment, it may happen that a Backgroundjob is requested to be scheduled more than once.  
I need to be able to check if this requested job (identified by a unique id) has already been created. How do I do that?

I have only been able to create recurring jobs with an id so I can find them later, but not execute-once background jobs…

---

<div class="post-metadata">

**Author:** ![LeadMagnet](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/leadmagnet/32/548_2.png) [@LeadMagnet](https://discuss.hangfire.io/u/LeadMagnet)\
**Post date:** [April 18, 2016, 9:54am UTC](https://discuss.hangfire.io/t/how-to-check-if-a-background-job-was-already-created/1916/2 "2016-04-18T09:54:31Z")

</div>

I had a similar requirement. I addressed it by adding the unique ID to the method being called for Hangfire en-queueing. Then parse the “Arguments” field of the “Job” table. Had to parse it twice, once to get out the method arguments JSON, then into a JSON object. Check the ID against internal logic to decide if scheduling that task was required.

May not be pretty, but works a treat! 😛

HTH
