Skip to main content

Integration pattern

Reviewed 14 October 2026

Wait for a webhook, or ask every minute? Count what each costs.webhook vs polling

A webhook costs one request per change. A poll costs the same every day, changed or not. Set volume and delay to see which wins.

No demo shows a webhook or a poll. The plotter below is the demo.

Use webhooks when

  • Changes are rarer than the polls that would catch them: under 1,440 a day if a minute is the longest wait you accept.
  • The source offers webhooks and can reach an address of yours.
  • A change matters within seconds, not hours.

Poll instead when

  • The source sends no webhooks, or cannot reach you: a desktop system, a private network.
  • Changes come faster than you would poll and a wait of minutes is fine: one poll then collects many.
  • A missed change would cost money. Keep a poll, alone or as the net beside webhooks.

Try it

Cost and delay plotter

Set the changes a day and the longest wait you accept. See the requests a day each way, the break-even and a verdict. Sample data. Not a measurement.

1,000 a day

10 · 100 · 1,000 · 10,000 · 100,000

The longest wait you accept

Does the source send webhooks?

Can the source reach your system?

A desktop program or a private network cannot be reached.Not used: the source sends no webhooks.

What a missed change costs

Sample: one poll request returns up to 100 changes. Frappe's REST list returns 20 unless you ask for more.

Requests a day against the time between polls

Counted, not measured. The same numbers are in the table under the tool.

1101001,00010,000100,00010 s1 min15 min1 hour1 dayTime between pollsRequests a dayWebhooksPollingYour longest waitBreak-even1101001,00010,000100,00010 s15 min1 dayTime between pollsRequests a dayWebhooksPollingYour longest waitBreak-even
Webhooks, plus a slow poll.

1,000 requests a day against 1,440 for polling every minute. Money or stock moves, and delivery is not guaranteed, so keep a slower poll as the net.

Webhooks
1,000 requests a day, one for each change
Polling every minute
1,440 requests a day, at least 440 of them with nothing new
Break-even
Polling every 1.4 minutes costs what 1,000 webhooks cost
Wait for a change
Webhook: set by the sender. Poll: up to 1 minute, 30 seconds on average

The same numbers as a table

Requests a day by polling at each wait, against webhooks, for the changes a day you chose
Time between pollsPolling, requests a dayWebhooks, requests a day
10 seconds 8,6401,000
1 minute your wait1,4401,000
15 minutes 961,000
1 hour 241,000
Next morning 101,000

Counted, not measured. 1,000 changes a day; one poll request returns up to 100 changes.

What you give up, and how it fails.

Four trades, then six ways it breaks. Pick one for why, and the source.

  • A webhook sends one request per change and none when nothing changed.What it costs: You run a public address, check each signature and handle repeats and retries.
  • The change arrives when the sender sends it, often within seconds.What it costs: You do not choose the delay or the order, and the sender stops retrying after a fixed time.
  • A poll lets you choose the interval, the batch and the order.What it costs: Every poll costs a request and a slice of the rate limit, whether or not anything changed.
  • A poll needs no public address and, with a saved checkpoint, does not skip a change it can see.What it costs: It cannot see a deletion unless the source lists deletions, and two changes inside one interval look like one.

How it fails

Documented

Shopify says delivery isn't always guaranteed and deletes an API-created subscription after eight failures in a row. Razorpay disables a webhook that fails for 24 hours. Stripe retries for up to three days; after that only its List events API, which reaches back 30 days, still holds the event.

Documented

Shopify says delivery isn't always guaranteed and deletes an API-created subscription after eight failures in a row. Razorpay disables a webhook that fails for 24 hours. Stripe retries for up to three days; after that only its List events API, which reaches back 30 days, still holds the event.

Each failure is Documented, with the maker's own page or code, or it Follows from the design. None is a result from a MithTech client project.

In ERPNext and Frappe, and Medusa.

Eight parts, each at a named version. Open one for what it does; build it in five steps.

Read from Frappe v15.123.0 and v16.52.0, ERPNext v15.122.0, Frappe's Ecommerce Integrations app (version-15, commit 3dc8eb81) and Medusa v2.21.2 on 14 October 2026, with the file and line. Other systems' names and settings were not checked here.

Sends a document's event to a URL after the save commits: after insert, on update, on submit, on cancel, on trash or on change. A condition can filter it. The pending send waits in the request's memory, then a background job.

Frappe v15 · webhook queueFrappe v15 · commit hooks

How to build it

  1. Write down two numbers: changes a day, and the longest wait you accept. Divide 86,400 by the changes: that many seconds between polls costs as much as the webhooks.

  2. If the source offers webhooks and can reach you, take them. Save the payload, answer fast, do the work after.

  3. Add a slow poll as the net: fetch what changed since the last run, and save the checkpoint only after the work is done.

  4. If the source sends nothing or cannot reach you, poll. Save a checkpoint, page through, and back off when told to wait.

  5. In Frappe, filter the REST list on modified, sort on it, raise the page size above 20 and read Deleted Document for deletions. For a webhook, add a condition so only the changes you need are sent.

Questions about webhooks vs polling

The one most people ask is answered first. Type to find the rest.

Is polling or a webhook better?

Neither always. A webhook costs one request per change; a poll costs one per interval, changed or not. Divide 86,400 seconds by your changes a day to get the break-even interval. Poll slower than that and polling costs less; poll faster and webhooks cost less. Then weigh reach and how late is too late.

Start with one conversation

One message, call or WhatsApp is enough. Every line reaches the team directly.

Team away now