tr Skip to content
Black Friday FlowMattic for life, 12 payments of $33.25 Or $399 once. Nothing added for splitting Ends in --Days --Hrs --Min --Sec See the deal

JSON Parser: Parse, Build and Edit JSON in WordPress Workflows

FlowMattic JSON Parser module: a webhook payload is parsed into separate fields such as customer_email, total and status for the next workflow step.

The JSON Parser in FlowMattic reads, checks, reshapes and writes JSON inside a workflow. It turns an API response or webhook payload into fields you can map, pulls one value out of a deep object, builds a request body from form fields, and saves JSON as a file, all without code.

If you connect WordPress to APIs, webhooks or AI agents, JSON is the format in the middle. This guide walks through all eleven actions, including the newer Build JSON Object and Edit JSON Fields, with real input and output and the details that matter in production.

What is the JSON Parser?

JSON Parser by FlowMattic is a built-in action module. The step picker lists it under Utilities as “Parse and extract values from raw JSON”, and it is one of the apps offered on the picker’s home view. It runs on your own WordPress server, next to the other data tools.

Its eleven actions fall into four groups:

  • Read: Parse JSON, Get JSON Value by Path, Validate JSON.
  • Reshape: Build JSON Object, Edit JSON Fields, Merge JSON Objects.
  • Convert: Stringify JSON, Minify JSON, Prettify JSON, JSON to Query String.
  • Save: Create File from JSON, which writes a .json file to the Media Library.

How the JSON parser works

  1. Add a trigger or step that produces JSON, such as a webhook, an API Request or an AI agent.
  2. Add a step and choose JSON Parser by FlowMattic.
  3. Pick an action. Its fields appear below it.
  4. Paste JSON or, more often, map it from an earlier step with a dynamic tag.
  5. Test the step. Every field it returns can be mapped into later steps.
FlowMattic workflow builder showing the JSON Parser by FlowMattic step with the Parse JSON action and an order payload in the JSON Data to Parse field.
A JSON Parser step set to Parse JSON, with a sample order payload in JSON Data to Parse.

Parse JSON is the action most people start with. It takes the payload in JSON Data to Parse and returns every key as its own field, joining nested keys with underscores:

Input:
{"order_id": 1042,
 "customer": {"name": "Priya Sharma", "email": "[email protected]",
              "address": {"city": "Pune"}},
 "tags": ["vip", "new"]}

Output fields:
order_id               1042
customer_name          Priya Sharma
customer_email         [email protected]
customer_address_city  Pune
tags_0                 vip
tags_1                 new

Every action and its fields

ActionFieldsReturns
Parse JSONJSON Data to ParseEach key as a field
Validate JSONJSON String to Validateis_valid, json_type, items_count, message
Stringify JSONData to Convert to JSON Stringjson_string
Minify JSONJSON to Minifyminified_json, original_size, minified_size, saved_bytes
Prettify JSONJSON to Prettifyprettified_json
Get JSON Value by PathJSON Data, JSON Pathpath, value, type
Build JSON ObjectFields (key and value rows), Value Typesjson plus each top-level key
Edit JSON FieldsJSON Object, Rename Keys, Keep Only These Keys, Remove These Keysjson plus each top-level key
Merge JSON ObjectsFirst JSON Object, Second JSON Objectmerged_json
JSON to Query StringJSON Dataquery_string
Create File from JSONJSON Data, File Namefile_url, attachment_id, file_name, file_size, records

Get JSON Value by Path

JSON Path accepts dot or slash notation, so user.address.city and user/address/city are the same. For list items, use the index: items.0.sku. The step returns the value and its type; an object or list comes back as a JSON string. A path that doesn’t exist returns “Path not found in JSON.”

Build JSON Object

Added in FlowMattic 7.3.0, Build JSON Object makes an object from key and value rows. A dotted key such as customer.email creates a nested object. Value Types has two options: “Convert numbers, true/false, null and JSON” and “Keep every value as text”.

Rows:                         Output (json):
customer.email  [email protected]   {"customer": {"email": "[email protected]",
customer.name   Yuki Tanaka                      "name": "Yuki Tanaka"},
total           49.90               "total": 49.9,
zip             01234               "zip": "01234",
paid            true                "paid": true,
meta            {"a":1}             "meta": {"a": 1}}
FlowMattic JSON Parser step with the Build JSON Object action, showing key and value rows such as customer.email and the Value Types setting.
Build JSON Object turns key and value rows into a nested object, with dotted keys for nesting.

Edit JSON Fields

Also new in 7.3.0, Edit JSON Fields changes the top-level keys of an object in a fixed order. Rename Keys runs first and each renamed key keeps its place. Keep Only These Keys then drops every key not in its comma-separated list, and Remove These Keys deletes the keys you name. All three are optional.

Use cases

Send form data to an API in the shape it expects

A SaaS signup API wants {"customer": {"email": …, "name": …}, "plan": …}. Build JSON Object turns flat form fields into that nested body, ready to map into the request.

Flow: Form submission → Build JSON Object → API Request (POST)

Strip internal fields before forwarding a payload

An agency relays leads to a client’s system but must not pass on internal notes or IDs. Edit JSON Fields removes them and renames keys to match the client’s naming.

Flow: Webhook (Capture Webhook Response) → Edit JSON Fields → Webhook Outgoing (Submit Data to Webhook)

Route on a value buried in an API response

A shipping API returns a deep response and you only care about one status. Get JSON Value by Path with data.shipments.0.status pulls it out, and a Router sends each status down its own path.

Flow: Schedule → API Request (GET) → Get JSON Value by Path → Router

Reject malformed webhook payloads

Check a raw body before anything is stored. Validate JSON with Ignore Errors switched on reports is_valid, and a Filter continues only when it is true.

Flow: Webhook → Validate JSON → Filter → Parse JSON → WP Tables (New Record)

Turn an AI agent’s JSON answer into a record

Ask an AI agent to classify a support email and reply in JSON with category, urgency and summary. Parse JSON splits the reply into fields you can save or route on.

Flow: Email received → AI Agent → Parse JSON → WP Tables (New Record)

Build campaign links with UTM parameters

Marketing builds utm_source, utm_medium and utm_campaign as an object, converts it to utm_source=newsletter&utm_medium=email… and appends it to the landing page URL before shortening.

Flow: Form submission → Build JSON Object → JSON to Query String → Link Shortener

Keep a nightly JSON snapshot

Pull data from an API each night and save it as a dated .json file in the Media Library, then copy the file to an off-site server.

Flow: Schedule (Every Day) → API Request (GET) → Create File from JSON → FTP (Upload a file)

Tips and gotchas

  • Underscores, not dots. Parse JSON names nested fields with underscores, such as customer_address_city. A list at the top level becomes indexed fields like items_0_sku, while a list of objects nested deeper comes back as one JSON string. Loop over that string with an Iterator.
  • Validate JSON reports invalid input as an error. That marks the run as failed in Task History. If you only want to branch on is_valid, switch on Ignore Errors in the step’s settings.
  • Some values stay text on purpose. With conversion on, values with a leading zero or plus sign and numbers longer than 15 digits are kept as text, so ZIP codes, phone numbers and long IDs survive intact. Pick “Keep every value as text” when an API wants strings everywhere.
  • Edit JSON Fields is top level only. Keep and Remove use the names after renaming, so list the new name if you renamed a key.
  • Merging is deep, and lists merge by position. Nested objects are combined and the second object wins on conflicts. A list in the second object replaces items by index, so ["a","b","c"] merged with ["x"] gives ["x","b","c"].
  • Query strings follow URL rules. Spaces become + and nested lists become bracketed keys, such as tags%5B0%5D=a.
  • Files never overwrite each other. Create File from JSON adds the .json extension if missing, names unnamed files json-export-{date}.json, and appends -1, -2 when a name is taken. Files in the Media Library are reachable by URL, so think before saving personal data there.

Related features

FAQ

How do I parse JSON in a WordPress workflow?

Add a step, choose Parse JSON and map the JSON from an earlier step into JSON Data to Parse. Each key becomes a field, with nested keys joined by underscores. Test the step to see the fields before mapping them.

How do I get one nested value out of a JSON response?

Use Get JSON Value by Path. Enter a path such as data.items.0.name or data/items/0/name in JSON Path. The value comes back in the value field with its type.

Can FlowMattic build a JSON body for an API request?

Yes. Build JSON Object takes key and value rows, nests dotted keys and converts numbers, booleans and null when Value Types is set to convert. Map the json output into your API Request body.

Why does Validate JSON mark my run as failed?

Invalid JSON is returned with status error, which flags the run in Task History. Turn on Ignore Errors for that step and branch on is_valid with a Filter or Router instead.

The JSON Parser ships with FlowMattic and works alongside nearly 900 integrations and the rest of the data tools. See the plans and start shaping JSON inside your workflows.

More from the blog