cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Static Webhooks

mbunch
Deputy Chef I
Deputy Chef I

I am trying to create a custom static webhook trigger using the sdk. I added the connector and trigger to a recipe. I invoke the trigger using the static trigger url and the recipe does not run. I am using constant values for webhook_keys and webhook_key. And, a timestamp in dedupe. Any suggestions or working end-to-end examples? Thanks.

2 REPLIES 2

chandra
Workato employee
Workato employee

Hi Michael,

The issue could be the difference between the payload you are sending vs payload processing in webhook_notification.

Please note the payload structure should match the object definition defined in the output_fields block.


The below working example should give you an idea.


```

{

title: 'Static Webhook',


test: lambda do

true

end,


webhook_keys: lambda do |params, headers, payload|

'candidate'

end,


triggers: {

new_event: {

title: 'New Candidate Event',


subtitle: "Triggers when a Candidate event is received " \

"from ABC",


description: lambda do |input, picklist_label|

"New <span class='provider'>candidate event</span> " \

"in <span class='provider'>ABC</span>"

end,


input_fields: lambda do |object_definitions|

[


]

end,


webhook_key: lambda do |connection, input|

'candidate'

end,


webhook_notification: lambda do |input, payload, extended_input_schema, extended_output_schema, headers, params|

payload

end,


dedup: lambda do |record|

Time.now.to_i

end,


output_fields: lambda do |object_definitions|

[

{

name: 'id'

},

{

name: 'first_name'

},

{

name: 'last_name'

}

]

end

}

}

}

```


Sample payload:

{"id": 1,"first_name": "Chandra","last_name": "V"}


Hope this helps

mbunch
Deputy Chef I
Deputy Chef I
Thanks.  That helped a lot.

--