# 35 · Run and maintain workflows: versions, stats and runs

**Purpose:** look after a workflow once it is built: save changes without touching live chats, publish them as a new version, go back to an older version, switch the workflow on and off, read its numbers and runs, fix what **Check this workflow** points out, and copy or delete it safely.

## Before you start

- You need to be an **owner** or **admin** to save, publish, switch on or off, restore a version, stop a run, export, duplicate or delete. Agents can open the workflow, its steps (the button reads **Open** instead of **Edit steps**), **Stats**, **Test**, the analytics and the runs of the contacts they are allowed to see.
- A workflow to work on. Building it is in [04 · Chatbot and workflows](https://wsapme.com/guides/chatbot-workflows.md); what can start it is in [33 · Workflow triggers: what can start a flow](https://wsapme.com/guides/workflow-triggers-reference.md); every step type is in **34 · Workflow steps reference** (guide coming soon).
- Test new steps with **Test** in the canvas (or **Preview** on a simple sequence) before you publish. See [10 · Testing chatbots](https://wsapme.com/guides/testing-chatbots.md).

> In this guide nothing was published, switched on, started or stopped. One copy, "Demo: Tempahan kek (copy)", was made with **Duplicate**, and its draft was saved with **Save draft** after **Arrange** (layout only; no version was published). The **Publish** and **Delete** windows were opened and cancelled. The demo workspace has no published workflow and no run history, so versions, numbers and runs show their empty state; those parts are marked *from the documentation, not captured*. Screenshots use a demo workspace with Demo mode on.

**Watch first (3:58, Malay narration):** [Run and maintain workflows: versions, stats and runs](https://wsapme.com/guide-media/video/35-run-and-maintain-workflows-malay.mp4). Save draft against Publish, the Versions menu, Stats on the canvas, the Analytics card, Recent runs, then Duplicate and Delete on a draft copy; nothing is published, switched on or deleted in the video.

## Part 1 · The draft, Save draft and Publish

Every workflow has a **draft**: the steps you see and edit. Customers only ever meet a **published version**. Editing the draft changes nothing for them until you publish.

1. Open **Workflows** and click the workflow. Next to its name is the status: **Draft** (never switched on), **On** or **Off**.

   ![The workflow page with Switch on, Duplicate and Delete](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/01-workflow-page-buttons.webp)

2. In the **Steps** card, click **Edit steps** (a simple sequence opens its list editor instead of the canvas).
3. Read the left end of the toolbar:

   | Text | Meaning |
   |---|---|
   | **Unsaved changes** | You changed something on this screen and have not saved it. |
   | **All changes saved** | The draft is saved. |
   | **Draft not published** | The draft is saved but differs from the live version (amber). |
   | **Not published** / **Live: v3** | No version is live yet / version 3 is live. Click it for the **Versions** menu (Part 3). |

   ![The canvas toolbar: save status, versions, Save draft and Publish](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/02-builder-toolbar.webp)

4. Make your changes. The undo and redo arrows (**Ctrl+Z**, **Ctrl+Shift+Z**) work until you leave the page.
5. Click **Save draft**. The message says "Draft saved." (once a version is live: "Draft saved. Publish it when it's ready."). Customers still get the live version.

   ![After Arrange the status reads Unsaved changes](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/10-unsaved-changes.webp)

   ![Draft saved](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/11-draft-saved.webp)

6. When the draft is ready, click **Publish**. A window asks **Publish version N?**: "New conversations follow these steps right away. Conversations already running finish on the version they started with." If the workflow is off it adds "The workflow is off: switch it on to start new conversations." Click **Publish** to confirm. *In this guide the window was cancelled.*

   ![The Publish version 1? window](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/04-publish-confirm.webp)

After publishing, the message reads "Published as version N. New conversations use it; running ones finish on their own version." **Publish** also saves the draft, so you do not need **Save draft** first. On a simple sequence, **Publish** asks the same question in a browser box ("Publish this sequence? …").

Things that stop a save or publish:

- "N steps need attention before saving. They're marked in red." Fix the red steps.
- "Connect a step after the start before publishing." The start must lead to at least one step.

On the workflow page, the **Steps** card says **Live version N.** and, when the draft has changes that are not live, "The draft has unpublished changes. Publish them in the steps editor."

**Test** can run either the draft or the live version: once a version is live, the test chat has **Steps to test** with **This draft (with unsaved changes)** and **Live version N**.

## Part 2 · Switch on and Switch off

The **Switch on** button is on the workflow page, top right.

- **Switch on** starts the workflow for real chats. If the workflow was never published, the first switch-on publishes the draft as **version 1**. If a version is already live, switching on runs **that live version**, not your newer draft: publish the draft too if you want the changes.
- It refuses with "Add at least one step after the start before switching the workflow on." or "Some steps need attention first. Open the steps to fix them."
- When it works the message says "Workflow is on." and the status reads **On**. **Start for a contact** then appears next to it (see [33 · Workflow triggers](https://wsapme.com/guides/workflow-triggers-reference.md), Part 6).
- **Switch off** stops new conversations **and stops every conversation still running** in this workflow: "Workflow is off. 3 running conversation(s) were stopped." Those runs end with "The workflow was paused". The status reads **Off**.

> **Not executed for this guide:** **Switch on** and **Switch off**. The demo workspace has real WhatsApp numbers connected.

## Part 3 · Versions: restore an older one, or discard the draft

1. In the canvas, click **Not published** (or **Live: vN**) in the toolbar. The **Versions** menu opens.
2. Before the first publish it only says "Nothing published yet. Publish, or switch the workflow on, to make the steps live."

   ![The Versions menu before anything was published](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/03-versions-not-published.webp)

The rest of this part is *from the documentation, not captured* (the demo workflows were never published):

3. Each published version is listed as **Version N** with when it was published, by whom, how many conversations are still running on it, and **Restore to draft**. The live one has a **Live** badge.
4. Click a version to copy it into the draft. The browser asks "Copy version N into the draft?" (with "Your unsaved changes will be lost." when you have some). Then the message says "Version N was copied into the draft. Check it, then publish."
5. **Discard draft** appears at the bottom of the menu when a version is live and the draft differs from it. It asks "Discard the draft and go back to the live version?" and then says "Draft discarded."

Restoring and discarding only change the **draft**. Nothing changes for customers until you click **Publish**, and a restore published again becomes a new version number. Conversations that are running always finish on the version they started with.

## Part 4 · Read the numbers: the Analytics card

On the workflow page, below **Trigger** and **Steps**, the **Analytics** card counts the conversations that **started** in the period.

![The Analytics card with the period and CSV](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/06-analytics-card.webp)

| Tile | Meaning |
|---|---|
| **Started** | Conversations that entered the workflow in the period. |
| **Running now** | Of those, still running or waiting. |
| **Completed** | Reached the end. Below it: share of the conversations that ended. |
| **With the team** | Handed to your team, for example by a **Hand to team** step. Below it: share of the conversations that ended. |
| **Failed or stopped** | Ended by an error (for example a message that could not be sent, or a step that no longer exists), or stopped by your team or by **Switch off**. |
| **Median time** | Typical time from start to end. |

- Choose the period at the top right: **Last 7 days**, **Last 30 days** or **Last 90 days**.
- Once there is more than one version, a second list lets you pick **All versions** or one **Version N**, to compare a new version with the old one.
- The chart shows **Started** and **Completed** per day.
- **How conversations ended** lists every reason with its share and count, for example **Reached the end**, **Ended by an End step**, **Handed to the team**, **Your team replied**, **24-hour window closed**, **A message could not be sent**, **The flow was changed**, **The workflow was paused**, **Stopped by your team**, **The lead did not reply**, **The next workflow was deleted**. *(From the documentation, not captured: it only shows once conversations have ended.)*
- **CSV** (owners and admins) downloads the period's runs: **Started**, **Ended**, **Status**, **How it ended**, **Version**, **Trigger**, **Contact**, **Phone**, **Number**, **Steps**, then one column per answer the flow saved. While Demo mode is on the button is greyed out ("Turn off demo mode to export").

## Part 5 · Stats on the canvas: where conversations go

1. Click **See where conversations go, step by step** at the bottom of the Analytics card, or **Stats** in the canvas toolbar.
2. Each step gets a line such as "120 reached · 8 waiting · 3 stopped · 2 to the team · asked again 4×", and every answer or branch shows the share of conversations that took it. A step nobody reached says "Not reached in this period".

   ![Stats on the canvas](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/05-stats-on-canvas.webp)

Stats always cover the last 30 days and all versions. Look for a step with many "waiting" (customers stop answering there) or a branch nobody takes. Click **Stats** again to hide them.

## Part 6 · Recent runs, Run steps and stopping a run

At the bottom of the workflow page, **Recent runs** lists the 30 newest conversations (a "run" is one contact going through the flow once). The description says how many there were in total and how many are in progress. With no runs it says "No runs yet. Switch the workflow on and send its keyword from a phone to try it."

![Recent runs, empty in the demo workspace](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/07-recent-runs.webp)

The rest of this part is *from the documentation, not captured*:

| Column | What it shows |
|---|---|
| **Contact** | The contact (or "Deleted contact") and the WhatsApp number or social account it ran on. |
| **Status** | **Running**, **Waiting**, **Completed**, **With the team**, **Failed** or **Stopped**, with a line below: "Waiting for an answer", "Waiting for your server", "Waiting until …", or how it ended. |
| **Answers** | What the flow saved from the customer's replies. |
| **Started** | How long ago, and the version (v2). |

- Click **Steps** on a row to open **Run steps**: every step the conversation passed, its outcome (for example "next", "no reply", "waiting reply" or "handed off") with details, and the time.
- Click **Stop** on a running or waiting row to end that one conversation. The message says "Run stopped." and it ends with "Stopped by your team". *Not executed for this guide.*
- Agents only see runs of contacts they are allowed to see.

## Part 7 · Check this workflow

When something a workflow relies on is gone, a **Check this workflow** box appears at the top of the workflow page (and the same warnings above the canvas). *From the documentation, not captured: no demo workflow has a warning.*

| Warning | What to do |
|---|---|
| "A wait starts another workflow when nobody replies, but that workflow was deleted. Choose another one." | Open the wait step and choose another workflow. |
| "A wait enrols the contact in a follow-up when nobody replies, but that follow-up was deleted. Choose another one." | Choose another follow-up in that wait step. |
| "An assign step gives chats to an inbox team that was deleted. Choose another team." | Pick an existing team in the assign step. |
| "An assign step gave chats to [name], who left the workspace. It now assigns to nobody." (or "the next available member (round-robin)") | Choose who should get the chats now. |
| "An Instagram account or Facebook Page this workflow listens to was removed. Untick it in the trigger and choose the account again." | Fix the **Comment on post** trigger. |
| ""Comment on post" doesn't start simple sequences …" | Open the workflow in the canvas. |

A **Go to another workflow** step whose workflow was deleted is not in this list: it gives no warning, and runs that reach it end with "The next workflow was deleted". Check those steps yourself after deleting a workflow.

After fixing the step, **Publish** so the live version gets the fix too.

## Part 8 · Duplicate and Delete

**Duplicate** (workflow page, top right) makes a copy named "… (copy)" and opens it: "Workflow copied."

- The copy is a **Draft** with the same trigger and the current draft steps (including unpublished changes).
- It has **no versions, no runs and no numbers**; nothing from the original's history comes along.
- Use it to try a big change without touching the live workflow, then switch the copy on and the original off when you are happy. A chat runs one flow at a time, so do not leave both on with the same trigger.

  ![The copy, a new draft](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/08-duplicated-copy.webp)

**Delete** opens **Delete [name]?**: "Conversations in this flow stop right away, and its run history is deleted." **Delete workflow** then removes:

- the workflow, its draft and **every version**,
- **all its runs** and therefore its Analytics, Stats and CSV,
- any conversation still running in it: it stops right away.

Check the other workflows that send people to it before you delete. A **Wait** step that waits for a reply and starts it on **No reply** shows a **Check this workflow** warning. A **Go to another workflow** step that points at it gives no warning: its runs just end with "The next workflow was deleted" when they reach that step. There is no undo: to pause a workflow, use **Switch off** instead. *In this guide the window was cancelled.*

![The Delete window](https://wsapme.com/guide-media/img/35-run-and-maintain-workflows/09-delete-confirm.webp)

## Common problems

| Problem | What to do |
|---|---|
| I changed the steps but customers still get the old flow | You saved a draft. Click **Publish** in the canvas (or on the sequence page). **Switch on** alone does not publish a newer draft once a version is live. |
| **Publish** is greyed out | Nothing to publish: the draft equals the live version and there are no unsaved changes. |
| "Connect a step after the start before publishing." | Connect the start to a first step. |
| "N steps need attention before saving." | The steps marked in red have a missing setting. Click each one and fill it in. |
| I published by mistake | Open **Live: vN**, click the previous version (**Restore to draft**), then **Publish**. It goes live as a new version number. |
| Conversations stopped when I switched the workflow off | Switch off ends every running conversation of that workflow. Switch off when it is quiet, or publish a change instead. |
| **CSV** is greyed out | Turn off Demo mode, or ask an owner or admin. |
| The Analytics tiles are all 0 | No conversation started in the period. Choose **Last 90 days**, or check the workflow is **On**. |
| A step shows "Not reached in this period" | Nobody got that far in 30 days. Check the branch that leads to it with **Test**. |
| Right after **Duplicate**, the **Name** box still shows the original name | Reload the page before renaming the copy, otherwise **Save** under Trigger gives the copy the original's name. |
| Runs of some contacts are missing for an agent | Agents only see runs of contacts they may see (see [13 · Inbox settings](https://wsapme.com/guides/inbox-settings-website-chat-and-reports.md), Part 2). |

## Related

- [04 · Chatbot and workflows](https://wsapme.com/guides/chatbot-workflows.md)
- [10 · Testing chatbots](https://wsapme.com/guides/testing-chatbots.md)
- [33 · Workflow triggers: what can start a flow](https://wsapme.com/guides/workflow-triggers-reference.md)
- **34 · Workflow steps reference** (guide coming soon)
