# \[Solved\] Restarting flows programmatically

**URL:** <https://discourse.nodered.org/t/solved-restarting-flows-programmatically/9341>\
**Category:** Feature Requests\
**Created:** [23 March 2019 03:20 UTC](https://discourse.nodered.org/t/solved-restarting-flows-programmatically/9341 "2019-03-23T03:20:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 March 2019 13:48 UTC](https://discourse.nodered.org/t/solved-restarting-flows-programmatically/9341/2 "2019-03-23T13:48:54Z")

</div>

Looks like it simply POSTs to the API function `flows`

```auto
        $.ajax({
            url:"flows",
            type: "POST",
            headers: {
                "Node-RED-Deployment-Type":"reload"
            }
        }).done(function(data,textStatus,xhr) {
            if (deployWasEnabled) {
                $("#btn-deploy").removeClass("disabled");
            }
            RED.notify('<p>'+RED._("deploy.successfulRestart")+'</p>',"success");
        }).fail(function(xhr,textStatus,err) {
            if (deployWasEnabled) {
                $("#btn-deploy").removeClass("disabled");
            }
            if (xhr.status === 401) {
                RED.notify(RED._("deploy.deployFailed",{message:RED._("user.notAuthorized")}),"error");
            } else if (xhr.status === 409) {
                resolveConflict(nns, true);
            } else if (xhr.responseText) {
                RED.notify(RED._("deploy.deployFailed",{message:xhr.responseText}),"error");
            } else {
                RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
            }
        }).always(function() {
            deployInflight = false;
            var delta = Math.max(0,300-(Date.now()-startTime));
            setTimeout(function() {
                $(".deploy-button-content").css('opacity',1);
                $(".deploy-button-spinner").hide();
                $("#header-shade").hide();
                $("#editor-shade").hide();
                $("#palette-shade").hide();
                $("#sidebar-shade").hide();
            },delta);
        });

```

You can do that yourself:

[https://nodered.org/docs/api/admin/methods/post/flows/](https://nodered.org/docs/api/admin/methods/post/flows/)

---

_[View the full topic](https://discourse.nodered.org/t/solved-restarting-flows-programmatically/9341)._
