# Automatically restart process at job completion

**URL:** <https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177>\
**Category:** Integrator.io\
**Tags:** sql, batch-size, microsoft-sql, scheduling, netsuite\
**Created:** [April 4, 2024, 4:12pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177 "2024-04-04T16:12:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevensmith](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@stevensmith](https://connective.celigo.com/u/stevensmith)\
**Post date:** [April 4, 2024, 4:12pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177/1 "2024-04-04T16:12:07Z")

</div>

I am building a process flow that is going to do a 1 time import of around 3 million records from a SQL server DB into NetSuite. I am planning on doing it in batches of 100,000 as I am not sure how well it would run if my initial SQL statement pulled all 3 million records at once. It currently takes about 1 hour and 12 minutes to import 100,000 records and then mark them as processed.

1. Is there a way within a process flow to automatically restart the job at the end of the process until all the records are processed so that I dont have to worry about timing gaps between schedules?
2. If it can't be automatically restarted and I have to run it on a schedule, what would happen if there is a delay in the process and the next schedule queues up while the job is still running?

---

<div class="post-metadata">

**Author:** ![davidgollom](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/davidgollom/32/6605_2.png) [@davidgollom](https://connective.celigo.com/u/davidgollom)\
**Post date:** [April 4, 2024, 4:17pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177/2 "2024-04-04T16:17:53Z")

</div>

You can use the Next Integration Flow option in the flow settings and select the same flow. This will create an infinite loop!

---

<div class="post-metadata">

**Author:** ![stevensmith](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@stevensmith](https://connective.celigo.com/u/stevensmith)\
**Post date:** [April 4, 2024, 4:30pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177/3 "2024-04-04T16:30:55Z")

</div>

For some reason that field doesn't show me the current process flows, only other process flows.

---

<div class="post-metadata">

**Author:** ![davidgollom](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/davidgollom/32/6605_2.png) [@davidgollom](https://connective.celigo.com/u/davidgollom)\
**Post date:** [April 4, 2024, 4:40pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177/4 "2024-04-04T16:40:47Z")

</div>

They took that loophole away!! Sorry. If you schedule it frequently it should be fine. It just won't run if it's alrady running. That's been my experience anyway.

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [April 4, 2024, 8:20pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177/5 "2024-04-04T20:20:28Z")

</div>

@stevensmith you can use next integration flow option to run a flow that has a dummy export on it (i.e. exporting 1 single record) and then you have an import step that calls the /v1/flows//run api to trigger the first flow to run again. The export on your second flow could be a select count(\*) from unprocessed\_records. That way it will only loop if there are still records to be processed.

---

<div class="post-metadata">

**Author:** ![scotthenderson](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/scotthenderson/32/6780_2.png) [@scotthenderson](https://connective.celigo.com/u/scotthenderson)\
**Post date:** [April 4, 2024, 11:30pm UTC](https://connective.celigo.com/t/automatically-restart-process-at-job-completion/177/6 "2024-04-04T23:30:48Z")

</div>

Regarding "If it can't be automatically restarted and I have to run it on a schedule, what would happen if there is a delay in the process and the next schedule queues up while the job is still running?"

It is totally harmless to schedule something more frequently then it is able to finish, and it will ignore any new scheduled runs if there is still something in progress.
