Publish a process
Save keeps your work; Publish changes what runs. Each publish is a numbered version, a run keeps the version it started on, and the line under the title says whether what you see is live. Writing this we found Publish stopping after it saved unsaved edits, and fixed it.

A process designer has two buttons that both sound like "keep this": Save and Publish. They do different things, on purpose.
- Save keeps your work. The drawing is stored, and nothing that runs changes.
- Publish changes what runs. The saved drawing becomes the next version, and the next run that starts uses it.
The reason for two is that a process may already be running. Somebody's leave request may be waiting for their manager right now. If correcting a typo at 4pm changed the process under that request, it could skip a step the request already passed, or wait at one it will never reach. So the engine only ever reads what you've published, and each publish is a frozen copy.
We used the Parallel Sign-Off sample from samples/solutions/bpms-parallel-sign-off.
Which state you are in
The line under the title says it. We opened the sample just after importing and publishing it:

It reads one of three things:
| It says | It means |
|---|---|
| Not published yet | Nothing can run this process. |
| Version 1 is running, and matches what you see | The canvas is what's live. |
| Version 1 is running. You have unpublished changes | Your saved edits aren't live yet. |
Nothing changed, nothing to publish
Select Publish on a process that matches what's running and it says so, rather than adding a version identical to the last:

A history of identical versions is one nobody can read.
Save, then look at the line
We changed the process description and selected Save. The line changed:

Saved, not live. Every run that starts now still uses version 1. You can save as often as you like while you work; nobody running the process sees it.
Publish
Select Publish. It becomes version 2 and the line says so. If you have unsaved edits, Publish saves them first, because publishing what is on the screen is what the word means:

That second case didn't work until we tried it. Publish with unsaved edits saved them and then stopped, silently, so the line still said the changes weren't live. It checked whether the save had landed by reading a value from before the save, which always said "not saved yet". It now asks the save directly, and the picture above is one press of Publish. We fixed it while writing this.
Publish waits for the problems list to be empty. A process with problems wouldn't run, so the button is unavailable while the problems panel lists anything.
A run keeps its version
To see what happens to a run that is already going, we started one on version 2 with Start a run, then changed the process and published version 3. The Runs page lists every run, with the version it is on:

Version 3 is live, and that run is still on 2. A run finishes on the version it started on, whatever you publish meanwhile. New runs take the latest.
(We then stopped that run from its own page. Start a run starts a process about no record in particular, and this sample's scripts read the purchase order it was started from. Start it from an order's Send for sign-off button instead, as the next articles do.)
No unpublish
There's no button to withdraw a version: somebody may be running it. To go back, put the earlier drawing on the canvas and publish it as the next version. You can get the earlier drawing from an exported file, with Import JSON. The history stays whole, which is what makes it worth having.
In a solution
A process travels in its solution. Importing the solution into another environment brings the process and publishes it there, because an import is a deployment rather than a draft to work on. Each environment has its own published versions, because each has its own runs. A process travels in a solution follows one across.
What publishing does, step by step
When you press Publish, the platform:
- Saves whatever is on the canvas, if you have unsaved edits.
- Checks the whole process, with the same checks the problems panel makes: one start, a finish reachable from every step, a condition on every branch's way out, variables declared, every script readable. A design from a file or from the assistant is checked exactly the same way.
- Freezes a copy as the next version: version 1, 2, 3, never reused.
- Points new runs at it. Runs already going stay on the version they started on.
Nothing about the runs in progress changes at any point. That is what lets you publish at four in the afternoon on a process that has twenty leave requests waiting for managers.
A working rhythm
Save and publish do different jobs, so they have different rhythms:
| Moment | Press | Why |
|---|---|---|
| You've drawn a few steps and want to stop for lunch | Save | Nothing runs it yet; your work is kept |
| You've finished a change and want to try it in Development | Publish, then Start a run or create a record | A run uses only published versions |
| You've tried it and it works | Export the solution for Test | Moving between environments is a solution's job |
| You spot a typo in a step's description | Save now, Publish with the next real change | A version per typo makes the history hard to read |
In Test and Production you rarely publish by hand at all: importing a new version of the solution publishes the process there.
Going back
Because versions are never withdrawn, going back to an earlier design is going forward with it:
- Find the earlier design: an exported file from that time, or the solution's earlier package.
- Import JSON it onto the canvas. The import replaces the drawing and doesn't save.
- Check it, Save, and Publish. It becomes the next version, say version 5, with version 3's design.
The runs that started on version 4 finish on version 4; everything after starts on version 5. The history shows exactly what happened and when, which is what anybody asking why did this request go to Finance? needs.
That is a good reason to export the process before a large change: the file is your way back.
Questions that come up
Do runs on an old version ever move to the new one? No. A run finishes on the version it started on, so it never meets a step it hasn't been drawn for. If old runs must follow a new rule, finish or stop them, then start them again.
Can two versions run at the same time? Yes, whenever runs started before and after a publish are both still going. Each follows its own version; the Runs page shows which is which.
Does publishing need special permission? It is part of building, so makers who can edit the process can publish it in that environment.
Try it
Open any process and read the line under the title. Change a step's description, and select Publish without saving first. You get both messages, and the line says the new version is running.
Next: a two-step approval, run from start to finish.