Polar Trigger icon

Polar Trigger

Handle Polar.sh webhooks (Manual UI Setup Required)

Overview

This node acts as a webhook trigger for Polar.sh events, allowing n8n workflows to respond automatically when specific events occur in the Polar.sh platform. It listens for incoming HTTP POST requests from Polar.sh webhooks and processes them based on user-selected event types and authentication methods.

Common scenarios where this node is beneficial include:

  • Automating customer management workflows when a new customer is created or updated.
  • Triggering order processing or notification workflows upon order creation or updates.
  • Responding to subscription lifecycle events such as creation, updates, or cancellations.
  • Handling benefit grants or revocations to customers.
  • Integrating donation or pledge events into CRM or accounting systems.

Practical example: When a new order is completed in Polar.sh, this node can trigger a workflow that sends a confirmation email to the customer and updates inventory records.

Properties

Name Meaning
Authentication Method to authenticate incoming webhook requests. Options: None, Webhook Secret (recommended), or Credentials (not required).
Webhook Secret The secret key configured in Polar.sh used to verify webhook authenticity. Required if "Webhook Secret" authentication is selected.
Events List of Polar.sh event types to listen for. Only webhook calls matching these events will trigger the workflow. Available events include benefit, checkout, customer, donation, order, organization, pledge, product, and subscription related events.
Setup Instructions Informational notice guiding manual setup steps to configure the webhook URL and secret in Polar.sh developer settings.
Options Collection of additional options:
โ€ข Validate Timestamp: Whether to check the webhook timestamp for freshness (default true).
โ€ข Timestamp Tolerance: Allowed time difference in seconds (default 300).
โ€ข Include Headers: Whether to include webhook headers in output.
โ€ข Include Raw Body: Whether to include the raw webhook body in output.

Output

The node outputs JSON data representing the webhook payload received from Polar.sh, enriched with some metadata:

  • json: Contains the parsed webhook payload fields.
  • Additional fields added:
    • webhook_id: The unique identifier of the webhook call.
    • webhook_timestamp: The timestamp sent by Polar.sh with the webhook.
  • Optionally included (based on node options):
    • headers: The full HTTP headers of the webhook request.
    • raw_body: The raw string body of the webhook request.

No binary data output is produced by this node.

Dependencies

  • Requires an active Polar.sh account with webhook endpoints configured manually in the Polar.sh Developer Settings.
  • If using "Webhook Secret" authentication, the secret must be set both in Polar.sh webhook configuration and in the node's properties.
  • No external API keys are strictly required unless choosing the "Credentials" authentication option, which is not mandatory.
  • The node depends on internal utility functions for validating webhook signatures and timestamps.

Troubleshooting

  • Invalid JSON in request body: Occurs if the webhook payload is malformed. Ensure Polar.sh sends valid JSON.
  • Webhook secret is required for authentication: Happens if "Webhook Secret" authentication is selected but no secret is provided in the node.
  • Missing required webhook headers: The webhook request must include webhook-id, webhook-timestamp, and webhook-signature headers for secret-based authentication.
  • Webhook timestamp is too old: The webhook timestamp differs from the current time by more than the allowed tolerance (default 5 minutes). Adjust tolerance or check system clocks.
  • Invalid webhook signature: Signature verification failed, likely due to mismatched webhook secret between Polar.sh and the node configuration.
  • Event filtering: If no events are selected or the incoming event type does not match any selected event, the workflow will not trigger.

To resolve errors, verify webhook secret correctness, ensure proper header transmission, and confirm event selections match expected webhook events.

Links and References

Discussion