FME Flow: 2024.2

Webhook

The Webhook trigger receives JSON and other data in the body of an HTTP POST, PUT, or DELETE request message.

For the webhook to receive a JSON-formatted request body, you must configure the message schema to match the expected data (see Output Attributes, below).

The Webhook trigger has two output ports. The success port () can send a message if the trigger initiates successfully. The failure port (x) can send a message if the trigger fails to initiate.

Parameters

  • Webhook URL: The URL of the webhook. This parameter is auto-generated when you save the workflow. Once generated, you can click the clipboard icon to copy.
  • Requires Authentication: If checked, the user that accesses the Webhook URL must have Webhooks permission on the Webhook trigger.

Output Attributes

See Also

Configuring the Webhook Schema

For the webhook to receive a JSON-formatted request body, you must configure the message schema to match the expected data, as follows:

  1. Under the Output Attributes tab, click Import Parameters from JSON.
  2. In the Import Parameters from JSON dialog, enter a valid JSON schema, and click Parse.
  3. Note  The parser only parses top-level keys. To access the contents of nested arrays and objects from a workspace, use JSON manipulation transformers.

The imported parameters appear under "Webhook Attributes", prefixed with the webhook parent property.

Other Attributes

Attribute Description
time Event time
source Event type
error.type

(Failure port only) Error type:

  • InvalidMessage: An error occurred while configuring this component, such as missing or malformed values.
  • DeadLetter: An error occured while connecting to an external resource. Examples may include connection issues, invalid credentials, or generic external resource exceptions.
error.message (Failure port only) Error message
message (Success port only) Message content
webhook.headers (Success port only) The headers in the HTTP request, in the form of a JSON string.
webhook.method (Success port only) The HTTP request method that triggered the webhook: POST, PUT, or DELETE.

Working with non-JSON Data

In addition to JSON-formatted data, webhook triggers can receive text, xml, and other data. The following table explains how non-JSON data is formatted to output attributes.

Content-Type

Message Encoding

text/* Remains in text to the message attribute.
application/xml Formatted as text to the message attribute.
application/x-www-form-urlencoded Formatted as text to the message attribute.
application/* or other Base64 to the message attribute.