Best answer

When Using CodeByZapier (with array of outputs) in a SubZap - getting Did you fork or replay this step? We expected callbackUrl to be stored!

  • 19 November 2023
  • 6 replies
  • 42 views

Hi there,

I have code (JavaScipt) that is outputting multiple results.  This then runs all the following steps multiple times with each of the results.

All this is happening inside of a subzap.

I get the error “Did you fork or replay this step? We expected callbackUrl to be stored!” everytime I run the subzap.

Everything works.  The zap does what it is suppose to do.  I just get an email telling me there was an error and I see the error in my history.  I would rather not see or hear about errors is possible.

I really would rather not pull the code step out of the subzap as I use the subzap in many (more than 6) zaps and would have to edit all of them every time I changed the code.

 

Any ideas on how to stop this error.

Thanks

 

icon

Best answer by DharmaMarc 20 November 2023, 00:03

View original

6 replies

Userlevel 7
Badge +14

Hi @DharmaMarc 

Good question.

Can you show screenshots of the encountered error in context with the Zap step where it happens?

Sub-Zap help article: https://help.zapier.com/hc/en-us/articles/8496308527629-Build-reusable-Sub-Zaps#4-add-actions-to-your-sub-zap-0-3

 

A different approach than using a Sub-Zap would be to use Zap chaining via webhooks.

 

Thanks Troy,

This is inside the SubZap so I don’t think your ‘Note’ applies here.

I had read the article you posted before I posted my question.

Having just reread it perhaps this is the reason.  Maybe returning multiple records acts like a loop.

Adding Loop actions within a Sub-Zap:

  • Loop actions can't be added before a Return from Sub-Zap step within a Sub-Zap.

If this is the case, I guess I am sunk.  I could live with the error as if does not effect the outcome but I am worried that zapier will turn it off as I notice they say:

Zapier will automatically turn off your Zap if it:

  • Errors 95% of the time it runs.
  • Has run more than 20 times in the past 7 days.

 

Thanks, Marc

@Troy Tessalone  I realized I didn’t @ you in my reply.  My apologizes. 

Userlevel 7
Badge +14

@DharmaMarc 

In your original screenshot of the Zap steps, I don’t see the Looping app being used.

 

Can you show screenshots of these:

How the Sub-Zap Return step is configured?

The DATA IN/OUT for this step from the Zap Runs history: https://zapier.com/app/history/

 

@Troy Tessalone  I am not sure what you mean.  Not much to configure

I have tried it with and without an Output / Return Value sent. Neither changes the error behavior

I have also tried using the Output / Return Value after in the main zap after the subZap finishes.  Neither changes the error behavior

I think I just thought of a way to fix the issue.  It took me a bit of time to figure out why it might generate an error.  I will let you know, if it works.  

Found A Solution!

I was thinking of why Zapier would have this error and it occurred to me that they are not handling the times there are multiple return subzaps within a single run of a subzap.  So…

I added an object in the return array of my JavaScript (step 7) and called it done.  It is set to false for all but the last set of objects in the output array when I set it to true.

Then, before the subzap return,  a simple check to skip the next step if done is false

This Stopped the error from occurring as the return only happens once.

 

 

Reply