Should Stop
Should Stop
Section titled “Should Stop”Type: should-stop · Package: Core Activities v1.0.8 · Output: bool
Since: v1.0.5
Returns true when someone asked to Stop the execution: from the Zoan Cloud portal, from the Designer or from the Agent tray. It lets the process stop at a safe point —before taking the next item, between two steps— and close cleanly, instead of being left halfway.
It does not stop anything by itself: you decide where to check it and what to do if it returns true (usually exit the loop with Break and let the cleanup run).
How it works
Section titled “How it works”- It answers instantly, without waiting: you can check it on every pass of a loop at no cost.
- Once a stop has been requested, it returns
trueon every later check in that execution, also inside invoked playbooks and processes. - Each time it returns
true, it logs:Stop requested: finishing cleanly.
Stop and Terminate
Section titled “Stop and Terminate”| Action | What it does | How the execution ends up |
|---|---|---|
| Stop | Asks the robot to stop when it finishes what it is doing. The process sees it with Should Stop. | Stopped (stopped) |
| Terminate | Cuts the execution off immediately. Whatever it was doing is left halfway; the finally of a Try / Catch has a few seconds to close what is open. | Cancelled (cancelled) |
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”| Type | Description |
|---|---|
bool | true if a stop of the execution was requested; false otherwise. |
Example
Section titled “Example”Process a list and stop cleanly if someone asks to stop:
For Each items = elements itemVariable = element └─ activities: Should Stop → output: stop If condition = stop └─ then: Log message = "Stop requested: some elements were left unprocessed." Break // the next element is not taken Invoke Playbook path = "ProcessElement.json" input = { element: element }The element in progress always finishes; the next one doesn’t start, and whatever comes after the loop (the log, closing the application) runs normally.
Common errors
Section titled “Common errors”This activity cannot fail: it always returns true or false.
Related activities
Section titled “Related activities”- Break — exit the loop when a stop is detected.
- Try / Catch — the
finallyalso runs if the execution is terminated. - Process Queue — honors the stop by itself.