Flow - Send Admin API returns error "invalid JSON"

Topic summary

Shopify Flow’s Send Admin API action fails when running a productUpdate GraphQL mutation with the error: “Mutation input evaluated to invalid JSON. Please ensure the input forms valid JSON after Liquid code is run.” Flow is an automation tool; the action sends requests to the Admin GraphQL API.

Initial suggestion was malformed JSON (e.g., missing quotes around a string). The author tested with plain text and still saw the same error.

Key guidance emerged:

  • productUpdate requires the product id; Flow does not implicitly pass the triggering product’s id. You must include a valid product ID.
  • The mutation structure was invalid; media was incorrectly nested inside input, which doesn’t match the schema. Reference the official productUpdate docs for the correct input shape and required fields.

Screenshots of the Flow setup, API request, and error logs were provided and central to diagnosing.

Status: No confirmed fix yet. Next steps are to ensure valid JSON after any Liquid rendering, include the required product id, and restructure the mutation to match the documented schema (avoid nesting unsupported fields like media inside input). Discussion remains open.

Summarized with AI on December 14. AI used: gpt-5.

I am trying to use Flow to update various product fields based on certain conditions using the Send Admin API action. To test this I am using an old, inactive product and using a very simple product update mutation but keep getting the following error when it runs: “Ran into exception: Mutation input evaluated to invalid JSON. Please ensure the input forms valid JSON after Liquid code is run.”

I don’t understand why this error is occurring. Please help, I’m at a complete loss. I don’t understand .

This is the Flow:

This is the API request detail:

And this is the error/returned data:

Thanks in advance.

i had to google search what flow was. but I think your issue is that your json is formatted incorrectly.

i think
(ON SALE) - Marloboro - plz guaway - 5.5% (440ml),
should need quotes around it. like
“(ON SALE) - Marloboro - plz guaway - 5.5% (440ml)”,
json objects have specific formatting I think that might be your main issue with this error not exactly sure how you can make that happen in an automated way using flow. but I hope that helps

Thanks for replying so quickly. I don’t think this is the issue. I have run the api call using text and got the same error.

Adjusted mutation input:

Error & report:

Something else must be the error.

sorry that previous response didnt help. this looks like it might be more along the lines of what you’re doing?

https://community.shopify.com/post/2830038

this sort of makes sense because it needs to know which product id you are mutating. it doesn’t know you want to mutate the product that triggered the flow. (if I am understanding your original photo correctly)

This is not the right format for that mutation. Just look at the examples in the docs. https://shopify.dev/docs/api/admin-graphql/2024-10/mutations/productupdate

For example, you have nested the media inside the input, which is not correct.

Also, you are missing some required fields like the product id