Skip to main content
When your pipeline includes a callback output node, DocPipe sends the processing results to your webhook URL when a run completes.

Setting up callbacks

  1. Add a Callback output node to your pipeline
  2. Configure the URL where you want to receive results
  3. Optionally add custom headers (for example, an authorization token)
  4. Save and activate the pipeline

Payload format

DocPipe sends a POST request to your callback URL with a JSON payload containing the run results:
{
  "runId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "pipeId": "7fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "Completed",
  "fileName": "invoice.pdf",
  "data": {
    "vendor_name": "Acme Corp",
    "invoice_number": "INV-2024-001",
    "total_amount": 1250.00,
    "currency": "USD",
    "line_items": [
      {
        "description": "Widget A",
        "quantity": 10,
        "unit_price": 100.00,
        "amount": 1000.00
      },
      {
        "description": "Widget B",
        "quantity": 5,
        "unit_price": 50.00,
        "amount": 250.00
      }
    ]
  },
  "completedAt": "2024-01-15T10:30:00Z"
}
The data field contains the extracted data matching your pipeline’s output schema.

Webhook signing verification

To verify that webhook requests are genuinely from DocPipe, you can use webhook signing keys.
  1. Generate a webhook signing key in your organization settings
  2. DocPipe includes a signature in the request headers
  3. Verify the signature in your application before processing the payload

Verifying the signature

The webhook signature is included in the request headers. Compare it against a computed HMAC-SHA256 hash of the request body using your signing key:
const crypto = require("crypto");

function verifyWebhookSignature(payload, signature, signingKey) {
  const computed = crypto
    .createHmac("sha256", signingKey)
    .update(payload)
    .digest("hex");

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(computed)
  );
}
import hmac
import hashlib

def verify_webhook_signature(payload: bytes, signature: str, signing_key: str) -> bool:
    computed = hmac.new(
        signing_key.encode(),
        payload,
        hashlib.sha256
    ).hexdigest()

    return hmac.compare_digest(signature, computed)

Retry behavior

If your webhook endpoint returns a non-2xx status code, DocPipe retries the delivery:
  • Up to 3 retries with exponential backoff
  • Retry intervals: 1 minute, 5 minutes, 30 minutes
  • After all retries fail, the callback is marked as failed (the run itself is not affected)

Testing locally

To test webhooks during development, use a tunnel service to expose your local server:
  1. Start your local webhook endpoint
  2. Use a tunneling tool to get a public URL
  3. Configure the callback output with the public URL
  4. Upload a test document to trigger the pipeline
Use your production webhook signing key verification in development too, to catch integration issues early.