You can use a Webhook Zibot to capture payload data from Ziflow flows and test that data using the JSONata Exerciser. This is useful for:
- Debugging failed flows
- Understanding the data Ziflow sends during a flow
- Building JSONata expressions that can be used to reference specific payload fields
Note on terminology:
In Ziflow documentation, Ziflow Tokens are placeholders you can insert into flows, templates, or notifications to display dynamic content (for example, {proof.name}).
To avoid confusion, this page uses JSONata expressions to refer to developer-level references to specific data fields within a flow’s payload.
Test payload data with the JSONata Exerciser
Capture data payload
A Webhook Zibot lets you “listen” to the raw data that Ziflow sends when an event or Zibot executes and capture the full payload for the flow (e.g., intake form processing or Zibots with desired data output). The payload will appear in your webhook.site log.
🔐 Security reminder: This method is for testing only. Protect production data by using an API key or secure login for real integrations.
In the example below, we will capture the response from the Decision made on Proof - Accepted event.
- Create or edit a flow.
- Add a Webhook Zibot at the point in the flow where you want to capture data.
If you’re troubleshooting a failure, add the Webhook Zibot before the failing Zibot so you can see the payload. -
Configure the Webhook Zibot:
Set Request type to POST.
Generate a temporary endpoint URL from https://webhook.site/ and paste it into the URL field. Use the copy option to avoid errors.
Note: URLs from webhook.site expire after ~1 week, so create a new one as needed.
-
In the Body field, enter:
#{$}#to capture the full payload for the flow. You will get an "Invalid JSON format" error, but it can be ignored.
A # on either side of an expression means that it's referencing JSONata instead of regular JSON.
- Run the flow. When it executes, the payload will appear in your webhook.site log.
After the flow is successfully run on the webhook.site, you’ll see this: - Delete the listener Zibot to avoid errors when the URL expires in 7 days.
Test payload data with the JSONata Exerciser
Once you’ve captured a payload, you can use the JSONata Exerciser (try.jsonata.org) to experiment with expressions.
- Copy the entire payload without the first and last quotation marks.
- Paste it into the JSONata Exerciser.
- Select the format icon (above the input window) to add line breaks for readability.
-
Enter a JSONata expression in the top-right field to extract data. It will narrow down the results on the lower-right (don’t put a period after the last piece of the token, or you’ll get an “
unexpected" end of expression).
Examples
$.proof.versions → lists all proof versions.
$.proof.versions[-1] → the current proof version.
$.proof.versions[-2] → the previous proof version.
-
Type in
$.proof.versionsto view only the versions. -
Type in
$.proof.versions[-1]- [-1] gives you the current proof
- [-2 ]would give you the previous proof
You can test that by seeing what displays below with each value.
Save and share your work
To save or share your session in the JSONata Exerciser, select the share icon and bookmark the generated URL.
If you navigate away without saving, your current view will be lost.
Additional resources
-
Exerciser for JSON: jsonpath.com
-
Library for JSON: https://goessner.net/articles/JsonPath/index.html#e2
-
Library for JSONata: http://docs.jsonata.org/overview.html
Comments
0 comments
Please sign in to leave a comment.