Trigger N8N webhooks with Coda buttons

Hi all,

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

As I have seen various packs that are able to trigger a webhook (, 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:

// 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

  name: "TriggerWebhook",
  description: "Triggers a configurable n8n webhook.",
  parameters: [
      type: coda.ParameterType.String,
      name: "webhookUrl",
      description: "The full URL of the n8n webhook to trigger.",
      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:

Formula TriggerWebhook returned a prior result from the cache
Just now
Overview: Formula TriggerWebhook returned a prior result from the cache
User ID
Pack Version
Pack ID
Request ID
Created at
Apr 28, 2024 @ 16:26:13
Request type
Invocation source
Coda UI
Cache hit

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.

Hi @Cristian_Nichifor - 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:

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

1 Like