Skip to main content
We recommend building automation examples directly in AI chat. Just describe the workflow you want, and AI will handle the full setup for you, including the trigger, actions, script, and configuration.

Build with AI

Open the AI Chat in your table’s right sidebar and tell AI what you want. For example, you can say: “Create an automation that watches for order status changes and sends a webhook notification when an order ships” AI will create the complete workflow automatically. You can review the generated script, test it with real data, and enable the workflow when ready.

Prerequisites

  • A Personal Access Token (PAT). See Access Token.
  • Your base ID, table ID, and field IDs. See Get IDs.

Helper Functions

const baseUrl = "https://app.teable.io/api";
const token = process.env.TEABLE_TOKEN;
const baseId = "bserxxxxxx";

const headers = {
  Authorization: `Bearer ${token}`,
  "Content-Type": "application/json",
};

async function api(method, path, body) {
  const res = await fetch(`${baseUrl}${path}`, {
    method,
    headers,
    body: body ? JSON.stringify(body) : undefined,
  });
  if (!res.ok) throw new Error(`${method} ${path}${res.status}`);
  return res.json();
}

Create the Workflow

// 1. Create a workflow
const wf = await api("POST", `/base/${baseId}/workflow`, {
  name: "Notify on shipment",
  description: "Send webhook when order status becomes Shipped",
});

// 2. Add a trigger
const trigger = await api("POST", `/base/${baseId}/workflow/${wf.id}/trigger`, {
  type: "recordUpdated",
  config: { tableId: "tblOrders", watchFieldIds: ["fldStatus"] },
});

// 3. Test the trigger
await api("POST", `/base/${baseId}/workflow/${wf.id}/test/${trigger.id}`);

// 4. Add an HTTP Request action
const action = await api("POST", `/base/${baseId}/workflow/${wf.id}/action`, {
  type: "httpRequest",
  parentNodeId: trigger.id,
});

// 5. Enable
await api("PUT", `/base/${baseId}/workflow/${wf.id}/active`, {
  method: "activate",
});

Best Practices

  • Use the least-privileged PAT — restrict it to the spaces/bases it needs.
  • Store tokens in environment variables, never hardcode them.
  • Use Test Node to verify before enabling.
  • See the full Automation API Reference.
Last modified on April 9, 2026