[Solved] Restarting flows programmatically


Since v0.20, the deploy menu has a new Restart Flows option. Would it be possible to provide a way to invoke this programmatically from within a flow? For example, in cases where message properties have been used to override node parameters set when a node was deployed (not encouraged, I realize, but sometimes a good idea), it could be useful to be able to recover the initial state of the flow.



Looks like it simply POSTs to the API function flows

            type: "POST",
            headers: {
        }).done(function(data,textStatus,xhr) {
            if (deployWasEnabled) {
        }).fail(function(xhr,textStatus,err) {
            if (deployWasEnabled) {
            if (xhr.status === 401) {
            } else if (xhr.status === 409) {
                resolveConflict(nns, true);
            } else if (xhr.responseText) {
            } else {
        }).always(function() {
            deployInflight = false;
            var delta = Math.max(0,300-(Date.now()-startTime));
            setTimeout(function() {

You can do that yourself:


1 Like

Where is the "solved" checkbox?

Brilliant! Thanks a lot. I suspected/hoped that this was available in the Admin API, but I didn't know where to look in the docs. It took me a while to work out the DIY part.



No problem. Just note that I had some problems with jQuery's POST function so I used a raw var request = new XMLHttpRequest() in uibuilder. Though that may be why Nick used $.ajax here rather than $.post(). It is a known bug that triggers a CORS error.

In fact the raw query isn't actually any harder to use than jQuery except that you don't get the promises type interface.

1 Like


Noted. I also had some issues with POST, but it seems to work ok in the particular case I need. If it does go sideways, I'll know what to do.