Spreadsheets · Automation "Run a script"
Airtable + Sendjade
Send a message when a record is created or a status field changes.
Works with the live APIWhat you can automate
- Send an order confirmation when a record is created
- Remind a customer when "Status" becomes Overdue
- Store the Sendjade message id on the record
Before you start
- A Sendjade account with a connected instance (status Authorized). See Getting started.
- Your **idInstance** (shown on the instance page in the console) and **apiTokenInstance** (shown once when you created the instance; press Generate new token if you lost it). Use a spare number while testing.
- An Airtable base on a plan that supports scripting actions in automations.
Set it up
Create the automation
Trigger: When record matches conditions (or created). Action: Run a script.
Add input variables
In the action's left panel add inputs
phone,textandrecordIdmapped to your fields.Paste the script
Airtable has no secret store for automations, so anyone who can edit the base can read the token. Use a restricted base, and rotate the token (Generate new token) if you ever share the base.
const { phone, text, recordId } = input.config(); const url = 'https://api.sendjade.com/waInstanceYOUR_ID_INSTANCE/sendMessage/YOUR_API_TOKEN_INSTANCE'; const res = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Idempotency-Key': recordId }, body: JSON.stringify({ chatId: String(phone).replace(/\D/g, ''), message: text }), }); output.set('status', res.status); output.set('body', await res.text()); // { "idMessage": "3EB0..." }Write the result back
Add an Update record action that stores
statusand theidMessagein a "WhatsApp" field.
Test it
Use **Test action** with a record that has your own number.
Troubleshooting
fetch is not defined
Use a "Run a script" action in an automation (it supports fetch). The scripting extension uses remoteFetchAsync instead.
I get 401 unauthorized
The idInstance or token in the URL is wrong. Copy both again from the console. Generating a new token makes the old one stop working immediately.
I get 409 instance_not_connected
The instance is not Authorized yet. Open it in the console, press Connect and scan the QR code.
I get 400 invalid_chat_id
Use international format with digits only, e.g. 2348012345678 (or 2348012345678@c.us). Remove spaces, dashes and the leading zero of the local number.
I get 422 recipient_opted_out
That person replied STOP (or was added to the opt-out list). Sendjade refuses to message them. Remove the number from Opt-outs only if they asked to hear from you again.
I get 429 daily_limit_reached or rate_limited
The number reached its 24-hour sending cap (default 500) or you are calling too fast. The cap protects your number from restriction. Slow down, and raise the cap only if your volume is genuine.
Ask AI to help me integrate Airtable
Copy this prompt into ChatGPT, Claude or any assistant. It already knows Sendjade’s API, so the answer matches our endpoints.
The prompt is plain text that you copy yourself. Never paste real keys into an assistant; use placeholders.