Just to piggyback off this, I’ve found that the text-davinci-003 model does an excellent job of dynamically writing JSON using variables from a previous Zap step. We haven’t stumbled into a failure yet and it’s consistent enough to rely on in a production environment.
As an example, the prompt below provides OpenAI with an example JSON snippet and tells it where to replace placeholder text. In the example below, I’m providing OpenAI with a JSON snippet that includes 2 child arrays. When there are a different number of child arrays presented on any given Zap run, OpenAI correctly accounts for the structural changes in the output JSON.
This is extremely helpful in terms of reducing or eliminating the need to account for different variations of code. It’s allowed us to work around limitations in several native Zapier integrations for apps where custom webhook requests do a better job.