Skip to main content

Webhooks

Overview

Webhooks in the fastn platform are used for event-based triggers for flows.

These are typically used with Workflows for asynchronous jobs.

Registering a New Webhook

From the left side menu navigate to the Webhhok page and then click on Add Webhook.

Fastn

  1. Enter a descriptive name for your webhook

  2. Dead Letter Queue : Enable the dead letter queue settings if necessary. Dead letter queues store messages that cannot be delivered, providing a safety net for your webhook.

  3. Select an Event Model : These models can be selected to apply to incoming input events. Fastn

  4. Webhook ID : If desired, enter a unique identifier as the webhook ID. This step is optional and can be used for additional customization or tracking purposes.

  5. Register : Finally, click on button to complete the webhook registration process.

Routes

Routes give users a webhook url which can be tied to a route. A configured route will run its assigned flow every time the webhook url is triggered externally.

After registering your webhook, configure routes to specify how the incoming data should be processed.

Fastn-route

To add a route, click on "Add Route".

Fastn-add-route

  1. Provide a name for the route to identify it later

  2. Select the destination API where you want to add the route .

  3. Add Pattern Filters : Pattern filters are criteria or conditions applied to incoming data to selectively process or route specific events based on defined patterns.

Fastn-pattern-filter

To add Pattern Filters, follow the steps below:

  • Click on the Pattern Filters section.
  • Add the key that you want,for example type .
  • Choose the operator that you want, for example Equals .
  • Add the value that you want, for example,user .

Fastn-add-pattern-2

  1. Add Headers : After defining the criteria for processing data using patterns and filters, you have the option to further customize the outgoing HTTP request by adding headers. Headers provide additional instructions and details to the destination where the webhook payload is sent.

Fastn-header

To add Headers, follow the steps below:

  • Click on Add in Headers section.
  • Add the key that you want, for example , Content-Type .
  • Add the value that you want, for example, application/json
  • Add the value that you want, for example, user

Fastn-add-header

  1. Batch Window: Use this to define the size of a batch to be processed

  2. Add Description : Once you have added headers for your webhook route, it's beneficial to add descriptions to provide additional context and understanding of the specific route.

    Enter a brief and informative description that highlights the purpose or functionality of this particular route.

  3. Click on Configure to save your route settings, and then click on Next.

Triggers

After registering and configuring routes for your webhook on fastn.ai, you have the option to set up triggers for your webhook.

Triggers can be configured for auto-triggering the webhook and its configured workflow based on a schedule.

Follow these steps to set up the trigger for your webhook:

Fastn-trigger

  1. Click on the "Enable Schedule" toggle to activate the scheduling feature .

  2. Choose between two scheduling options: Timeor Rate depending on your requirements.

  3. Choose the destination API: where the webhook payload will be sent.

  4. Click on the Save button : to confirm your trigger.