Patterns
intermediateintegration

Event-Driven Webhook Handler

Receive real-time events from external systems via webhooks, validate them, and trigger the appropriate workflow response. The foundation of reactive automation.

Views14
BPMN 2.0
On this page

Visual Flow

Rendering diagram…

When to Use This Pattern

Use event-driven webhooks when:

  • An external system can send HTTP notifications when something happens
  • You need real-time response (not batch/polling)
  • You're integrating with SaaS platforms that offer webhook support (Stripe, GitHub, Jira, ServiceNow, etc.)
  • You want your Nintex workflows to react instantly to external events

How It Works

StepComponentAction
1External systemEvent occurs (payment received, issue created)
2External systemSends HTTP POST to your webhook URL
3Webhook endpointReceives, validates, and acknowledges the request
4RouterInspects the event type and routes to the appropriate workflow
5WorkflowProcesses the event (creates task, updates record, sends notification)

Implementation Guide

Step 1: Create the Webhook Endpoint

In Nintex Workflow Cloud, use a Start event: External start to create a webhook URL. The platform gives you a unique URL like:

https://your-tenant.workflowcloud.com/api/v1/workflow/published/xxxxx-xxxxx/start
Step 2: Validate Incoming Requests

Never trust incoming webhooks blindly:

ValidationHow
Signature verificationCheck the HMAC signature in the request header against your shared secret
Source IP whitelistOnly accept requests from known IP ranges
Payload schemaValidate that required fields exist and have correct types
Idempotency checkCheck if you've already processed this event ID
Timestamp checkReject events older than 5 minutes (replay protection)
Step 3: Acknowledge Quickly

The external system expects a fast response (usually within 5-30 seconds):

  1. Respond immediately with 200 OK
  2. Process asynchronously — don't do heavy processing in the webhook handler
  3. If you can't process now, queue the event and process it later
Step 4: Route by Event Type

Most webhook providers send different event types:

Event TypeWorkflow Action
payment.succeededUpdate order status, send receipt
payment.failedNotify customer, retry payment
invoice.createdSync to accounting system
customer.updatedUpdate CRM record
subscription.cancelledTrigger retention workflow
Step 5: Handle Failures and Retries

Webhook providers typically retry failed deliveries:

  • Return 200 for successfully received events (even if processing fails later)
  • Return 4xx only if the request is malformed
  • Return 5xx if you want the provider to retry
  • Build your own retry for processing failures using the Retry with Exponential Backoff pattern

Tips & Best Practices

Important

Always respond to webhooks within the timeout period (usually 5-30 seconds). If your processing takes longer, accept the webhook, queue the work, and process asynchronously.

  • Log everything. Store the raw webhook payload, headers, and your processing result. When something goes wrong, you need to replay the exact request.
  • Use a dead letter queue. Events that fail processing repeatedly should be moved to a dead letter queue for manual investigation, not silently dropped.
  • Monitor delivery gaps. Webhook providers show delivery history. Check periodically for failed deliveries that weren't retried.
  • Handle out-of-order events. Events might arrive out of order. Your processing logic should be resilient to receiving "invoice.paid" before "invoice.created".

Related patterns