# Running multiple callbacks

**URL:** <https://community.plotly.com/t/running-multiple-callbacks/41755>\
**Category:** Dash Python\
**Created:** [June 29, 2020, 10:59pm UTC](https://community.plotly.com/t/running-multiple-callbacks/41755 "2020-06-29T22:59:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![monitorcasalab](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/monitorcasalab/32/8866_2.png) [@monitorcasalab](https://community.plotly.com/u/monitorcasalab)\
**Post date:** [June 29, 2020, 10:59pm UTC](https://community.plotly.com/t/running-multiple-callbacks/41755/1 "2020-06-29T22:59:02Z")

</div>

Hi all

So while I am running a dash application I click to run a Machine Learning algorithm, and as it may take longer to run, I would like to refresh plots and query other graphics.

The issue is that once the ML is running, if I trigger another callback the ML gets cancel, Is there any way to allow multiple callbacks to run independently within a dash application?

---

<div class="post-metadata">

**Author:** ![xhlu](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/xhlu/32/12736_2.png) [@xhlu](https://community.plotly.com/u/xhlu)\
**Post date:** [July 9, 2020, 7:37pm UTC](https://community.plotly.com/t/running-multiple-callbacks/41755/2 "2020-07-09T19:37:33Z")

</div>

Correct me if i’m wrong, this is what i understood: in callback A you start training a model, then call a callback B that interrupts the training process of your model?

If that’s right, is one of those scenarios possible:

1. You initialize your model at the beginning of the app, and use it inside your callback A and callback B.
2. Some input for callback B is also used as an input A.

In the case of scenario (1), I’d recommend taking a look at [this tutorial on sharing data between callbacks](https://dash.plotly.com/sharing-data-between-callbacks). If it’s (2), then perhaps you are re-calling callback A when you intended to call callback B. In this case, it might be a good idea to have separate callbacks.

Feel free to share a code snippet to give more detail about your scenario!
