Webhook Action
The Webhook Action sends an HTTP request to a specified URL.
Configuration
Condition
In the Action Condition section, you can specify the conditions under which the action will be executed using the values (Message or Context) from the event source to the channel. For more details on the expressions you can input, refer to Use Expressions in Actions.
In this input field, you can enter expressions representing data related to the trigger that starts the Flux application (e.g., event.payload.temp) or data related to the channel where the action is added (e.g., payload.temp).
Config
Configure the HTTP request to be sent.
HTTP Method
Select the HTTP method for the Webhook.
URL
Enter the URL for the Webhook destination.
In this input field, you can enter expressions representing data related to the trigger that starts the Flux application (e.g., ${event.payload.temp}) or data related to the channel where the action is added (e.g., ${payload.temp}). For details on supported expressions, refer to Action Config Expressions.
Auth Type
Select the Authentication Method for the Webhook.
For details on configuring and using header manipulations, refer to the Authorization Header page.
In addition to the methods covered there, the Webhook Action supports the following authentication methods:
-
Google Service Account: Uses a Google Service Account (JSON) credential set to obtain an access token from Google's OAuth 2.0 token endpoint, and appends an
Authorization: Bearer {access_token}header to the request. When you select this method, configure the following fields:- Credentials: Select a Google Service Account (JSON) credential set.
- Scope: Enter the OAuth 2.0 scopes required to access the target Google API. Separate multiple scopes with spaces. For the list of supported scopes, refer to Google for Developers' OAuth 2.0 Scopes for Google APIs documentation.
- Subject: Enter the email of the user to impersonate when using Google Workspace domain-wide delegation. Leave blank otherwise.
In the Scope and Subject input fields, you can also use expressions to represent data related to the trigger that activated the Flux application (e.g.,
${event.payload.email}) or data related to the channel where the action was added (e.g.,${payload.email}). For details on supported expressions, refer to Action Config Expressions.Google Service Account vs. Bearer (JWT): With Google Service Account, an access token is exchanged via Google's OAuth 2.0 token endpoint before the Webhook request is sent. With Bearer (JWT), the JWT itself is sent as the
Authorization: Bearer {token}header. For new integrations that use Google Service Account (JSON) credentials, Google Service Account is usually the right choice. -
Custom Header: Adds the selected credential value to an arbitrary HTTP header. When you select this method, configure the following fields:
- Credentials: Select an API Token credential or Pre-Shared Key to be used as the header value.
- Header Name: Enter the HTTP header name to receive the credential. For example, if the destination service accepts an API key in the
x-api-keyheader, enterx-api-key.
In the Header Name input field, you can also use expressions to represent data related to the trigger that activated the Flux application (e.g.,
${event.payload.temp}) or data related to the channel where the action was added (e.g.,${payload.temp}). For details on supported expressions, refer to Action Config Expressions.
HTTP Headers
Click Add to enter the Header Name and Value for the HTTP headers.
In this input field, you can also use expressions to represent data related to the trigger that activated the Flux application (e.g., ${event.payload.temp}) or data related to the channel where the action was added (e.g., ${payload.temp}). For details on supported expressions, refer to Action Config Expressions.
HTTP Body
Configure the HTTP body by selecting the Content Type and payload.
- No Body: Do not send an HTTP body.
- application/json: Send
content-type: application/json. - text/plain: Send
content-type: text/plain. - Other: Specify a custom Content Type. If needed, click Add in HTTP Headers to set the HTTP headers.
- Forward as-is: Send the input data for the Webhook Action as the HTTP body.
In the HTTP body input field, you can enter expressions that represent data related to the trigger that launches the Flux app (e.g., ${event.payload.temp}) or expressions that represent data related to the channel to which the action is added (e.g., ${payload.temp}). For more details on the expressions you can input, refer to Action Config Expressions.
Output
Configure how to handle the output data of the action. Refer to Enable Republishing of Action Output for more details.
Output Data of the Action
The output data is the response from the Webhook destination.
A note on Webhook Action limitations:
- The Webhook Action times out after 10 seconds. Services that take more than 10 seconds to respond cannot be used.
- The response from the Webhook destination is truncated at 32,768 bytes.