# Add stage without running its command

**URL:** <https://discuss.dvc.org/t/add-stage-without-running-its-command/644>\
**Category:** Questions\
**Created:** [January 28, 2021, 5:27pm UTC](https://discuss.dvc.org/t/add-stage-without-running-its-command/644 "2021-01-28T17:27:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauro](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/mauro/32/88_2.png) [@mauro](https://discuss.dvc.org/u/mauro)\
**Post date:** [January 28, 2021, 5:27pm UTC](https://discuss.dvc.org/t/add-stage-without-running-its-command/644/1 "2021-01-28T17:27:08Z")

</div>

Hi, I have a script that takes hours to complete. I already run it outside dvc and collected its output. Is there a way to add a stage to the dag with that script avoiding to run it again, pointing the right input/output/dependencies? In other words, since computation takes too much time, i would like to skip it and let dvc do the hashes and complete the run without actually executing the script. Is it possible?

Thanks

---

<div class="post-metadata">

**Author:** ![isidentical](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@isidentical](https://discuss.dvc.org/u/isidentical)\
**Post date:** [January 28, 2021, 8:18pm UTC](https://discuss.dvc.org/t/add-stage-without-running-its-command/644/2 "2021-01-28T20:18:08Z")

</div>

You could possibly try out `--no-exec` parameter to create dvc run (this would not execute the stages, but rather create/modify the dvc.yaml) and use `dvc commit` to lock your files in.

---

<div class="post-metadata">

**Author:** ![mauro](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/mauro/32/88_2.png) [@mauro](https://discuss.dvc.org/u/mauro)\
**Post date:** [January 29, 2021, 4:14pm UTC](https://discuss.dvc.org/t/add-stage-without-running-its-command/644/3 "2021-01-29T16:14:56Z")

</div>

It seems the solution, but I am using [multiple stages generation feature](https://dvc.org/doc/user-guide/project-structure/pipelines-files?_ga=2.112395713.418137152.1611829605-1008788008.1610618428#generating-multiple-stages) writing directly the dvc.yaml file. Is it possible to skip execution with dvc repro?

---

<div class="post-metadata">

**Author:** ![skshetry](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@skshetry](https://discuss.dvc.org/u/skshetry)\
**Post date:** [January 30, 2021, 4:42am UTC](https://discuss.dvc.org/t/add-stage-without-running-its-command/644/4 "2021-01-30T04:42:59Z")

</div>

@mauro, you can just do `dvc commit`, which will generate the `dvc.lock` file and store the outputs to `dvc`'s cache. This way, it should not run again on `repro`, do verify it with `dvc status` first though.

---

<div class="post-metadata">

**Author:** ![mauro](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/mauro/32/88_2.png) [@mauro](https://discuss.dvc.org/u/mauro)\
**Post date:** [February 2, 2021, 6:22pm UTC](https://discuss.dvc.org/t/add-stage-without-running-its-command/644/5 "2021-02-02T18:22:28Z")

</div>

it worked, thanks @skshetry!
