Expand my Community achievements bar.

Webhook Connector and Anticipating payload.

Avatar

Level 2

I am creating a scenario that has a webhook trigger. I want to set up a couple different webhooks on this scenario ("Document" Creation and "Image" Creation since the third party app distinguishes them as different events but I effectively see them as one). The problem is the template of the responses are different and Fusion structures the metadata based on what it has received. Therefore, I have to use one or the other and not both. My question is this; is there a way to anticipate the structure of an API payload and route it another connector. My thought is like a dot notation as follows;

If(WEBHOOK.RESPONSE.TYPE == Image; WEBHOOK.RESPONSE.IMAGE; WEBHOOK.RESPONSE.DOCUMENT)

This might not be the clearest way to explain this but essentially I want to be able to anticipate a JSON structure response without having to use the 'hard coded' template metadata that Fusion provides after it has received an example payload.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Level 4

Hi Caden,

The short answer to your question is "Yes - you can work with dynamic data structures that are coming into a single webhook event".

One note of caution: please be careful not to try to make a single scenario "do too much" -- it really should be driven by a "reasonable single use case" (not 50 use cases all slammed into one). If the other vendor sees them as two events, it might be legitimately two scenarios.

To deal with dynamic incoming data, you'd simply have future steps conditioned based upon the value you expect (or not). Even if the data want doesn't appear in the mapping panel, you can still refer to it by creating a formula e.g. {{1.response.type}} (including full object dot notation) You can check if a field exists or has a value and then go down 1 direction or another. EAch future route would only refer to data it cares about (or knows should exist) .