<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Handling Webhooks with Multiple Payload Schemas (Reprise) in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12011#M4619</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I was excited to find an EXACT match for my issue (as per the Subject Line) &lt;A href="https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas/m-p/9972#M4043" target="_self"&gt;right here&lt;/A&gt;...&amp;nbsp;it's just that the response didn't give me enough to get started&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a SaaS system to which I can subscribe to webhooks.&amp;nbsp; But there will be a variety of different JSON payloads being sent to my single Recipe, depending on the Event being sent.&lt;/P&gt;&lt;P&gt;Therefore I need to branch my workflow depending on the type of Event/JSON&amp;nbsp; being received.&lt;/P&gt;&lt;P&gt;When I follow the guided setup for a new Recipe of type "Trigger from a Webhook" it asks for a sample event and then configures the schema of the Trigger accordingly.&amp;nbsp; But obviously that won't capture the variety of Events being received.&lt;/P&gt;&lt;P&gt;Could someone give me the "dummies guide" to how to achieve what I'm after in Workato?&lt;/P&gt;&lt;P&gt;If JSON Event = "Create" then... {expect this JSON payload and map these values to datapills} and then go do stuff&lt;/P&gt;&lt;P&gt;If JSON Event = "Update" then...&amp;nbsp;{expect this JSON payload and map these values to datapills} and then go do stuff&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;The bit that's not clicking with me is simply how to replace the single guided JSON mapping for the Trigger with alernative nuanced logic (as above).&amp;nbsp; There&amp;nbsp; can be only one Trigger for a Recipe, so how to handle different incoming JSON payloads? I'm sure the "Parse JSON Document" action is involved but I ain't seeing how it comes together!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It feels like this must be an FAQ, so I think a simple "How To" that others could use would be generically helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Russell&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2026 12:17:15 GMT</pubDate>
    <dc:creator>RussellJ</dc:creator>
    <dc:date>2026-03-10T12:17:15Z</dc:date>
    <item>
      <title>Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12011#M4619</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I was excited to find an EXACT match for my issue (as per the Subject Line) &lt;A href="https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas/m-p/9972#M4043" target="_self"&gt;right here&lt;/A&gt;...&amp;nbsp;it's just that the response didn't give me enough to get started&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a SaaS system to which I can subscribe to webhooks.&amp;nbsp; But there will be a variety of different JSON payloads being sent to my single Recipe, depending on the Event being sent.&lt;/P&gt;&lt;P&gt;Therefore I need to branch my workflow depending on the type of Event/JSON&amp;nbsp; being received.&lt;/P&gt;&lt;P&gt;When I follow the guided setup for a new Recipe of type "Trigger from a Webhook" it asks for a sample event and then configures the schema of the Trigger accordingly.&amp;nbsp; But obviously that won't capture the variety of Events being received.&lt;/P&gt;&lt;P&gt;Could someone give me the "dummies guide" to how to achieve what I'm after in Workato?&lt;/P&gt;&lt;P&gt;If JSON Event = "Create" then... {expect this JSON payload and map these values to datapills} and then go do stuff&lt;/P&gt;&lt;P&gt;If JSON Event = "Update" then...&amp;nbsp;{expect this JSON payload and map these values to datapills} and then go do stuff&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;The bit that's not clicking with me is simply how to replace the single guided JSON mapping for the Trigger with alernative nuanced logic (as above).&amp;nbsp; There&amp;nbsp; can be only one Trigger for a Recipe, so how to handle different incoming JSON payloads? I'm sure the "Parse JSON Document" action is involved but I ain't seeing how it comes together!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It feels like this must be an FAQ, so I think a simple "How To" that others could use would be generically helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Russell&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 12:17:15 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12011#M4619</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-03-10T12:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12012#M4620</link>
      <description>&lt;P&gt;When using this kind of model, I would recommend structuring your JSON so it's easy to pivot between events.&lt;/P&gt;&lt;P&gt;For example, I always use this format for a basic message queue:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "action:" "porkchop sandwiches",
  "message": "anything at all"
}&lt;/LI-CODE&gt;&lt;P&gt;Because action is always present you can reliably use its value to control the recipe flow. It's pretty much the same as event type.&lt;/P&gt;&lt;P&gt;Once you know your action/event type, you can throw in a JSON parser for a schema that is specific to the event/action.&lt;/P&gt;&lt;P&gt;I'm assuming this ship has sailed and you're not able to change the incoming format, but the bottom line is that each payload must have some sort of indicator of it's event/action/purpose. Use that value to create different conditionals, and use a schema-specific parser within the conditional.&lt;/P&gt;&lt;P&gt;Hopefully this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 16:27:07 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12012#M4620</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-03-10T16:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12013#M4621</link>
      <description>&lt;P&gt;And sorry, I may have overlooked the core issue: the webhook requires you to define the schema.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would just ignore the schema entirely and pass the "Payload" object on the webhook trigger into a JSON parser.&lt;/P&gt;&lt;P&gt;If you do have a single consistent key across all incoming payloads (like "action" or "event_type"), this should be a cake walk.&lt;/P&gt;&lt;P&gt;If you don't have a single key then this becomes more difficult but it's still completely possible. You'll have to put it through multiple JSON parsers, each configured to look for a specific key to identify the event type (one looks for "action", one looks for "event_type", one looks for "yadayadayada", etc.). Once you get a hit, you'll be able to control the flow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 16:35:51 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12013#M4621</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-03-10T16:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12015#M4622</link>
      <description>&lt;P&gt;Hey Gary&lt;/P&gt;&lt;P&gt;Thanks so much for you reply!&lt;/P&gt;&lt;P&gt;Yup, I do have a common "action" value across all events/JSON payloads, so that's easy enough for the IF.&lt;/P&gt;&lt;P&gt;And you have indeed come to the core issue - the webhook requires you to define the schema.&lt;/P&gt;&lt;P&gt;The walk is verily CONSTRUCTED OF PURE CAKE... it's just... I &lt;STRONG&gt;still&lt;/STRONG&gt; can't see how to stuff the incoming Payload into a JSON parser.&amp;nbsp; The "Document" field in the JSON parser Action wants to take indiividual fields (e.g. Id and Event) from the output of my Trigger (see screengrab below)...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="json parser.jpg" style="width: 999px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2624i12A594848CA69437/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="json parser.jpg" alt="json parser.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How do I pass in ALL OF THE JSON PAYLOAD into the Document field of the JSON Parser?&lt;/P&gt;&lt;P&gt;The issue may be caused by my having based this Trigger on the JSON generated by the Guided thingy, I guess?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 17:10:23 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12015#M4622</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-03-10T17:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12016#M4623</link>
      <description>&lt;P&gt;You can't have a dynamic sample document, but this is still doable.&lt;/P&gt;&lt;P&gt;Let's say I have a bunch of different events:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// event type 1
{
  "event": "build spaceship",
  "ship_name": "nostromo"
}
// event type 2
{
  "event": "emergency landing",
  "where": "lv-426"
}

// event type 3
{
  "event": "destroy xenomorph",
  "how": "airlock"
}&lt;/LI-CODE&gt;&lt;P&gt;One option is to make a JSON parser and use a merge all of the different schemas as the sample document. The benefit of this approach is using a single JSON parser but I personally find this difficult and annoying to maintain -- especially when you have more complex events than my example.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "event": "build spaceship",
  "ship_name": "nostromo"
  "where": "lv-426"
  "how": "airlock"
}&lt;/LI-CODE&gt;&lt;P&gt;Another option is to route to a JSON parser configured to parse the schema of the event. I find this easier to maintain since you don't need to merge multiple schemas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If event == "build spaceship" then route to a parser that is set up with an example payload. Repeat this for each event type.&lt;/P&gt;&lt;P&gt;Lastly, once you identify the event type you should route to a function recipe to handle the processing of that event. Try to avoid making a monolithic recipe that handles everything. Break it up, make it modular.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 20:33:35 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12016#M4623</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-03-10T20:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12021#M4625</link>
      <description>&lt;P&gt;Hi Gary&lt;/P&gt;&lt;P&gt;I understand every single word in your replies (and really appreciate your time and assistance!)... it's just that I still can't see how to proceed &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've got a Recipe that receives the webhook call.&amp;nbsp; The idea is that this will just then effectively act as a switch to invoke the relevant Recipe Function, which will be passed the payload and can then process that using a JSON Parser.&lt;/P&gt;&lt;P&gt;I'm 100% with you... in theory.&lt;/P&gt;&lt;P&gt;But I need to define a JSON schema for the trigger in the initial recipe.&amp;nbsp; But the precise format of the JSON payload will vary depending on the event type.&amp;nbsp; So it needs to be generic to handle any event format.&lt;/P&gt;&lt;P&gt;So my questions are:&lt;/P&gt;&lt;P&gt;1) How do I define a &lt;STRONG&gt;generic&lt;/STRONG&gt; JSON payload in the Recipe trigger?&lt;/P&gt;&lt;P&gt;2) How do I pass the &lt;STRONG&gt;generic&lt;/STRONG&gt; JSON payload to a Recipe Function?&lt;/P&gt;&lt;P&gt;I can define a &lt;STRONG&gt;specific&lt;/STRONG&gt; JSON payload in the trigger fine (and the guided setup makes this a snap).&amp;nbsp; And I could then pass this speficic payload to a Recipe Function (by defining each discrete item to be passed).&lt;/P&gt;&lt;P&gt;The bit that I'm missing is how to simply treat any incoming JSON as "payload" and then pass (said generic payload) onto a Recipe Function.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 14:01:47 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12021#M4625</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-03-12T14:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12025#M4626</link>
      <description>&lt;P&gt;My friend, you may be overthinking this...&lt;/P&gt;&lt;P&gt;From my first response:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I would just ignore the schema entirely and pass the "Payload" object on the webhook trigger into a JSON parser.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The webhook's Payload data pill will be a hash of&amp;nbsp;&lt;EM&gt;anything&lt;/EM&gt; you send to the webhook. It doesn't need to match the input schema.&lt;/P&gt;&lt;P&gt;Here's my webhook trigger, completely undefined other than POST JSON:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="webhook1.jpg" style="width: 999px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2628i768592696CC286D9/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="webhook1.jpg" alt="webhook1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's my cURL to call it from Terminal:&lt;/P&gt;&lt;P&gt;curl -X POST "&lt;A href="https://webhooks.workato.com/webhooks/rest/top_secret/test" target="_blank"&gt;https://webhooks.workato.com/webhooks/rest/top_secret/test&lt;/A&gt;" \&lt;BR /&gt;-H "Content-Type: application/json" \&lt;BR /&gt;-d '{"event_type": "do stuff", "anything": "yadayadayada"}'&lt;/P&gt;&lt;P&gt;Here's my JSON parser to capture the event type:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="webhook2.jpg" style="width: 730px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2629i2D5DC4A17323373B/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="webhook2.jpg" alt="webhook2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And that's a wrap!&lt;/P&gt;&lt;P&gt;From here you'll have your event type parsed, and then you can route to other JSON parsers. When calling other functions, do the exact same thing as the JSON parser: pass the Payload as .to_json and parse it in the next recipe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 16:47:25 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12025#M4626</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-03-12T16:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12026#M4627</link>
      <description>&lt;P&gt;OK, so the bit I was missing was how to get a handle on the basic Payload in the trigger.&lt;/P&gt;&lt;P&gt;The key piece of missing knowledge was&amp;nbsp;simply to switch the Document field of the JSON Parser into Formula Mode and then use .to_json on the Payload value from the Trigger.&lt;/P&gt;&lt;P&gt;That right there will be the GOLD that future generations will thank me for, for so shamelessly parading my ignorance &lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;.&amp;nbsp; But most importantly, they will thank you Gary for taking the time to patiently guide me through this!!&lt;/P&gt;&lt;P&gt;To my credit I'd figured out the need to switch to Formula mode but was getting stuck with a conversion error, so I was nearly there&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Many thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 17:26:44 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12026#M4627</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-03-12T17:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Webhooks with Multiple Payload Schemas (Reprise)</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12027#M4628</link>
      <description>&lt;P&gt;No problem, glad we got to the answer!&lt;/P&gt;&lt;P&gt;Workato encodes recipe data as Ruby hashes (ex: {"key" =&amp;gt; "value")), so using .to_json is needed to convert it in order for the JSON parser to work. If you have a "string JSON" (not stored as hash) this will work in the parser without any conversion.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 17:37:21 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-webhooks-with-multiple-payload-schemas-reprise/m-p/12027#M4628</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-03-12T17:37:21Z</dc:date>
    </item>
  </channel>
</rss>

