Skip to content

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).

  • 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 true on every later check in that execution, also inside invoked playbooks and processes.
  • Each time it returns true, it logs: Stop requested: finishing cleanly.
ActionWhat it doesHow the execution ends up
StopAsks the robot to stop when it finishes what it is doing. The process sees it with Should Stop.Stopped (stopped)
TerminateCuts 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)

See States and life cycle.

None.

None.

TypeDescription
booltrue if a stop of the execution was requested; false otherwise.

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.

This activity cannot fail: it always returns true or false.

  • Break — exit the loop when a stop is detected.
  • Try / Catch — the finally also runs if the execution is terminated.
  • Process Queue — honors the stop by itself.