简体   繁体   中英

Get a Zap to be halted with Python Code by Zapier

Since tasks in Zapier are critical, I've been trying to reduce task usage to a minimum with Python code steps. Zapier states that:

The following do not count as tasks: [...] Any step that errors or halts. [...]

Therefore I've been raising an exception in Python each time certain conditions are not met. This way the action step errors and will not be counted as a task.

In the documentation ofZapier there are two types of errors:

Errored : the Zap errored while running. If a Zap errors repeatedly each time it runs, it will be automatically paused.

Halted : the Zap run was stopped on purpose by Zapier. Unlike Errored, multiple Zap runs that are halted will not automatically pause your Zap.

It might be that the Zap will be paused, since the Zap is triggered by a Webhook that will be caught very frequently and only in the rarest cases all conditions are fulfilled.

Is there any possibility to raise an exception that will put the Zap on halt so it will not be paused eventually?

Thank you guys in advance:)

if variable == 'example':
    #RUN CODE
else:
    raise Exception('CONDITIONS ARE NOT FULFILLED!')

You could try:

raise ValueError('CONDITIONS ARE NOT FULFILLED!')

This should cause the Zap to halt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM