Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a webhook when a system can notify your HTTPS endpoint about an event and your workflow needs to react promptly. Choose polling when checks are occasional, the resource set is small, or no useful event is available. Webhooks reduce repeated API requests, but they require secure endpoint handling, fast acknowledgments, duplicate protection, and a recovery plan.

Webhook or polling: how to choose

A webhook is a push notification from one system to another when a specified event happens. GitHub describes webhooks as subscriptions that deliver event data to an external server; AWS calls them a form of reverse API or push API. Both contrast with polling, where your system repeatedly asks an API whether anything changed. For event-driven workflows, webhooks can provide near-real-time updates and avoid repeated requests. GitHub explains the trade-off, as does AWS.

Choose webhooks when Choose polling when
The provider exposes the event you need and can call an HTTPS endpoint. The check is one-off or infrequent.
Waiting for the next polling interval would delay useful work. You are monitoring a small number of resources and request volume is manageable.
You monitor many objects and want to avoid repetitive API calls and rate-limit pressure. The API has no suitable webhook event.
You can operate an endpoint that verifies requests, acknowledges quickly, queues work, and tracks delivery. You prefer a simple recovery path and can tolerate the delay between checks.

For a hybrid, use webhooks for fast notification and a periodic poll to reconcile important records. That gives the workflow a way to discover state that a failed or missed delivery did not convey.

What to assess before adopting webhooks

Do not compare webhook and polling architectures on latency alone. Check whether the provider emits all relevant events, how it retries failures, how requests are authenticated, and how it represents event versions. Also account for payload and rate limits, replay support, delivery logs, operating ownership, and cost. A webhook only simplifies a workflow if the team can operate the receiving endpoint and recover from delivery problems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Event coverage: Does the provider emit the exact state transition you need, including relevant actions and object types?
  • Delivery behavior: Are retries documented? Can missed events be redelivered? Is delivery at-least-once, or does the provider explicitly guarantee a different model?
  • Security: Does the provider sign requests, and can you verify the signature over the original request body?
  • Operations: Can you see failed deliveries, safely replay them, and alert on persistent errors?
  • Schema stability: Can you pin or otherwise manage the event version your consumer expects?

Build a receiver that acknowledges safely

A useful default is to authenticate and validate the request, durably record a small event envelope and its identifier, enqueue business work, and return a 2XX response. A worker then performs the potentially slow or failure-prone action. This separates the provider-facing deadline from work such as database updates, notifications, or calls to other APIs.

  1. Subscribe narrowly. Enable only the event types and actions your workflow needs. Smaller subscriptions reduce irrelevant traffic and simplify validation.
  2. Require HTTPS and validate the signature. Use the provider’s signature scheme and a high-entropy secret. For GitHub, follow its guidance on SSL verification and, where appropriate, allow-listing provider IP addresses. Do not treat an unverified JSON body as trusted input.
  3. Check event type and action. Validate the headers and payload fields your specific provider documents before deciding what work to perform.
  4. Persist an idempotency key before side effects. Record the provider’s event or delivery identifier in durable storage under a uniqueness constraint. If that identifier already exists, acknowledge the duplicate without repeating the action.
  5. Enqueue and acknowledge promptly. Persist the event and queue reference before returning success. GitHub.com says its webhook deliveries should receive a 2XX response within 10 seconds. Its guidance recommends asynchronous processing when work may take longer. See GitHub’s operational recommendations.
  6. Process with bounded retries. Have workers retry transient failures, record permanent failures for inspection, and make redelivery an explicit, observable operation.

The exact header names, signature construction, response expectations, and retry policy depend on the provider. Implement against that provider’s documentation rather than assuming all webhook systems behave alike.

Reliability: duplicates, missed deliveries, and payloads

Assume duplicates are possible

Unless a provider explicitly guarantees otherwise, design as though delivery is at-least-once: an event may be retried, or a manual replay may resend it. HMAC verification proves that a request was signed with the shared secret; it does not make the business action idempotent. The Standard Webhooks specification describes HMAC signatures with a pre-shared secret as the common way to verify webhook authenticity.

Use the provider’s stable event or delivery identifier as an idempotency key. Store it before applying a side effect, and make the record and work scheduling atomic where your storage system permits. If a crash occurs after the side effect but before recording completion, design the worker so a retry can safely determine whether that action already happened. Do not rely on a short-lived in-memory cache as the only duplicate defense.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make recovery deliberate

Retries do not remove the need for monitoring. Track received, rejected, queued, completed, and permanently failed events; alert on backlog growth and repeated failures. Learn how the provider exposes failed deliveries and redelivery. GitHub recommends redelivering missed deliveries and using the X-GitHub-Delivery header to detect replayed deliveries. A periodic reconciliation poll is a sensible additional safeguard for high-value state, because retries and manual redelivery can still leave gaps.

Respect payload and schema limits

Limits are provider-specific. GitHub documents a 25 MB cap for webhook event payloads; this is not a general limit for all providers. Confirm both the payload ceiling and event schema/version behavior for the service you use. Stripe’s support guidance notes that failed deliveries are retried several times and that an API-version mismatch can cause unexpected errors. Pin and test the event schema version your consumer expects, and monitor the provider’s delivery records. Stripe’s webhook documentation covers its delivery and version considerations.

Choose a processing pattern

Fast acknowledgment plus queue

This is the safest default for workflows with variable processing time. The endpoint verifies, records, queues, and responds; a worker handles business logic. GitHub’s guidance names Hookdeck, Resque, RQ, and RabbitMQ as examples of tools for asynchronous processing. A managed queue or delivery-management service can reduce how much infrastructure you operate, while a self-hosted queue gives you more direct control.

Direct synchronous action

Process inline only if the action is short, bounded, and has straightforward failure handling. Verify the signature and event type before any side effect, set strict timeouts on downstream calls, and ensure the total handling time fits the provider’s deadline. If an external dependency stalls, the provider may retry and cause duplicate work unless idempotency is in place.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Webhook plus reconciliation poll

For billing, account access, or other consequential state, use webhooks for speed and periodically compare the provider’s current state with your records. This is an engineering safeguard against a delivery that was missed or could not be recovered. Keep reconciliation bounded and rate-limit-aware so it repairs gaps without recreating excessive polling traffic.

No-code bridge

App-to-app automation platforms can receive webhook triggers and send outgoing webhooks; some also bridge polling sources to webhook-style workflows. Zapier documents these webhook patterns, rate limits, and troubleshooting at Webhooks by Zapier. Check whether the bridge’s polling interval, task limits, and retry behavior meet the workflow’s freshness and reliability requirements.

Secure the endpoint

  • Keep the shared secret private. Generate a high-entropy secret, store it in a secrets manager or protected configuration, and rotate it using the provider’s supported process.
  • Verify signatures correctly. Follow the provider’s signing algorithm and verify against the unmodified raw body if required. Compare signatures safely and reject invalid requests before parsing them as trusted events.
  • Use HTTPS. Configure valid TLS and do not disable certificate verification. GitHub also recommends allow-listing its IP ranges where appropriate, but IP filtering should complement rather than replace signature verification.
  • Validate input and constrain effects. Check event type, action, and required fields. Treat payload fields as untrusted data, enforce request-size limits, and avoid allowing event content to select arbitrary URLs, commands, or privileged operations.
  • Limit exposure. Expose only the required route, rate-limit abusive traffic where practical, and avoid logging secrets or sensitive payload data.

These are operational controls, not a substitute for the provider’s current signature and delivery instructions. For GitHub-specific setup and security advice, use its webhook best-practices page.

Troubleshoot common failures

Symptom Likely cause What to check or do
No event reaches the workflow The event or action is not subscribed, the URL is wrong, or the endpoint is not reachable over HTTPS. Inspect the provider’s webhook configuration and delivery log; verify the exact subscribed event, target URL, TLS certificate, and firewall or routing rules.
Provider reports timeout or non-2XX response The endpoint performs slow work inline, or returns an error before persisting the event. Move work to a durable queue, acknowledge only after recording the event, and keep the request handler within the provider’s deadline. For GitHub.com, the cited deadline is 10 seconds.
Signature verification fails Wrong secret, incorrect algorithm, altered body, or incorrect header handling. Compare implementation with the provider’s signing instructions; verify on the raw body and rotate/configure the correct secret if needed. Never bypass verification as a production fix.
An action happens twice The provider retried, an operator replayed a delivery, or the consumer received the same event more than once. Deduplicate on the stable provider event/delivery identifier and make downstream actions idempotent.
Events fail after an API/schema change The producer’s event version no longer matches assumptions in the consumer. Pin and test the expected schema version where supported; validate optional fields defensively and monitor delivery errors.
Large events are rejected The payload exceeds a provider or infrastructure limit. Check the provider’s documented payload cap and your proxy/server limits. For GitHub, the documented event payload cap is 25 MB.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost

Webhooks generally avoid the repeated requests that polling makes when nothing has changed, and can reduce API usage as the number of monitored objects grows. They do not eliminate cost: the receiver, queue, storage, monitoring, and worker capacity still need to be operated. Polling can remain cheaper and simpler for a tiny or rarely checked resource set, especially when the provider has no event you need.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reliability depends on the complete path: provider retry behavior, endpoint availability, durable acceptance, queue health, idempotent processing, and recovery tooling. Measure delivery-to-acknowledgment time and time-to-completion separately. Maintain an operational record that can distinguish an invalid request, a duplicate, a queued event, and a business-processing failure.

Or skip the browser setup

When an automation flow needs a website screenshot as one of its steps, ScreenshotNeo provides a website screenshot API and MCP server. Its one-call API can return an image or PDF; options include full-page capture, element selection, wait conditions, custom headers and cookies, and asynchronous jobs with signed webhooks. For API details and parameters, see the ScreenshotNeo documentation.

cURL example:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python example:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js example:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating page verdict and billing. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month—no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Do webhooks guarantee that an event is delivered exactly once?

Not by default. Treat delivery as at-least-once unless the provider explicitly documents another guarantee, and protect side effects with idempotency.

Is a webhook always faster or cheaper than polling?

No. A webhook can avoid repeated requests and reduce event delay, but it adds endpoint and recovery operations. Polling may be simpler for occasional checks or a small resource set.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.