# Trigger N8N webhooks with Coda buttons

**URL:** <https://connect.superhuman.com/t/trigger-n8n-webhooks-with-coda-buttons/48296>\
**Category:** Making Packs\
**Created:** [April 28, 2024, 2:45pm UTC](https://connect.superhuman.com/t/trigger-n8n-webhooks-with-coda-buttons/48296 "2024-04-28T14:45:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon1959570](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon1959570](https://connect.superhuman.com/u/anon1959570)\
**Post date:** [April 28, 2024, 2:45pm UTC](https://connect.superhuman.com/t/trigger-n8n-webhooks-with-coda-buttons/48296/1 "2024-04-28T14:45:58Z")

</div>

Hi all,

I am damn new to coding and pack making so bear with me 🙈

As I have seen various packs that are able to trigger a webhook ([Make.com](http://Make.com), Zapier, etc.). As I know that Coda can connect only to one allowed domain I setup a Digital Ocean droplet to host N8N on a subdomain I control.

I tried making a private pack that connects only to the domain with the pack code being the one below:

```typescript
// Coda Pack SDK setup and formula definition
import * as coda from "@codahq/packs-sdk";

export const pack = coda.newPack();
pack.addNetworkDomain("my-domain"); // Authorize only your n8n domain

pack.addFormula({
  name: "TriggerWebhook",
  description: "Triggers a configurable n8n webhook.",
  parameters: [
    coda.makeParameter({
      type: coda.ParameterType.String,
      name: "webhookUrl",
      description: "The full URL of the n8n webhook to trigger.",
    }),
    coda.makeParameter({
      type: coda.ParameterType.String,
      name: "payload",
      description: "JSON payload to send with the request, can be empty.",
      optional: true,
    }),
  ],
  execute: async function ([webhookUrl, payload], context) {
    let response = await context.fetcher.fetch({
      method: "POST",
      url: webhookUrl, // Using the full URL directly
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(payload ? JSON.parse(payload) : {}),
    });
    return response.body; // Return the response body for display or processing in Coda
  },
  resultType: coda.ValueType.String, // Or adjust based on what type of response you expect
}); 

```

As I only want to trigger a wokflow using a webhook in n8n the payload will be empty.

I am getting things such as:

```plaintext
Formula TriggerWebhook returned a prior result from the cache
Just now
Overview: Formula TriggerWebhook returned a prior result from the cache
User ID
2632793
Pack Version
6
Pack ID
30657
Request ID
b0bb54f5-f0de-40fb-9a31-137f1f5612fe
Created at
Apr 28, 2024 @ 16:26:13
Request type
invokeFormulaRequest
Invocation source
Coda UI
Cache hit
true
Duration
24ms

```

Although I can’t see the output in n8n. I think I am missing many things here that eventually I will get right but I am just trying to learn it.

---

<div class="post-metadata">

**Author:** ![Eric\_Koleda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/eric_koleda/32/50286_2.png) [@Eric\_Koleda](https://connect.superhuman.com/u/Eric_Koleda)\
**Post date:** [April 29, 2024, 1:55pm UTC](https://connect.superhuman.com/t/trigger-n8n-webhooks-with-coda-buttons/48296/2 "2024-04-29T13:55:15Z")

</div>

Hi @anon1959570 - Welcome to Pack building! Regular formulas have their results cached for performance reasons. But in this case, where the formula has a “side effect”, you’ll want to make it into an action formula instead:

> **[Add custom actions for buttons and automations - Coda Pack SDK](https://coda.io/packs/build/latest/guides/blocks/actions/)**
>
> Use actions to create, update, or delete records in APIs and external data sources.

Doing so will remove the caching, and should prevent other issues.

---

<div class="post-metadata">

**Author:** ![Piyush\_Pallav](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piyush_pallav/32/46752_2.png) [@Piyush\_Pallav](https://connect.superhuman.com/u/Piyush_Pallav)\
**Post date:** [June 14, 2025, 12:33am UTC](https://connect.superhuman.com/t/trigger-n8n-webhooks-with-coda-buttons/48296/3 "2025-06-14T00:33:51Z")

</div>

Hi..where you able to solve this?

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [June 17, 2025, 12:33am UTC](https://connect.superhuman.com/t/trigger-n8n-webhooks-with-coda-buttons/48296/4 "2025-06-17T00:33:54Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
