Skip to main content

An API returns JSON in a different shape from what the next app needs. How do you handle it?

Automation workflows · Beginner 3

Short answer

Look at a real sample of both shapes first. Then map each target field from the source: rename fields, pull values out of nested objects, split or join text, convert dates and numbers, and loop over arrays. Test with edge cases such as missing fields.

Deeper answer

Typical traps: dates in different formats or time zones (store in ISO format, and use Asia/Kolkata for display in India), numbers sent as strings, optional fields that are sometimes absent, and arrays where you expected one object.

In n8n, use the Edit Fields node, or a small Code node for anything complex. Keep transformations in one clearly named step so the next person can see what changes, and add a check that stops the workflow with a clear error if a required field is missing.

What a strong answer covers

Answer it out loud in the mock interview about 1.5 min

Follow-ups to expect

Common mistakes

Learn it

Reading and shaping JSON

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.