Sub topic 11
Connecting services with integrations, APIs and webhooks
This chapter assumes you have a working data model and at least one workflow in your builder, as covered in the earlier chapters on data modeling and workflows. You should also be comfortable with the idea that a web app has pages, forms and a database. You do not need to write much code. You do need to read a little of it.
Why connections matter in an MVP
Your MVP should do one core job. Everything else, such as sending email, charging cards, or posting to Slack, is usually better borrowed from another service than built. Connecting services lets you do that. The risk is that every connection adds a place where things can fail, leak data, or cost money. This chapter covers the three ways to connect and the errors that show up most often.
Three ways to connect
| Method | Who starts it | Typical use | Where you configure it |
|---|---|---|---|
| Native integration | You, by clicking "connect" | Email, calendar, spreadsheets, Stripe | The builder's integrations page |
| API call | Your app, on demand | Look up data, create a record, send a message | A workflow step or a backend function |
| Webhook | The other service, when something happens | "Payment succeeded", "form submitted" | A URL in your app that the other service calls |
Native integrations
A native integration is a connector the platform built and maintains. You sign in to the other service, approve access, and pick fields from dropdowns. It is the fastest path and breaks the least often. The limit is that you only get the actions the platform chose to expose. If you need an action it does not offer, move to an API call.
APIs
An API (application programming interface) is a set of URLs that another service lets programs call. Your app sends an HTTP request and gets a response, usually in JSON. A request has four parts you will meet in every builder's "API connector" screen:
- Method:
GETreads data,POSTcreates it,PUTorPATCHchanges it,DELETEremoves it. - URL: the address of the resource, for example
https://api.example.com/v1/tasks. - Headers: metadata, most importantly the credentials, such as
Authorization: Bearer <key>. - Body: the data you send, for
POSTandPATCH.
The response carries a status code. 2xx means success, 4xx means your request was wrong (401 bad credentials, 404 not found, 429 too many requests), and 5xx means the other service failed.
Webhooks
A webhook is the reverse of an API call. Instead of your app asking "did anything happen?", the other service sends an HTTP POST to a URL you provide when an event occurs. Polling (asking repeatedly) wastes requests and is slow. Webhooks arrive within seconds.
The flow looks like this:
Keeping secrets out of the wrong place
An API key is a password for your account at another service. Treat it that way.
- Store keys in the builder's secrets or environment variables area, never in a page's visible text or a client-side action.
- Anything that runs in the user's browser can be read by the user. Calls that need a secret key must run on a server, in a backend function or a server-side workflow.
- Use the narrowest key available. Many services offer read-only or restricted keys.
- If a key appears in a prompt to an AI builder, in a screenshot, or in a public repository, rotate it. Assume it is compromised.
Receiving webhooks safely
Your webhook URL is public. Anyone who finds it can send fake events, such as a fake "payment succeeded". Most services sign each request with a shared secret so you can prove it came from them. Verify the signature against the raw request body, before you parse the JSON and before you change any data.
import { createHmac, timingSafeEqual } from "node:crypto";
// Verifies an HMAC-SHA256 signature (hex) sent by a service with a shared secret.
export function isValidSignature(rawBody, signatureHex, secret) {
const expected = createHmac("sha256", secret).update(rawBody).digest();
const received = Buffer.from(signatureHex, "hex");
return received.length === expected.length && timingSafeEqual(received, expected);
}Two details matter here. First, the signature is computed over the exact bytes sent. If your framework parses the JSON and re-serializes it, the bytes change and verification fails. Second, timingSafeEqual compares in constant time, which stops an attacker from guessing the signature byte by byte. Each service documents its own header name and format, so check that before copying the function. Some also include a timestamp in the signed data, which lets you reject old requests that someone replays.
If your no-code platform hides the raw body, look for a built-in "verify signature" option, or put a small serverless function in front of it.
Common errors and how to handle them
Duplicate events
Webhook senders retry when they do not get a fast 2xx reply, so the same event can arrive twice. Each event normally has a unique ID. Store processed IDs and skip repeats. Otherwise a retry can send two welcome emails or credit an account twice. This property is called idempotency: running the same operation twice has the same result as running it once.
Slow responses and timeouts
Reply with 200 quickly, within a few seconds, and do the slow work afterward. If a workflow takes ten seconds to send emails and update three tables, the sender may time out and retry, which causes duplicates.
Events out of order
Events can arrive in a different order than they happened. An "updated" event may arrive before "created". Use the timestamp or version in the payload, and do not assume order.
Rate limits
Services cap how many requests you can make. A 429 response means slow down. For loops that call an API once per row, add a delay or batch the calls. Retry with increasing waits (1 s, 2 s, 4 s) instead of retrying instantly.
Field mismatches
The most common builder bug is a mapping that points at the wrong field, or at a field that is sometimes empty. Test with a real sample payload, including one where optional fields are missing.
Failures nobody sees
A failed integration step in a no-code workflow often fails silently. Turn on run logs or error alerts. For anything involving money or user data, add a visible "failed" status in your table so you can find and retry the record.
Choosing between the three
- Start with a native integration if one covers the action you need.
- Use an API call if you need an action the native one lacks, or if you need data on demand.
- Use a webhook when you need to react to something that happens elsewhere and polling would be wasteful.
- If the connection sits in the middle of your core flow, count it as a risk. Ask what the user sees if that service is down.
Also check the pricing. Some automation platforms charge per task, and a busy webhook can use a monthly allowance quickly.
Exercise
Your app receives a "payment succeeded" webhook and marks an order as paid. Name two things you must do before updating the order, and one thing that protects you if the sender delivers the same event twice.
Show answer
Verify the signature against the raw request body using the shared secret, so fake events are rejected, and check that the event is recent or otherwise valid (for example, that the order exists and the amount matches). To handle duplicates, store the event ID and skip any event whose ID you have already processed, which makes the handler idempotent.
Exercise
An AI builder generated a "send welcome email" feature that calls an email API directly from a page button. Why is this a problem, and how would you fix it?
Show answer
The call runs in the browser, so the email service's secret key must be included in client code where any visitor can read it. Move the call into a server-side function or workflow that reads the key from secrets storage, have the button trigger that function, and rotate the exposed key.