<?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 webhook_refresh please help in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/webhook-refresh-please-help/m-p/10882#M4288</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I’m running into an issue with a webhook trigger in a Workato custom connector. The goal is that every time the webhook refreshes, it should:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Create a new destination&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Create a new subscription for that destination&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Delete the old destination (which should also remove the old subscription)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Currently, the refresh creates the new destination and subscription correctly, but the old destination is not being deleted, leaving dangling resources. Interestingly, when stopping the recipe, the webhook_unsubscribe deletes the old destination properly.&lt;/P&gt;&lt;P&gt;Here’s a simplified version of my code:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="ruby"&gt;# Subscribe lambda
webhook_subscribe: lambda do |webhook_url, connection, _input, _recipe_id|
  # Create initial destination
  destination = call("create_destination", { namespace: "MyConnector.Project", url: webhook_url })

  # Create subscription for that destination
  subscription = post("api/v1/webhook/subscriptions/project", {
    "destinationId" =&amp;gt; destination["id"],
    "triggers" =&amp;gt; ["Created", "Updated"]
  })

  [
    {
      subscription_id: subscription["id"],
      destination_id: destination["id"],
      webhook_url: webhook_url
    },
    1.minute.from_now
  ]
end,

# Refresh lambda
webhook_refresh: lambda do |webhook_subscribe_output|
  # 1. Create new destination
  new_destination = call("create_destination", {
    namespace: "MyConnector.Project",
    url: webhook_subscribe_output["webhook_url"]
  })

  # 2. Create new subscription
  new_subscription = post("api/v1/webhook/subscriptions/project", {
    "destinationId" =&amp;gt; new_destination["id"],
    "triggers" =&amp;gt; ["Created", "Updated"]
  })

  # 3. Prepare return value
  refreshed_output = [
    {
      subscription_id: new_subscription["id"],
      destination_id: new_destination["id"],
      webhook_url: webhook_subscribe_output["webhook_url"]
    },
    1.minute.from_now
  ]

  # 4. Attempt to delete old destination (should also delete old subscription) this is a method to call the delete endpoint in the api
  call("delete_destination", webhook_subscribe_output["destination_id"])

  # 5. Return new subscription info
  refreshed_output
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2025 19:09:46 GMT</pubDate>
    <dc:creator>TekkyRex</dc:creator>
    <dc:date>2025-09-11T19:09:46Z</dc:date>
    <item>
      <title>webhook_refresh please help</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/webhook-refresh-please-help/m-p/10882#M4288</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I’m running into an issue with a webhook trigger in a Workato custom connector. The goal is that every time the webhook refreshes, it should:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Create a new destination&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Create a new subscription for that destination&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Delete the old destination (which should also remove the old subscription)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Currently, the refresh creates the new destination and subscription correctly, but the old destination is not being deleted, leaving dangling resources. Interestingly, when stopping the recipe, the webhook_unsubscribe deletes the old destination properly.&lt;/P&gt;&lt;P&gt;Here’s a simplified version of my code:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="ruby"&gt;# Subscribe lambda
webhook_subscribe: lambda do |webhook_url, connection, _input, _recipe_id|
  # Create initial destination
  destination = call("create_destination", { namespace: "MyConnector.Project", url: webhook_url })

  # Create subscription for that destination
  subscription = post("api/v1/webhook/subscriptions/project", {
    "destinationId" =&amp;gt; destination["id"],
    "triggers" =&amp;gt; ["Created", "Updated"]
  })

  [
    {
      subscription_id: subscription["id"],
      destination_id: destination["id"],
      webhook_url: webhook_url
    },
    1.minute.from_now
  ]
end,

# Refresh lambda
webhook_refresh: lambda do |webhook_subscribe_output|
  # 1. Create new destination
  new_destination = call("create_destination", {
    namespace: "MyConnector.Project",
    url: webhook_subscribe_output["webhook_url"]
  })

  # 2. Create new subscription
  new_subscription = post("api/v1/webhook/subscriptions/project", {
    "destinationId" =&amp;gt; new_destination["id"],
    "triggers" =&amp;gt; ["Created", "Updated"]
  })

  # 3. Prepare return value
  refreshed_output = [
    {
      subscription_id: new_subscription["id"],
      destination_id: new_destination["id"],
      webhook_url: webhook_subscribe_output["webhook_url"]
    },
    1.minute.from_now
  ]

  # 4. Attempt to delete old destination (should also delete old subscription) this is a method to call the delete endpoint in the api
  call("delete_destination", webhook_subscribe_output["destination_id"])

  # 5. Return new subscription info
  refreshed_output
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 19:09:46 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/webhook-refresh-please-help/m-p/10882#M4288</guid>
      <dc:creator>TekkyRex</dc:creator>
      <dc:date>2025-09-11T19:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: webhook_refresh please help</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/webhook-refresh-please-help/m-p/10894#M4293</link>
      <description>&lt;P&gt;For anyone having the same issue, I've found a workaround to force workato to call the delete endpoint. This is a weird workaround and hoping they address this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;    delete_destination = delete("api/v1/webhook/destinations/#{id}")
      
    puts delete_destination  # This is needed to force Workato to call the delete request&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2025 08:22:13 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/webhook-refresh-please-help/m-p/10894#M4293</guid>
      <dc:creator>TekkyRex</dc:creator>
      <dc:date>2025-09-12T08:22:13Z</dc:date>
    </item>
  </channel>
</rss>

