Skip to main content

I have a Zap that uses an integration’s action that may raise an exception if the data doesn’t follow certain business rules.

Is there a way to catch an error in a Zap such that it could be handled then the action retried?

I could use the “Looping” feature to retry the action a set number of times, but I don’t know how to catch an error such that the Zap continues to work.

Hi @craibuc 

Good question.

To prevent the Zap Run errors, you should add logic to the Zap steps to format or filter the data.

Failed Zap Runs can be rerun from the Zap history: https://zapier.com/app/history/

https://help.zapier.com/hc/en-us/articles/8496241726989-Replay-failed-Zap-runs


Format or filter which data?  The error?

I don’t want to manually rerun the Zap, instead the Zap needs to process the step that failed N-1 additional times.


@craibuc 

Format/Filter the data that is causing the error.

For example, if a field expects a date in a certain format, then you can prevent the error by formatting the date to be in the format expected by the field.

The Formatter app can help with data formatting.

The Filter app can be used to filter data that should not continue to be processed.

 

Turn on autoreplay for failed Zap runs

miscEye icon Note

Autoreplay is only available on Professional, Team, or Company plans.

If you enable Autoreplay, Zapier will attempt to replay any failed steps automatically. 

Enable autoreplay for your entire account

This will autoreplay all Zaps that error in your account. In Teams and Companies accounts, only admins and owners can enable this feature for all Zaps in the account.

  1. Go to the Zap Runs tab in your Zap History.
  2. In the upper right, click to toggle the Autoreplay switch on.

Enable autoreplay for an individual Zap

miscEye icon Note

This feature is only available in Zapier for Companies accounts.

Members can enable Autoreplay for an individual Zap. This overrides the account-wide Autoreplay settings.

  1. Open your Zap in the Zap editor.
  2. In the left sidebar, click 3451c46a93d480da52444589a8fc84ff.pngSettings.
  3. In the Autoreplay override section, select an option for this Zap:
    • Use account setting: the Zap will autoreplay according to the current account-wide setting. The account-wide setting is shown in parentheses.
    • Always replay: the Zap will always autoreplay when there’s an error.
    • Never replay: the Zap will never autoreplay when there’s an error.

 

How Autoreplay works

  • If a step in a Zap run fails, Zapier will replay the step up to 5 times. While Autoreplay is active:
    • Zapier will not send any error notification emails.
    • Your Zapier Manager Zaps will not trigger.
    • You can still manually replay the failed step.
  • Zap runs that are being replayed (or scheduled to be replayed) will show up as "Scheduled" in Zap History.
  • Zapier backs off after each successive failed replay attempt on this schedule:
    • 5 minutes
    • 30 minutes
    • 1 hour
    • 3 hours
    • 6 hours.
actionEdit icon Example

If a Zap errors at 1:00 PM, Autoreplay will try again at:

  • 1:05
  • 1:35
  • 2:35
  • 5:35
  • 11:35.

The final replay will occur about 10 hours, 35 minutes after the first error.

  • If you edit your Zap after the original error occurs, any future Autoreplay attempts will use the current version of the Zap. This gives you the chance to update your Zap to help with preventable errors.
  • When Autoreplay attempts to replay a step:
    • If the Zap is off, no additional replay attempts will run.
    • If you've disabled Autoreplay between autoreplay attempts, no additional replay attempts will run.
    • If your Zap is off between replays but you turn it on before the next replay attempt, the Zap will still attempt to replay.
  • Autoreplay only attempts to replay if a step errors. But, any halted or errored steps in the Zap will also replay when the attempt occurs.
  • If Zapier cannot successfully replay the Zap run after the last attempt:
    • Zapier will send you an email notifying you of the error.
      • This is the only notification about the error Zapier will send if you enable Autoreplay.
    • Zapier will trigger any Zapier Manager Zaps you have.

Although Zapier Provides ways to handle errors, format mismatched data and provide conditional logic.

But you Won’t find too much options for handling errors like you have in the coding and programming.

For Answering your question here are some ways to handle or atleast prevent those errors.

  • Set Filters: You can set a filter before the action that is prone to errors, so that you don’t continue if the data is not coming as the format you are expecting it to be.

  • Set Formatter Step: If you are receiving your desired data but not in the form that you desired it to be. you can set formatter step. examples would be to remove unnecessary spaces or problematic characters, formatting phone numbers in international formats etc.

  • Make Fields Required: If some fields in your ‘action’ app are required, make sure to make them required in the triggering app as well so there is no probability of missing fields.

  • Set Fallback values: As last resort if all you want is the action to work, you can set fallback/default values for the data that is not coming in the correct form, and there is no way for you to know what there is, but you still want to continue the steps. you can use Code By Zapier step, it will require you to know either javascript or python programming, or take help or ChatGPT.

Unlike programming where whole data is programmatic we can use fallback values and greater range of error handling, the data in zapier is coming from human and there is no way for us to know the data if it is not coming in desire form or coming at all.